- Timestamp:
- 11/18/15 20:02:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STCalTsys.cpp
r2958 r3062 15 15 #include <casa/Arrays/ArrayMath.h> 16 16 #include <casa/Logging/LogIO.h> 17 #include <tables/Tables/ScalarColumn.h> 17 18 18 19 #include "STSelector.h" … … 49 50 void STCalTsys::setupSelector(const STSelector &sel) 50 51 { 52 // sel is an selector object that is associated with 53 // input Scantable 51 54 sel_ = sel; 55 //cout << "original: " << endl << sel_.print() << endl; 52 56 vector<int> ifnos = sel_.getIFs(); 53 57 if (ifnos.size() > 0) { … … 70 74 sel_.setIFs(iflist_); 71 75 } 76 77 // intent selection 78 ROScalarColumn<Int> srctypeCol(scantable_->table(), "SRCTYPE"); 79 Vector<Int> srctype = srctypeCol.getColumn(); 80 uInt calOffCount = 0; 81 uInt calOnCount = 0; 82 for (size_t i = 0; i < srctype.nelements(); ++i) { 83 if (srctype[i] == static_cast<Int>(SrcType::PONCAL)) { 84 calOnCount++; 85 } 86 else if (srctype[i] == static_cast<Int>(SrcType::POFFCAL)) { 87 calOffCount++; 88 } 89 } 90 //cout << "srctype = " << srctype << endl; 91 //cout << "calOnCount, calOffCount = " << calOnCount << "," << calOffCount << endl; 92 if (calOnCount == 0 || calOffCount == 0) { 93 LogIO os(LogOrigin("STCalTsys", "setupSelector", WHERE)); 94 os << LogIO::SEVERE << "Input scantable doesn't have ATMCal intents" << LogIO::EXCEPTION; 95 } 96 97 vector<int> intents = sel_.getTypes(); 98 if (count(intents.begin(), intents.end(), static_cast<Int>(SrcType::POFFCAL)) == 0) { 99 intents.push_back(static_cast<Int>(SrcType::POFFCAL)); 100 sel_.setTypes(intents); 101 } 102 103 //cout << "modified: " << endl << sel_.print() << endl; 72 104 } 73 105
Note:
See TracChangeset
for help on using the changeset viewer.