[2742] | 1 | //
|
---|
| 2 | // C++ Interface: CalibrationManager
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | //
|
---|
| 6 | //
|
---|
| 7 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2012
|
---|
| 8 | //
|
---|
| 9 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | #ifndef ASAP_CALIBRATION_MANAGER_H
|
---|
| 13 | #define ASAP_CALIBRATION_MANAGER_H
|
---|
| 14 |
|
---|
[3085] | 15 | // ASAP
|
---|
| 16 | // ScantableWrapper.h must be included first to avoid compiler warnings
|
---|
| 17 | // related with _XOPEN_SOURCE
|
---|
| 18 | #include "ScantableWrapper.h"
|
---|
| 19 | #include "STApplyCal.h"
|
---|
| 20 | #include "STCalTsys.h"
|
---|
| 21 | #include "STCalibration.h"
|
---|
| 22 | #include "STCalEnum.h"
|
---|
| 23 |
|
---|
[2742] | 24 | #include <string>
|
---|
| 25 | #include <vector>
|
---|
| 26 |
|
---|
| 27 | //#include <boost/scoped_ptr>
|
---|
| 28 |
|
---|
| 29 | #include <casa/BasicSL/String.h>
|
---|
| 30 | #include <casa/Utilities/CountedPtr.h>
|
---|
| 31 | #include <casa/Logging/LogIO.h>
|
---|
| 32 |
|
---|
| 33 | namespace asap {
|
---|
| 34 |
|
---|
| 35 | /**
|
---|
| 36 | * Class for calibration management.
|
---|
| 37 | * It also intends to be an interface for Python layer.
|
---|
| 38 | * @author TakeshiNakazato
|
---|
| 39 | */
|
---|
| 40 | class CalibrationManager {
|
---|
| 41 | public:
|
---|
| 42 | CalibrationManager();
|
---|
| 43 |
|
---|
| 44 | virtual ~CalibrationManager();
|
---|
| 45 |
|
---|
| 46 | void setScantable(ScantableWrapper &s);
|
---|
| 47 | void setScantableByName(const std::string &s);
|
---|
[2762] | 48 | void addApplyTable(const std::string &c);
|
---|
[2742] | 49 | void addSkyTable(const std::string &c);
|
---|
| 50 | void addTsysTable(const std::string &c);
|
---|
| 51 | void setMode(const std::string &mode);
|
---|
| 52 | void setTimeInterpolation(const std::string &interp, int order=-1);
|
---|
| 53 | void setFrequencyInterpolation(const std::string &interp, int order=-1);
|
---|
| 54 | void setTsysSpw(const std::vector<int> &spwlist);
|
---|
[3106] | 55 | void setTsysSpwWithRange(const casacore::Record &spwlist, bool average=false);
|
---|
[2742] | 56 | void setTsysTransfer(unsigned int from,
|
---|
| 57 | const std::vector<unsigned int> &to);
|
---|
[3106] | 58 | void setCalibrationOptions(const casacore::Record &options) {options_ = options;}
|
---|
[2742] | 59 | void resetCalSetup();
|
---|
| 60 | void reset();
|
---|
| 61 |
|
---|
| 62 | void calibrate();
|
---|
[2750] | 63 | void apply(bool insitu=false, bool filltsys=true);
|
---|
[2742] | 64 | void saveCaltable(const std::string &name);
|
---|
| 65 | void split(const std::string &name);
|
---|
| 66 | private:
|
---|
| 67 | STCalEnum::InterpolationType stringToInterpolationEnum(const std::string &s);
|
---|
| 68 |
|
---|
[3106] | 69 | casacore::Bool isAlmaAntenna();
|
---|
[2757] | 70 |
|
---|
[3106] | 71 | casacore::CountedPtr<STApplyCal> applicator_;
|
---|
[2742] | 72 |
|
---|
[3106] | 73 | std::vector<casacore::CountedPtr<STApplyTable> > skytables_;
|
---|
| 74 | std::vector<casacore::CountedPtr<STApplyTable> > tsystables_;
|
---|
[2742] | 75 |
|
---|
[3106] | 76 | casacore::CountedPtr<Scantable> target_;
|
---|
[2742] | 77 |
|
---|
[3106] | 78 | casacore::String calmode_;
|
---|
[2742] | 79 | std::vector<int> spwlist_;
|
---|
[3106] | 80 | casacore::Record spwlist_withrange_;
|
---|
[2923] | 81 | bool do_average_;
|
---|
[2742] | 82 |
|
---|
[3106] | 83 | casacore::LogIO os_;
|
---|
[2757] | 84 |
|
---|
[3106] | 85 | casacore::Record options_;
|
---|
[2742] | 86 | };
|
---|
| 87 |
|
---|
| 88 | }
|
---|
| 89 | #endif
|
---|