[2738] | 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 casa::String &name); |
---|
| 37 | |
---|
| 38 | virtual ~STBaselineTable(); |
---|
| 39 | |
---|
| 40 | void setup(); |
---|
| 41 | const casa::String& name() const {return name_;}; |
---|
| 42 | |
---|
| 43 | void attachOptionalColumns(); |
---|
| 44 | void save(const std::string &filename); |
---|
| 45 | void setdata(casa::uInt irow, casa::uInt scanno, casa::uInt cycleno, |
---|
| 46 | casa::uInt beamno, casa::uInt ifno, casa::uInt polno, |
---|
| 47 | casa::uInt freqid, casa::Double time, |
---|
[2767] | 48 | casa::Bool apply, |
---|
[2740] | 49 | STBaselineFunc::FuncName ftype, |
---|
[2767] | 50 | casa::Vector<casa::Int> fpar, |
---|
[2740] | 51 | casa::Vector<casa::Float> ffpar, |
---|
| 52 | casa::Vector<casa::uInt> mask, |
---|
| 53 | casa::Vector<casa::Float> res, |
---|
[2767] | 54 | casa::Float rms, |
---|
| 55 | casa::uInt nchan, |
---|
| 56 | casa::Float cthres, |
---|
| 57 | casa::uInt citer, |
---|
| 58 | casa::Float lfthres, |
---|
| 59 | casa::uInt lfavg, |
---|
| 60 | casa::Vector<casa::uInt> lfedge); |
---|
[2773] | 61 | void appenddata(int scanno, int cycleno, |
---|
| 62 | int beamno, int ifno, int polno, |
---|
| 63 | int freqid, casa::Double time, |
---|
| 64 | bool apply, |
---|
| 65 | STBaselineFunc::FuncName ftype, |
---|
| 66 | vector<int> fpar, |
---|
| 67 | vector<float> ffpar, |
---|
| 68 | casa::Vector<casa::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, casa::Double time, |
---|
| 80 | bool apply, |
---|
| 81 | STBaselineFunc::FuncName ftype, |
---|
| 82 | int fpar, |
---|
| 83 | vector<float> ffpar, |
---|
| 84 | casa::Vector<casa::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); |
---|
[2738] | 93 | void appenddata(casa::uInt scanno, casa::uInt cycleno, |
---|
| 94 | casa::uInt beamno, casa::uInt ifno, casa::uInt polno, |
---|
| 95 | casa::uInt freqid, casa::Double time, |
---|
[2767] | 96 | casa::Bool apply, |
---|
[2740] | 97 | STBaselineFunc::FuncName ftype, |
---|
[2767] | 98 | casa::Vector<casa::Int> fpar, |
---|
[2740] | 99 | casa::Vector<casa::Float> ffpar, |
---|
| 100 | casa::Vector<casa::uInt> mask, |
---|
| 101 | casa::Vector<casa::Float> res, |
---|
[2767] | 102 | casa::Float rms, |
---|
| 103 | casa::uInt nchan, |
---|
| 104 | casa::Float cthres, |
---|
| 105 | casa::uInt citer, |
---|
| 106 | casa::Float lfthres, |
---|
| 107 | casa::uInt lfavg, |
---|
| 108 | casa::Vector<casa::uInt> lfedge); |
---|
| 109 | void appendbasedata(int scanno, int cycleno, |
---|
| 110 | int beamno, int ifno, int polno, |
---|
| 111 | int freqid, casa::Double time); |
---|
| 112 | void setresult(casa::uInt irow, |
---|
| 113 | casa::Vector<casa::Float> res, |
---|
| 114 | casa::Float rms); |
---|
[2738] | 115 | casa::uInt nchan(casa::uInt ifno); |
---|
[2767] | 116 | casa::Vector<casa::Bool> getApply() {return applyCol_.getColumn();} |
---|
| 117 | bool getApply(int irow); |
---|
[2740] | 118 | casa::Vector<casa::uInt> getFunction() {return ftypeCol_.getColumn();} |
---|
[2767] | 119 | casa::Vector<STBaselineFunc::FuncName> getFunctionNames(); |
---|
| 120 | STBaselineFunc::FuncName getFunctionName(int irow); |
---|
| 121 | casa::Matrix<casa::Int> getFuncParam() {return fparCol_.getColumn();} |
---|
| 122 | std::vector<int> getFuncParam(int irow); |
---|
[2740] | 123 | casa::Matrix<casa::Float> getFuncFParam() {return ffparCol_.getColumn();} |
---|
| 124 | casa::Matrix<casa::uInt> getMaskList() {return maskCol_.getColumn();} |
---|
[2767] | 125 | std::vector<bool> getMask(int irow); |
---|
[2740] | 126 | casa::Matrix<casa::Float> getResult() {return resCol_.getColumn();} |
---|
[2738] | 127 | casa::Vector<casa::Float> getRms() {return rmsCol_.getColumn();} |
---|
[2767] | 128 | casa::Vector<casa::uInt> getNChan() {return nchanCol_.getColumn();} |
---|
| 129 | casa::uInt getNChan(int irow); |
---|
| 130 | casa::Vector<casa::Float> getClipThreshold() {return cthresCol_.getColumn();} |
---|
| 131 | casa::Vector<casa::uInt> getClipIteration() {return citerCol_.getColumn();} |
---|
| 132 | casa::Vector<casa::Float> getLineFinderThreshold() {return lfthresCol_.getColumn();} |
---|
| 133 | casa::Vector<casa::uInt> getLineFinderChanAvg() {return lfavgCol_.getColumn();} |
---|
| 134 | casa::Matrix<casa::uInt> getLineFinderEdge() {return lfedgeCol_.getColumn();} |
---|
| 135 | void setApply(int irow, bool apply); |
---|
[2738] | 136 | |
---|
| 137 | private: |
---|
| 138 | static const casa::String name_ ; |
---|
[2767] | 139 | casa::ScalarColumn<casa::Bool> applyCol_; |
---|
[2740] | 140 | casa::ScalarColumn<casa::uInt> ftypeCol_; |
---|
[2767] | 141 | casa::ArrayColumn<casa::Int> fparCol_; |
---|
[2740] | 142 | casa::ArrayColumn<casa::Float> ffparCol_; |
---|
| 143 | casa::ArrayColumn<casa::uInt> maskCol_; |
---|
| 144 | casa::ArrayColumn<casa::Float> resCol_; |
---|
[2738] | 145 | casa::ScalarColumn<casa::Float> rmsCol_; |
---|
[2767] | 146 | casa::ScalarColumn<casa::uInt> nchanCol_; |
---|
| 147 | casa::ScalarColumn<casa::Float> cthresCol_; |
---|
| 148 | casa::ScalarColumn<casa::uInt> citerCol_; |
---|
| 149 | casa::ScalarColumn<casa::Float> lfthresCol_; |
---|
| 150 | casa::ScalarColumn<casa::uInt> lfavgCol_; |
---|
| 151 | casa::ArrayColumn<casa::uInt> lfedgeCol_; |
---|
[2738] | 152 | }; |
---|
| 153 | |
---|
| 154 | } |
---|
| 155 | |
---|
| 156 | #endif |
---|