Ignore:
Timestamp:
01/31/13 20:04:58 (11 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:

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

First version of Calibrator class for OTF scan without OFF.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/CalibrationManager.cpp

    r2756 r2757  
    2626#include "STCalTsys.h"
    2727#include "STCalSkyPSAlma.h"
     28#include "STCalSkyOtfAlma.h"
    2829
    2930using namespace casa;
     
    161162  }
    162163  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()) {
    167169      os_ << LogIO::DEBUGGING << "ALMA specific position-switch calibration." << LogIO::POST;
    168170      STCalSkyPSAlma cal(target_);
     
    171173    }
    172174    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.";
    174192      os_.origin(LogOrigin("CalibrationManager","calibrate",WHERE));
    175193      os_ << LogIO::SEVERE << msg << LogIO::POST;
     
    249267}
    250268
    251 }
     269Bool 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.