[2720] | 1 | //
|
---|
| 2 | // C++ Interface: STApplyCal
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | //
|
---|
| 6 | // Apply any apply tables to target data.
|
---|
| 7 | //
|
---|
| 8 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012
|
---|
| 9 | //
|
---|
| 10 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 11 | //
|
---|
| 12 | //
|
---|
| 13 | #ifndef ASAP_APPLY_CAL_H
|
---|
| 14 | #define ASAP_APPLY_CAL_H
|
---|
| 15 |
|
---|
| 16 | #include <map>
|
---|
| 17 | #include <vector>
|
---|
| 18 |
|
---|
| 19 | #include <casa/Containers/Block.h>
|
---|
| 20 | #include <casa/Arrays/Vector.h>
|
---|
| 21 | #include <casa/Logging/LogIO.h>
|
---|
| 22 | #include <tables/Tables/Table.h>
|
---|
| 23 | #include <tables/Tables/ScalarColumn.h>
|
---|
| 24 | #include <measures/TableMeasures/ScalarMeasColumn.h>
|
---|
| 25 |
|
---|
| 26 | #include "Scantable.h"
|
---|
| 27 | #include "STSelector.h"
|
---|
| 28 | #include "STApplyTable.h"
|
---|
| 29 | #include "STCalEnum.h"
|
---|
| 30 | #include "Calibrator.h"
|
---|
| 31 | #include "Interpolator1D.h"
|
---|
| 32 | #include "STCalSkyTable.h"
|
---|
| 33 | #include "STCalTsysTable.h"
|
---|
| 34 |
|
---|
| 35 | namespace asap {
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | Apply any apply tables to target data
|
---|
| 39 |
|
---|
| 40 | @author Takeshi Nakazato
|
---|
| 41 | @date $Date:$
|
---|
| 42 | @version $Revision:$
|
---|
| 43 | */
|
---|
| 44 | class STApplyCal {
|
---|
| 45 | public:
|
---|
| 46 | STApplyCal();
|
---|
| 47 | STApplyCal(casa::CountedPtr<Scantable> target);
|
---|
| 48 |
|
---|
| 49 | ~STApplyCal();
|
---|
| 50 |
|
---|
| 51 | // set data
|
---|
| 52 | void setTarget(casa::CountedPtr<Scantable> target);
|
---|
| 53 | void setTarget(const casa::String &name);
|
---|
| 54 |
|
---|
| 55 | // push new caltable
|
---|
| 56 | void push(STCalSkyTable *table);
|
---|
| 57 | void push(STCalTsysTable *table);
|
---|
| 58 |
|
---|
| 59 | // set interpolation method
|
---|
| 60 | void setInterpolation(STCalEnum::InterpolationAxis axis, STCalEnum::InterpolationType itype, casa::Int order=-1);
|
---|
| 61 |
|
---|
| 62 | // set IF (spw) mapping for Tsys transfer
|
---|
| 63 | void setTsysTransfer(casa::uInt from, casa::Vector<casa::uInt> to);
|
---|
| 64 |
|
---|
| 65 | // apply tables
|
---|
| 66 | void apply(casa::Bool insitu=true);
|
---|
| 67 |
|
---|
| 68 | // split target data and store it to disk
|
---|
| 69 | void save(const casa::String &name);
|
---|
| 70 |
|
---|
| 71 | private:
|
---|
| 72 | // initialization
|
---|
| 73 | void init();
|
---|
| 74 |
|
---|
| 75 | // single loop element in apply()
|
---|
| 76 | void doapply(casa::uInt beamno, casa::uInt ifno, casa::uInt polno,
|
---|
| 77 | casa::Vector<casa::uInt> &rows,
|
---|
| 78 | casa::Vector<casa::uInt> &skylist);
|
---|
| 79 |
|
---|
| 80 | // get frequency information from FREQUENCIES subtable
|
---|
| 81 | casa::Vector<casa::Double> getBaseFrequency(casa::uInt whichrow);
|
---|
| 82 |
|
---|
| 83 | // time sort
|
---|
| 84 | casa::Vector<casa::uInt> timeSort(casa::Vector<casa::Double> &t);
|
---|
| 85 |
|
---|
| 86 | // search spwmap_ to get IFNO for Tsys
|
---|
| 87 | casa::uInt getIFForTsys(casa::uInt to);
|
---|
| 88 |
|
---|
| 89 | // target data
|
---|
| 90 | casa::CountedPtr<Scantable> target_;
|
---|
| 91 |
|
---|
| 92 | // working data
|
---|
| 93 | casa::CountedPtr<Scantable> work_;
|
---|
| 94 |
|
---|
| 95 | // calibrator
|
---|
| 96 | casa::CountedPtr<Calibrator> calibrator_;
|
---|
| 97 |
|
---|
| 98 | // interpolation method
|
---|
| 99 | std::vector<STCalEnum::InterpolationType> interp_;
|
---|
| 100 | casa::Bool is2d_;
|
---|
| 101 | casa::Int order_;
|
---|
| 102 | casa::CountedPtr<Interpolator1D> interpolatorT_;
|
---|
| 103 | casa::CountedPtr<Interpolator1D> interpolatorF_;
|
---|
| 104 | casa::CountedPtr<Interpolator1D> interpolatorS_;
|
---|
| 105 |
|
---|
| 106 | // IF (spw) mapping for Tsys transfer
|
---|
| 107 | map<casa::uInt, casa::Vector<casa::uInt> > spwmap_;
|
---|
| 108 |
|
---|
| 109 | // list of apply tables
|
---|
| 110 | std::vector<STCalSkyTable*> skytable_;
|
---|
| 111 | std::vector<STCalTsysTable*> tsystable_;
|
---|
| 112 |
|
---|
| 113 | // calibration type
|
---|
| 114 | STCalEnum::CalType caltype_;
|
---|
| 115 | casa::Bool doTsys_;
|
---|
| 116 |
|
---|
| 117 | // selector
|
---|
| 118 | STSelector sel_;
|
---|
| 119 |
|
---|
| 120 | // logger
|
---|
| 121 | casa::LogIO os_;
|
---|
| 122 | };
|
---|
| 123 |
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | #endif
|
---|