Changeset 2767 for trunk/src/STBaselineTable.cpp
- Timestamp:
- 02/08/13 22:23:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STBaselineTable.cpp
r2740 r2767 51 51 void STBaselineTable::setup() 52 52 { 53 table_.addColumn(ScalarColumnDesc< uInt>("NCHAN"));53 table_.addColumn(ScalarColumnDesc<Bool>("APPLY")); 54 54 table_.addColumn(ScalarColumnDesc<uInt>("FUNC_TYPE")); 55 table_.addColumn(ArrayColumnDesc< uInt>("FUNC_PARAM"));55 table_.addColumn(ArrayColumnDesc<Int>("FUNC_PARAM")); 56 56 table_.addColumn(ArrayColumnDesc<Float>("FUNC_FPARAM")); 57 table_.addColumn(ScalarColumnDesc<uInt>("CLIP_ITERATION"));58 table_.addColumn(ScalarColumnDesc<Float>("CLIP_THRESHOLD"));59 57 table_.addColumn(ArrayColumnDesc<uInt>("MASKLIST")); 60 58 table_.addColumn(ArrayColumnDesc<Float>("RESULT")); 61 59 table_.addColumn(ScalarColumnDesc<Float>("RMS")); 60 table_.addColumn(ScalarColumnDesc<uInt>("NCHAN")); 61 table_.addColumn(ScalarColumnDesc<Float>("CLIP_THRESHOLD")); 62 table_.addColumn(ScalarColumnDesc<uInt>("CLIP_ITERATION")); 63 table_.addColumn(ScalarColumnDesc<Float>("LF_THRESHOLD")); 64 table_.addColumn(ScalarColumnDesc<uInt>("LF_AVERAGE")); 65 table_.addColumn(ArrayColumnDesc<uInt>("LF_EDGE")); 62 66 63 67 table_.rwKeywordSet().define("ApplyType", "BASELINE"); … … 68 72 void STBaselineTable::attachOptionalColumns() 69 73 { 70 nchanCol_.attach(table_, "NCHAN");74 applyCol_.attach(table_, "APPLY"); 71 75 ftypeCol_.attach(table_, "FUNC_TYPE"); 72 76 fparCol_.attach(table_, "FUNC_PARAM"); 73 77 ffparCol_.attach(table_, "FUNC_FPARAM"); 74 citerCol_.attach(table_, "CLIP_ITERATION");75 cthresCol_.attach(table_, "CLIP_THRESHOLD");76 78 maskCol_.attach(table_, "MASKLIST"); 77 79 resCol_.attach(table_, "RESULT"); 78 80 rmsCol_.attach(table_, "RMS"); 81 nchanCol_.attach(table_, "NCHAN"); 82 cthresCol_.attach(table_, "CLIP_THRESHOLD"); 83 citerCol_.attach(table_, "CLIP_ITERATION"); 84 lfthresCol_.attach(table_, "LF_THRESHOLD"); 85 lfavgCol_.attach(table_, "LF_AVERAGE"); 86 lfedgeCol_.attach(table_, "LF_EDGE"); 79 87 } 80 88 … … 90 98 uInt beamno, uInt ifno, uInt polno, 91 99 uInt freqid, Double time, 92 uInt nchan,100 Bool apply, 93 101 STBaselineFunc::FuncName ftype, 94 Vector< uInt> fpar,102 Vector<Int> fpar, 95 103 Vector<Float> ffpar, 96 uInt citer,97 Float cthres,98 104 Vector<uInt> mask, 99 105 Vector<Float> res, 100 Float rms) 106 Float rms, 107 uInt nchan, 108 Float cthres, 109 uInt citer, 110 Float lfthres, 111 uInt lfavg, 112 Vector<uInt> lfedge) 101 113 { 102 114 if (irow >= (uInt)nrow()) { … … 110 122 111 123 setbasedata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time); 112 nchanCol_.put(irow, nchan);124 applyCol_.put(irow, apply); 113 125 ftypeCol_.put(irow, uInt(ftype)); 114 126 fparCol_.put(irow, fpar); 115 127 ffparCol_.put(irow, ffpar); 116 citerCol_.put(irow, citer);117 cthresCol_.put(irow, cthres);118 128 maskCol_.put(irow, mask); 119 129 resCol_.put(irow, res); 120 130 rmsCol_.put(irow, rms); 131 nchanCol_.put(irow, nchan); 132 cthresCol_.put(irow, cthres); 133 citerCol_.put(irow, citer); 134 lfthresCol_.put(irow, lfthres); 135 lfavgCol_.put(irow, lfavg); 136 lfedgeCol_.put(irow, lfedge); 121 137 } 122 138 … … 124 140 uInt beamno, uInt ifno, uInt polno, 125 141 uInt freqid, Double time, 126 uInt nchan,142 Bool apply, 127 143 STBaselineFunc::FuncName ftype, 128 Vector< uInt> fpar,144 Vector<Int> fpar, 129 145 Vector<Float> ffpar, 130 uInt citer,131 Float cthres,132 146 Vector<uInt> mask, 133 147 Vector<Float> res, 134 Float rms) 148 Float rms, 149 uInt nchan, 150 Float cthres, 151 uInt citer, 152 Float lfthres, 153 uInt lfavg, 154 Vector<uInt> lfedge) 135 155 { 136 156 uInt irow = nrow(); 137 157 table_.addRow(1, True); 138 158 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, 139 nchan, ftype, fpar, ffpar, citer, cthres, mask, res, rms); 140 } 141 142 Vector<STBaselineFunc::FuncName> STBaselineTable::getFunctionAsString() 159 apply, ftype, fpar, ffpar, mask, res, rms, 160 nchan, cthres, citer, lfthres, lfavg, lfedge); 161 } 162 163 void STBaselineTable::appendbasedata(int scanno, int cycleno, 164 int beamno, int ifno, int polno, 165 int freqid, Double time) 166 { 167 uInt irow = nrow(); 168 table_.addRow(1, True); 169 setbasedata(irow, uInt(scanno), uInt(cycleno), uInt(beamno), uInt(ifno), uInt(polno), uInt(freqid), time); 170 } 171 172 void STBaselineTable::setresult(casa::uInt irow, 173 casa::Vector<casa::Float> res, 174 casa::Float rms) 175 { 176 resCol_.put(irow, res); 177 rmsCol_.put(irow, rms); 178 } 179 180 bool STBaselineTable::getApply(int irow) 181 { 182 return (bool)applyCol_.get(irow); 183 } 184 185 void STBaselineTable::setApply(int irow, bool apply) 186 { 187 applyCol_.put(uInt(irow), Bool(apply)); 188 } 189 190 Vector<STBaselineFunc::FuncName> STBaselineTable::getFunctionNames() 143 191 { 144 192 Vector<uInt> rawBlfuncColumn = ftypeCol_.getColumn(); … … 149 197 } 150 198 return blfuncColumn; 199 } 200 201 STBaselineFunc::FuncName STBaselineTable::getFunctionName(int irow) 202 { 203 return STBaselineFunc::FuncName(ftypeCol_.get(irow)); 204 } 205 206 std::vector<int> STBaselineTable::getFuncParam(int irow) 207 { 208 Vector<Int> uiparam = fparCol_.get(irow); 209 std::vector<int> res(uiparam.size()); 210 for (uInt i = 0; i < res.size(); ++i) { 211 res[i] = (int)uiparam[i]; 212 } 213 return res; 214 } 215 216 std::vector<bool> STBaselineTable::getMask(int irow) 217 { 218 uInt nchan = getNChan(irow); 219 Vector<uInt> masklist = maskCol_.get(irow); 220 std::vector<int> masklist1(masklist.size()); 221 for (uInt i = 0; i < masklist1.size(); ++i) { 222 masklist1[i] = (int)masklist[i]; 223 } 224 return Scantable::getMaskFromMaskList(nchan, masklist1); 225 } 226 227 uInt STBaselineTable::getNChan(int irow) 228 { 229 return nchanCol_.get(irow); 151 230 } 152 231
Note: See TracChangeset
for help on using the changeset viewer.