Changeset 2922


Ignore:
Timestamp:
04/07/14 16:10:14 (11 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-6382

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: test_tsdcal2

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Define new method, setTsysSpwWithRange, to support channel averaging of Tsys.
Implementation is not completed so that it only supports similar
behavior with previous one (which is using setTsysSpw).


Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/CalibrationManager.cpp

    r2762 r2922  
    3636  : target_(0),
    3737    calmode_(""),
    38     spwlist_(0)
     38    spwlist_(0),
     39    spwlist_withrange_()
    3940{
    4041  applicator_ = new STApplyCal();
     
    146147}
    147148
     149void CalibrationManager::setTsysSpwWithRange(const Record &spwlist, bool average)
     150{
     151  os_.origin(LogOrigin("CalibrationManager","setTsysSpw",WHERE));
     152  os_ << LogIO::DEBUGGING << "set IFNO for Tsys calibration to " << LogIO::POST;
     153  spwlist.print(os_.output());
     154  os_ << LogIO::DEBUGGING << LogIO::POST;
     155  os_ << LogIO::DEBUGGING << ((average) ? "with averaging" : "without averaging") << LogIO::POST;
     156  spwlist_withrange_ = spwlist;
     157}
     158
    148159void CalibrationManager::resetCalSetup()
    149160{
     
    153164  calmode_ = "";
    154165  spwlist_.clear();
     166  spwlist_withrange_ = Record();
    155167}
    156168
     
    162174  calmode_ = "";
    163175  spwlist_.clear();
     176  spwlist_withrange_ = Record();
    164177}
    165178
     
    172185  if (calmode_ == "TSYS") {
    173186    //assert(spwlist_.size() > 0);
    174     assert_<AipsError>(spwlist_.size() > 0, "You have to set list of IFNOs for ATM calibration.");
    175     STCalTsys cal(target_, spwlist_);
    176     cal.calibrate();
    177     tsystables_.push_back(cal.applytable());
     187    if (spwlist_withrange_.empty()) {
     188      assert_<AipsError>(spwlist_.size() > 0, "You have to set list of IFNOs for ATM calibration.");
     189      STCalTsys cal(target_, spwlist_);
     190      cal.calibrate();
     191      tsystables_.push_back(cal.applytable());
     192    }
     193    else {
     194      uInt nfield = spwlist_withrange_.nfields();
     195      vector<int> spwlist(nfield);
     196      for (uInt i = 0; i < nfield; ++i) {
     197        spwlist[i] = std::atoi(spwlist_withrange_.name(i).c_str());
     198      }
     199      STCalTsys cal(target_, spwlist);
     200      cal.calibrate();
     201      tsystables_.push_back(cal.applytable());
     202    }     
    178203  }
    179204  else if (calmode_ == "PS") {
  • trunk/src/CalibrationManager.h

    r2762 r2922  
    5050  void setFrequencyInterpolation(const std::string &interp, int order=-1);
    5151  void setTsysSpw(const std::vector<int> &spwlist);
     52  void setTsysSpwWithRange(const casa::Record &spwlist, bool average=false);
    5253  void setTsysTransfer(unsigned int from,
    5354                       const std::vector<unsigned int> &to);
     
    7475  casa::String calmode_;
    7576  std::vector<int> spwlist_;
     77  casa::Record spwlist_withrange_;
    7678
    7779  casa::LogIO os_;
  • trunk/src/python_CalibrationManager.cpp

    r2762 r2922  
    3434    .def("reset", &CalibrationManager::reset)
    3535    .def("set_tsys_spw", &CalibrationManager::setTsysSpw)
     36    .def("set_tsys_spw_withrange", &CalibrationManager::setTsysSpwWithRange,
     37         (boost::python::arg("spwlist"),
     38          boost::python::arg("average")=false))
    3639    .def("set_tsys_transfer", &CalibrationManager::setTsysTransfer)
    3740    .def("calibrate", &CalibrationManager::calibrate)
Note: See TracChangeset for help on using the changeset viewer.