Changeset 2750


Ignore:
Timestamp:
01/29/13 19:21:55 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Various fixes to avoid segmentation fault, and a few updates on
python interface.


Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/CalibrationManager.cpp

    r2747 r2750  
    182182}
    183183
    184 void CalibrationManager::apply()
     184void CalibrationManager::apply(bool insitu, bool filltsys)
    185185{
    186186  os_.origin(LogOrigin("CalibrationManager","apply",WHERE));
     
    191191  for (size_t i = 0; i < skytables_.size(); i++)
    192192    applicator_->push(dynamic_cast<STCalSkyTable*>(&(*skytables_[i])));
    193   applicator_->apply(false);
     193  applicator_->apply(insitu, filltsys);
    194194}
    195195
     
    198198  os_.origin(LogOrigin("CalibrationManager","saveCaltable",WHERE));
    199199  if (calmode_ == "TSYS") {
     200    assert(tsystables_.size() > 0);
    200201    os_ << LogIO::DEBUGGING << "save latest STCalTsysTable as " << name << "." << LogIO::POST;
    201202    tsystables_[tsystables_.size()-1]->save(name);
    202203  }
    203204  else {
     205    assert(skytables_.size() > 0);
    204206    os_ << LogIO::DEBUGGING << "save latest STCalSkyTable as " << name << "." << LogIO::POST;
    205207    skytables_[skytables_.size()-1]->save(name);
  • trunk/src/CalibrationManager.h

    r2742 r2750  
    5555 
    5656  void calibrate();
    57   void apply();
     57  void apply(bool insitu=false, bool filltsys=true);
    5858  void saveCaltable(const std::string &name);
    5959  void split(const std::string &name);
  • trunk/src/STApplyCal.cpp

    r2742 r2750  
    168168{
    169169  os_.origin(LogOrigin("STApplyCal","apply",WHERE));
     170 
     171  assert(!target_.null());
     172
    170173  // calibrator
    171174  if (caltype_ == STCalEnum::CalPSAlma)
     
    186189
    187190  // working data
    188   if (insitu)
     191  if (insitu) {
     192    os_.origin(LogOrigin("STApplyCal","apply",WHERE));
     193    os_ << "Overwrite input scantable" << LogIO::POST;
    189194    work_ = target_;
    190   else
     195  }
     196  else {
     197    os_.origin(LogOrigin("STApplyCal","apply",WHERE));
     198    os_ << "Create output scantable from input" << LogIO::POST;
    191199    work_ = new Scantable(*target_, false);
     200  }
    192201
    193202  //os_ << "work_->nrow()=" << work_->nrow() << LogIO::POST;
     
    219228    Vector<uInt> rows = iter->getRows(SHARE);
    220229    if (rows.nelements() > 0)
    221       doapply(ids[0], ids[2], ids[1], rows, skycalList);
     230      doapply(ids[0], ids[2], ids[1], rows, skycalList, filltsys);
    222231    iter->next();
    223232  }
  • trunk/src/STApplyCal.h

    r2742 r2750  
    6666
    6767  // apply tables
    68   void apply(casa::Bool insitu=true, casa::Bool filltsys=false);
     68  void apply(casa::Bool insitu=false, casa::Bool filltsys=true);
    6969
    7070  // split target data and store it to disk
     
    8888               casa::Vector<casa::uInt> &rows,
    8989               casa::Vector<casa::uInt> &skylist,
    90                casa::Bool filltsys=false);
     90               casa::Bool filltsys=true);
    9191
    9292  // get frequency information from FREQUENCIES subtable
  • trunk/src/python_CalibrationManager.cpp

    r2742 r2750  
    3434    .def("set_tsys_transfer", &CalibrationManager::setTsysTransfer)
    3535    .def("calibrate", &CalibrationManager::calibrate)
    36     .def("apply", &CalibrationManager::apply)
     36    .def("apply", &CalibrationManager::apply,
     37         (boost::python::arg("insitu")=false,
     38          boost::python::arg("filltsys")=true))
    3739    .def("save_caltable", &CalibrationManager::saveCaltable)
    3840    .def("split", &CalibrationManager::split)
Note: See TracChangeset for help on using the changeset viewer.