// // C++ Interface: STApplyCal // // Description: // // Apply any apply tables to target data. // // Author: Takeshi Nakazato (C) 2012 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAP_APPLY_CAL_H #define ASAP_APPLY_CAL_H #include #include #include #include #include #include #include #include #include "Scantable.h" #include "STSelector.h" #include "STApplyTable.h" #include "STCalEnum.h" //#include "Calibrator.h" //#include "Interpolator1D.h" #include "STCalSkyTable.h" #include "STCalTsysTable.h" namespace asap { template class Interpolator1D; class Calibrator; /** Apply any apply tables to target data @author Takeshi Nakazato @date $Date:$ @version $Revision:$ */ class STApplyCal { public: STApplyCal(); STApplyCal(casacore::CountedPtr target); ~STApplyCal(); // set data void setTarget(casacore::CountedPtr target); void setTarget(const casacore::String &name); // push new caltable void push(STCalSkyTable *table); void push(STCalTsysTable *table); // set interpolation method //void setInterpolation(STCalEnum::InterpolationAxis axis, STCalEnum::InterpolationType itype, casacore::Int order=-1); void setTimeInterpolation(STCalEnum::InterpolationType itype, casacore::Int order=-1); void setFrequencyInterpolation(STCalEnum::InterpolationType itype, casacore::Int order=-1); // set IF (spw) mapping for Tsys transfer void setTsysTransfer(casacore::uInt from, casacore::Vector to); // apply tables void apply(casacore::Bool insitu=false, casacore::Bool filltsys=true); // split target data and store it to disk void save(const casacore::String &name); // reset all settings except target scantable void reset(); // reset all settings void completeReset(); private: // initialization void init(); // setup interpolator void initInterpolator(); // single loop element in apply() void doapply(casacore::uInt beamno, casacore::uInt ifno, casacore::uInt polno, casacore::Vector &rows, casacore::Vector &skylist, casacore::Bool filltsys=true); // get frequency information from FREQUENCIES subtable casacore::Vector getBaseFrequency(casacore::uInt whichrow); // search spwmap_ to get IFNO for Tsys casacore::uInt getIFForTsys(casacore::uInt to); // target data casacore::CountedPtr target_; // working data casacore::CountedPtr work_; // calibrator casacore::CountedPtr calibrator_; // interpolation method STCalEnum::InterpolationType iTime_; STCalEnum::InterpolationType iFreq_; casacore::Int order_; casacore::CountedPtr > interpolatorT_; casacore::CountedPtr > interpolatorF_; casacore::CountedPtr > interpolatorS_; // IF (spw) mapping for Tsys transfer map > spwmap_; // list of apply tables std::vector skytable_; std::vector tsystable_; // calibration type STCalEnum::CalType caltype_; casacore::Bool doTsys_; // selector STSelector sel_; // logger casacore::LogIO os_; }; } #endif