Changeset 2757 for trunk/src


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


Location:
trunk/src
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/CMakeLists.txt

    r2742 r2757  
    7676     ${SRCDIR}/STCalibration.cpp
    7777     ${SRCDIR}/STCalSkyPSAlma.cpp
     78     ${SRCDIR}/STCalSkyOtfAlma.cpp
    7879     ${SRCDIR}/STCalTsys.cpp
    7980     ${SRCDIR}/STApplyCal.cpp
  • 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}
  • trunk/src/CalibrationManager.h

    r2750 r2757  
    5151  void setTsysTransfer(unsigned int from,
    5252                       const std::vector<unsigned int> &to);
     53  void setCalibrationOptions(const casa::Record &options) {options_ = options;}
    5354  void resetCalSetup();
    5455  void reset();
     
    6061private:
    6162  STCalEnum::InterpolationType stringToInterpolationEnum(const std::string &s);
     63
     64  casa::Bool isAlmaAntenna();
    6265
    6366  casa::CountedPtr<STApplyCal> applicator_;
     
    7275
    7376  casa::LogIO os_;
     77
     78  casa::Record options_;
    7479};
    7580
  • trunk/src/EdgeMarker.cpp

    r2617 r2757  
    160160}
    161161
     162Block<uInt> EdgeMarker::getDetectedRows()
     163{
     164  uInt *p = off_.storage();
     165  return Block<uInt>(noff_, p, False);
     166}
     167
    162168CountedPtr<Scantable> EdgeMarker::get()
    163169{
  • trunk/src/EdgeMarker.h

    r2613 r2757  
    4040  void detect() ;
    4141  void mark() ;
     42  casa::Block<casa::uInt> getDetectedRows() ;
    4243  casa::CountedPtr<Scantable> get() ;
    4344//   void reset() ;
  • trunk/src/STCalSkyPSAlma.h

    r2747 r2757  
    3939  STCalSkyPSAlma(casa::CountedPtr<Scantable> &s);
    4040
    41   ~STCalSkyPSAlma() {;}
     41  virtual ~STCalSkyPSAlma() {;}
    4242 
    43 private:
    44   void setupSelector();
    45   void fillCalTable();
     43protected:
     44  virtual void setupSelector();
     45  virtual void fillCalTable();
    4646};
    4747
  • trunk/src/STCalibration.h

    r2749 r2757  
    1313#define ASAPSTCALIBRATION_H
    1414
    15 #include <memory>
    16 
    1715#include <casa/aips.h>
    1816#include <casa/Arrays/Vector.h>
     
    2018#include <casa/Utilities/CountedPtr.h>
    2119#include <casa/Logging/LogIO.h>
     20#include <casa/Containers/Record.h>
    2221
    2322#include <scimath/Mathematics/InterpolateArray1D.h>
     
    4443  //const STApplyTable &applytable() {return *applytable_;}
    4544  const casa::CountedPtr<STApplyTable> applytable() {return applytable_;}
     45
     46  void setOption(casa::Record &rec) {options_ = rec;}
     47
    4648protected:
    4749  virtual void setupSelector() = 0;
     
    5254  casa::CountedPtr<STApplyTable> applytable_;
    5355  casa::LogIO os_;
     56  casa::Record options_;
    5457};
    5558
  • trunk/src/python_CalibrationManager.cpp

    r2750 r2757  
    3030         (boost::python::arg("interp"),
    3131          boost::python::arg("order")=-1))
     32    .def("set_calibration_options", &CalibrationManager::setCalibrationOptions)
    3233    .def("reset", &CalibrationManager::reset)
    3334    .def("set_tsys_spw", &CalibrationManager::setTsysSpw)
Note: See TracChangeset for help on using the changeset viewer.