- Timestamp:
- 07/16/13 12:36:39 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STCalSkyOtfAlma.cpp
r2786 r2823 28 28 : STCalSkyPSAlma(s), 29 29 israster_(israster) 30 {} 30 { 31 rowNumbers_ = scantable_->table().rowNumbers(); 32 } 31 33 32 34 void STCalSkyOtfAlma::setupSelector(const STSelector &sel) … … 46 48 vector<int> vectorRows(rows.nelements()); 47 49 for (size_t i = 0; i < vectorRows.size(); ++i) 48 vectorRows[i] = row s[i];49 50 vectorRows[i] = rowNumbers_[rows[i]]; 51 50 52 // Set list of row indices to selector 51 53 sel_.setRows(vectorRows); 52 54 } 53 55 54 // void STCalSkyOtfAlma::fillCalTable()55 // {56 // RowAccumulator acc(W_TINT);57 58 // vector<string> cols(3);59 // cols[0] = "IFNO";60 // cols[1] = "POLNO";61 // cols[2] = "BEAMNO";62 // STIdxIterAcc iter(scantable_, cols);63 64 // ROScalarColumn<Double> *tcol = new ROScalarColumn<Double>(scantable_->table(), "TIME");65 // Vector<Double> timeSec = tcol->getColumn() * 86400.0;66 // tcol->attach(scantable_->table(), "INTERVAL");67 // Vector<Double> intervalSec = tcol->getColumn();68 // delete tcol;69 // ROScalarColumn<Float> *ecol = new ROScalarColumn<Float>(scantable_->table(), "ELEVATION");70 // Vector<Float> elevation = ecol->getColumn();71 // delete ecol;72 73 // ROArrayColumn<Float> specCol(scantable_->table(), "SPECTRA");74 // ROArrayColumn<uChar> flagCol(scantable_->table(), "FLAGTRA");75 // ROScalarColumn<uInt> freqidCol(scantable_->table(), "FREQ_ID");76 77 // // dummy Tsys: the following process doesn't need Tsys but RowAccumulator78 // // requires to set it with spectral data79 // Vector<Float> tsys(1, 1.0);80 81 // Double timeCen = 0.0;82 // Float elCen = 0.0;83 // uInt count = 0;84 85 // while(!iter.pastEnd()) {86 // Vector<uInt> rows = iter.getRows(SHARE);87 // Vector<uInt> current = iter.current();88 // uInt len = rows.nelements();89 // if (len == 0) {90 // iter.next();91 // continue;92 // }93 // else if (len == 1) {94 // STCalSkyTable *p = dynamic_cast<STCalSkyTable *>(&(*applytable_));95 // uInt irow = rows[0];96 // p->appenddata(0, 0, current[2], current[0], current[1],97 // freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow));98 // iter.next();99 // continue;100 // }101 102 // uInt nchan = scantable_->nchan(scantable_->getIF(rows[0]));103 // Vector<uChar> flag(nchan);104 // Vector<Bool> bflag(nchan);105 // Vector<Float> spec(nchan);106 107 // Vector<Double> timeSep(len);108 // for (uInt i = 0; i < len-1; i++) {109 // timeSep[i] = timeSec[rows[i+1]] - timeSec[rows[i]] ;110 // }111 // Double tMedian = median(timeSep(IPosition(1,0), IPosition(1,len-2)));112 // timeSep[len-1] = tMedian * 10000.0 ; // any large value113 114 // uInt irow ;115 // uInt jrow ;116 // for (uInt i = 0; i < len; i++) {117 // irow = rows[i];118 // jrow = (i < len-1) ? rows[i+1] : rows[i];119 // // accumulate data120 // flagCol.get(irow, flag);121 // convertArray(bflag, flag);122 // specCol.get(irow, spec);123 // if ( !allEQ(bflag,True) )124 // acc.add( spec, !bflag, tsys, intervalSec[irow], timeSec[irow] ) ;125 // timeCen += timeSec[irow];126 // elCen += elevation[irow];127 // count++;128 129 // // check time gap130 // double gap = 2.0 * timeSep[i] / (intervalSec[jrow] + intervalSec[irow]);131 // if ( gap > 1.1 ) {132 // if ( acc.state() ) {133 // acc.replaceNaN() ;134 // // const Vector<Bool> &msk = acc.getMask();135 // // convertArray(flag, !msk);136 // // for (uInt k = 0; k < nchan; ++k) {137 // // uChar userFlag = 1 << 7;138 // // if (msk[k]==True) userFlag = 0 << 7;139 // // flag(k) = userFlag;140 // // }141 // timeCen /= (Double)count * 86400.0; // sec->day142 // elCen /= (Float)count;143 // STCalSkyTable *p = dynamic_cast<STCalSkyTable *>(&(*applytable_));144 // p->appenddata(0, 0, current[2], current[0], current[1],145 // freqidCol(irow), timeCen, elCen, acc.getSpectrum());146 // }147 // acc.reset() ;148 // timeCen = 0.0;149 // elCen = 0.0;150 // count = 0;151 // }152 // }153 154 // iter.next() ;155 // }156 // }157 158 56 } -
trunk/src/STCalSkyOtfAlma.h
r2786 r2823 46 46 private: 47 47 bool israster_; 48 49 casa::Vector<casa::uInt> rowNumbers_; 48 50 }; 49 51
Note:
See TracChangeset
for help on using the changeset viewer.