Changeset 2757 for trunk/src/CalibrationManager.cpp
- Timestamp:
- 01/31/13 20:04:58 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/CalibrationManager.cpp
r2756 r2757 26 26 #include "STCalTsys.h" 27 27 #include "STCalSkyPSAlma.h" 28 #include "STCalSkyOtfAlma.h" 28 29 29 30 using namespace casa; … … 161 162 } 162 163 else if (calmode_ == "PS") { 163 // will match DV01-25, DA41-65, PM01-04, CM01-12 164 Regex reant("^(DV(0[1-9]|1[0-9]|2[0-5])|DA(4[1-9]|5[0-9]|6[0-5])|PM0[1-4]|CM(0[1-9]|1[1,2]))$"); 165 const String antname = target_->getAntennaName(); 166 if (reant.match(antname.c_str(), antname.size()) != String::npos) { 164 // // will match DV01-25, DA41-65, PM01-04, CM01-12 165 // Regex reant("^(DV(0[1-9]|1[0-9]|2[0-5])|DA(4[1-9]|5[0-9]|6[0-5])|PM0[1-4]|CM(0[1-9]|1[1,2]))$"); 166 // const String antname = target_->getAntennaName(); 167 // if (reant.match(antname.c_str(), antname.size()) != String::npos) { 168 if (isAlmaAntenna()) { 167 169 os_ << LogIO::DEBUGGING << "ALMA specific position-switch calibration." << LogIO::POST; 168 170 STCalSkyPSAlma cal(target_); … … 171 173 } 172 174 else { 173 String msg = "Calibration type " + calmode_ + " for antenna " + antname + " is not supported."; 175 String msg = "Calibration type " + calmode_ + " for non-ALMA antenna " + target_->getAntennaName() + " is not supported."; 176 os_.origin(LogOrigin("CalibrationManager","calibrate",WHERE)); 177 os_ << LogIO::SEVERE << msg << LogIO::POST; 178 throw AipsError(msg); 179 } 180 } 181 else if (calmode_ == "OTF" || calmode_ == "OTFRASTER") { 182 if (isAlmaAntenna()) { 183 os_ << LogIO::DEBUGGING << "ALMA specific position-switch calibration." << LogIO::POST; 184 STCalSkyOtfAlma cal(target_, (calmode_ == "OTFRASTER")); 185 if (!options_.empty()) 186 cal.setOption(options_); 187 cal.calibrate(); 188 skytables_.push_back(cal.applytable()); 189 } 190 else { 191 String msg = "Calibration type " + calmode_ + " for non-ALMA antenna " + target_->getAntennaName() + " is not supported."; 174 192 os_.origin(LogOrigin("CalibrationManager","calibrate",WHERE)); 175 193 os_ << LogIO::SEVERE << msg << LogIO::POST; … … 249 267 } 250 268 251 } 269 Bool CalibrationManager::isAlmaAntenna() 270 { 271 assert_<AipsError>(!target_.null(), "You have to set target scantable first."); 272 // will match DV01-25, DA41-65, PM01-04, CM01-12 273 Regex reant("^(DV(0[1-9]|1[0-9]|2[0-5])|DA(4[1-9]|5[0-9]|6[0-5])|PM0[1-4]|CM(0[1-9]|1[1,2]))$"); 274 const String antname = target_->getAntennaName(); 275 return (reant.match(antname.c_str(), antname.size()) != String::npos); 276 } 277 278 }
Note: See TracChangeset
for help on using the changeset viewer.