| 1 | // | 
|---|
| 2 | // C++ Interface: STBaselineTable | 
|---|
| 3 | // | 
|---|
| 4 | // Description: | 
|---|
| 5 | // | 
|---|
| 6 | // ApplyTable for baseline subtraction. | 
|---|
| 7 | // | 
|---|
| 8 | // Author: Wataru Kawasaki <wataru.kawasaki@nao.ac.jp> (C) 2013 | 
|---|
| 9 | // | 
|---|
| 10 | // Copyright: See COPYING file that comes with this distribution | 
|---|
| 11 | // | 
|---|
| 12 | // | 
|---|
| 13 | #ifndef ASAP_BASELINEPARAM_TABLE_H | 
|---|
| 14 | #define ASAP_BASELINEPARAM_TABLE_H | 
|---|
| 15 |  | 
|---|
| 16 | #include <tables/Tables/ArrayColumn.h> | 
|---|
| 17 | #include <tables/Tables/ScalarColumn.h> | 
|---|
| 18 |  | 
|---|
| 19 | #include "Scantable.h" | 
|---|
| 20 | #include "STApplyTable.h" | 
|---|
| 21 | #include "STBaselineEnum.h" | 
|---|
| 22 |  | 
|---|
| 23 | namespace asap { | 
|---|
| 24 |  | 
|---|
| 25 | /** | 
|---|
| 26 | ApplyTable for baseline subtraction | 
|---|
| 27 |  | 
|---|
| 28 | @author Wataru Kawasaki | 
|---|
| 29 | @date $Date:$ | 
|---|
| 30 | @version $Revision:$ | 
|---|
| 31 | */ | 
|---|
| 32 | class STBaselineTable : public STApplyTable { | 
|---|
| 33 | public: | 
|---|
| 34 | STBaselineTable() {;} | 
|---|
| 35 | STBaselineTable(const Scantable& parent); | 
|---|
| 36 | STBaselineTable(const casacore::String &name); | 
|---|
| 37 |  | 
|---|
| 38 | virtual ~STBaselineTable(); | 
|---|
| 39 |  | 
|---|
| 40 | void setup(); | 
|---|
| 41 | const casacore::String& name() const {return name_;}; | 
|---|
| 42 |  | 
|---|
| 43 | void attachOptionalColumns(); | 
|---|
| 44 | void save(const std::string &filename); | 
|---|
| 45 | void setdata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt cycleno, | 
|---|
| 46 | casacore::uInt beamno, casacore::uInt ifno, casacore::uInt polno, | 
|---|
| 47 | casacore::uInt freqid, casacore::Double time, | 
|---|
| 48 | casacore::Bool apply, | 
|---|
| 49 | STBaselineFunc::FuncName ftype, | 
|---|
| 50 | casacore::Vector<casacore::Int> fpar, | 
|---|
| 51 | casacore::Vector<casacore::Float> ffpar, | 
|---|
| 52 | casacore::Vector<casacore::uInt> mask, | 
|---|
| 53 | casacore::Vector<casacore::Float> res, | 
|---|
| 54 | casacore::Float rms, | 
|---|
| 55 | casacore::uInt nchan, | 
|---|
| 56 | casacore::Float cthres, | 
|---|
| 57 | casacore::uInt citer, | 
|---|
| 58 | casacore::Float lfthres, | 
|---|
| 59 | casacore::uInt lfavg, | 
|---|
| 60 | casacore::Vector<casacore::uInt> lfedge); | 
|---|
| 61 | void appenddata(int scanno, int cycleno, | 
|---|
| 62 | int beamno, int ifno, int polno, | 
|---|
| 63 | int freqid, casacore::Double time, | 
|---|
| 64 | bool apply, | 
|---|
| 65 | STBaselineFunc::FuncName ftype, | 
|---|
| 66 | vector<int> fpar, | 
|---|
| 67 | vector<float> ffpar, | 
|---|
| 68 | casacore::Vector<casacore::uInt> mask, | 
|---|
| 69 | vector<float> res, | 
|---|
| 70 | float rms, | 
|---|
| 71 | int nchan, | 
|---|
| 72 | float cthres, | 
|---|
| 73 | int citer, | 
|---|
| 74 | float lfthres, | 
|---|
| 75 | int lfavg, | 
|---|
| 76 | vector<int> lfedge); | 
|---|
| 77 | void appenddata(int scanno, int cycleno, | 
|---|
| 78 | int beamno, int ifno, int polno, | 
|---|
| 79 | int freqid, casacore::Double time, | 
|---|
| 80 | bool apply, | 
|---|
| 81 | STBaselineFunc::FuncName ftype, | 
|---|
| 82 | int fpar, | 
|---|
| 83 | vector<float> ffpar, | 
|---|
| 84 | casacore::Vector<casacore::uInt> mask, | 
|---|
| 85 | vector<float> res, | 
|---|
| 86 | float rms, | 
|---|
| 87 | int nchan, | 
|---|
| 88 | float cthres, | 
|---|
| 89 | int citer, | 
|---|
| 90 | float lfthres, | 
|---|
| 91 | int lfavg, | 
|---|
| 92 | vector<int> lfedge); | 
|---|
| 93 | void appenddata(casacore::uInt scanno, casacore::uInt cycleno, | 
|---|
| 94 | casacore::uInt beamno, casacore::uInt ifno, casacore::uInt polno, | 
|---|
| 95 | casacore::uInt freqid, casacore::Double time, | 
|---|
| 96 | casacore::Bool apply, | 
|---|
| 97 | STBaselineFunc::FuncName ftype, | 
|---|
| 98 | casacore::Vector<casacore::Int> fpar, | 
|---|
| 99 | casacore::Vector<casacore::Float> ffpar, | 
|---|
| 100 | casacore::Vector<casacore::uInt> mask, | 
|---|
| 101 | casacore::Vector<casacore::Float> res, | 
|---|
| 102 | casacore::Float rms, | 
|---|
| 103 | casacore::uInt nchan, | 
|---|
| 104 | casacore::Float cthres, | 
|---|
| 105 | casacore::uInt citer, | 
|---|
| 106 | casacore::Float lfthres, | 
|---|
| 107 | casacore::uInt lfavg, | 
|---|
| 108 | casacore::Vector<casacore::uInt> lfedge); | 
|---|
| 109 | void appendbasedata(int scanno, int cycleno, | 
|---|
| 110 | int beamno, int ifno, int polno, | 
|---|
| 111 | int freqid, casacore::Double time); | 
|---|
| 112 | void setresult(casacore::uInt irow, | 
|---|
| 113 | casacore::Vector<casacore::Float> res, | 
|---|
| 114 | casacore::Float rms); | 
|---|
| 115 | casacore::uInt nchan(casacore::uInt ifno); | 
|---|
| 116 | casacore::Vector<casacore::Bool> getApply() {return applyCol_.getColumn();} | 
|---|
| 117 | bool getApply(int irow); | 
|---|
| 118 | casacore::Vector<casacore::uInt> getFunction() {return ftypeCol_.getColumn();} | 
|---|
| 119 | casacore::Vector<STBaselineFunc::FuncName> getFunctionNames(); | 
|---|
| 120 | STBaselineFunc::FuncName getFunctionName(int irow); | 
|---|
| 121 | casacore::Matrix<casacore::Int> getFuncParam() {return fparCol_.getColumn();} | 
|---|
| 122 | std::vector<int> getFuncParam(int irow); | 
|---|
| 123 | casacore::Matrix<casacore::Float> getFuncFParam() {return ffparCol_.getColumn();} | 
|---|
| 124 | casacore::Matrix<casacore::uInt> getMaskList() {return maskCol_.getColumn();} | 
|---|
| 125 | std::vector<bool> getMask(int irow); | 
|---|
| 126 | casacore::Matrix<casacore::Float> getResult() {return resCol_.getColumn();} | 
|---|
| 127 | casacore::Vector<casacore::Float> getRms() {return rmsCol_.getColumn();} | 
|---|
| 128 | casacore::Vector<casacore::uInt> getNChan() {return nchanCol_.getColumn();} | 
|---|
| 129 | casacore::uInt getNChan(int irow); | 
|---|
| 130 | casacore::Vector<casacore::Float> getClipThreshold() {return cthresCol_.getColumn();} | 
|---|
| 131 | casacore::Vector<casacore::uInt> getClipIteration() {return citerCol_.getColumn();} | 
|---|
| 132 | casacore::Vector<casacore::Float> getLineFinderThreshold() {return lfthresCol_.getColumn();} | 
|---|
| 133 | casacore::Vector<casacore::uInt> getLineFinderChanAvg() {return lfavgCol_.getColumn();} | 
|---|
| 134 | casacore::Matrix<casacore::uInt> getLineFinderEdge() {return lfedgeCol_.getColumn();} | 
|---|
| 135 | void setApply(int irow, bool apply); | 
|---|
| 136 |  | 
|---|
| 137 | private: | 
|---|
| 138 | static const casacore::String name_ ; | 
|---|
| 139 | casacore::ScalarColumn<casacore::Bool> applyCol_; | 
|---|
| 140 | casacore::ScalarColumn<casacore::uInt> ftypeCol_; | 
|---|
| 141 | casacore::ArrayColumn<casacore::Int> fparCol_; | 
|---|
| 142 | casacore::ArrayColumn<casacore::Float> ffparCol_; | 
|---|
| 143 | casacore::ArrayColumn<casacore::uInt> maskCol_; | 
|---|
| 144 | casacore::ArrayColumn<casacore::Float> resCol_; | 
|---|
| 145 | casacore::ScalarColumn<casacore::Float> rmsCol_; | 
|---|
| 146 | casacore::ScalarColumn<casacore::uInt> nchanCol_; | 
|---|
| 147 | casacore::ScalarColumn<casacore::Float> cthresCol_; | 
|---|
| 148 | casacore::ScalarColumn<casacore::uInt> citerCol_; | 
|---|
| 149 | casacore::ScalarColumn<casacore::Float> lfthresCol_; | 
|---|
| 150 | casacore::ScalarColumn<casacore::uInt> lfavgCol_; | 
|---|
| 151 | casacore::ArrayColumn<casacore::uInt> lfedgeCol_; | 
|---|
| 152 | }; | 
|---|
| 153 |  | 
|---|
| 154 | } | 
|---|
| 155 |  | 
|---|
| 156 | #endif | 
|---|