Changeset 2922
- Timestamp:
- 04/07/14 16:10:14 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/CalibrationManager.cpp
r2762 r2922 36 36 : target_(0), 37 37 calmode_(""), 38 spwlist_(0) 38 spwlist_(0), 39 spwlist_withrange_() 39 40 { 40 41 applicator_ = new STApplyCal(); … … 146 147 } 147 148 149 void 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 148 159 void CalibrationManager::resetCalSetup() 149 160 { … … 153 164 calmode_ = ""; 154 165 spwlist_.clear(); 166 spwlist_withrange_ = Record(); 155 167 } 156 168 … … 162 174 calmode_ = ""; 163 175 spwlist_.clear(); 176 spwlist_withrange_ = Record(); 164 177 } 165 178 … … 172 185 if (calmode_ == "TSYS") { 173 186 //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 } 178 203 } 179 204 else if (calmode_ == "PS") { -
trunk/src/CalibrationManager.h
r2762 r2922 50 50 void setFrequencyInterpolation(const std::string &interp, int order=-1); 51 51 void setTsysSpw(const std::vector<int> &spwlist); 52 void setTsysSpwWithRange(const casa::Record &spwlist, bool average=false); 52 53 void setTsysTransfer(unsigned int from, 53 54 const std::vector<unsigned int> &to); … … 74 75 casa::String calmode_; 75 76 std::vector<int> spwlist_; 77 casa::Record spwlist_withrange_; 76 78 77 79 casa::LogIO os_; -
trunk/src/python_CalibrationManager.cpp
r2762 r2922 34 34 .def("reset", &CalibrationManager::reset) 35 35 .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)) 36 39 .def("set_tsys_transfer", &CalibrationManager::setTsysTransfer) 37 40 .def("calibrate", &CalibrationManager::calibrate)
Note:
See TracChangeset
for help on using the changeset viewer.