Changeset 2955 for trunk/src/STCalSkyTable.cpp
- Timestamp:
- 06/25/14 15:28:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STCalSkyTable.cpp
r2727 r2955 19 19 #include <tables/Tables/ScaColDesc.h> 20 20 #include <tables/Tables/TableRecord.h> 21 #include <tables/Tables/TableIter.h> 21 22 #include <measures/TableMeasures/TableMeasDesc.h> 22 23 #include <measures/TableMeasures/TableMeasRefDesc.h> … … 43 44 : STApplyTable(name) 44 45 { 46 if (!table_.tableDesc().isColumn("FLAGTRA")) { 47 LogIO os(LogOrigin("STCalSkyTable", "STCalSkyTable", WHERE)); 48 os << "Adding FLAGTRA column to " << name << " with initial value of 0 (all data valid)." << LogIO::POST; 49 table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA")); 50 TableIterator iter(table_, "IFNO"); 51 while (!iter.pastEnd()) { 52 Table t = iter.table(); 53 ArrayColumn<Float> spectraCol(t, "SPECTRA"); 54 IPosition shape(2, spectraCol.shape(0)[0], t.nrow()); 55 ArrayColumn<uChar> flagtraCol(t, "FLAGTRA"); 56 Array<uChar> flagtra(shape, (uChar)0); 57 flagtraCol.putColumn(flagtra); 58 iter.next(); 59 } 60 } 61 45 62 attachOptionalColumns(); 46 63 } … … 53 70 { 54 71 table_.addColumn(ArrayColumnDesc<Float>("SPECTRA")); 72 table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA")); 55 73 table_.addColumn(ScalarColumnDesc<Float>("ELEVATION")); 56 74 … … 66 84 { 67 85 spectraCol_.attach(table_, "SPECTRA"); 86 flagtraCol_.attach(table_, "FLAGTRA"); 68 87 elCol_.attach(table_,"ELEVATION"); 69 70 88 } 71 89 72 90 void STCalSkyTable::setdata(uInt irow, uInt scanno, uInt cycleno, 73 91 uInt beamno, uInt ifno, uInt polno, uInt freqid, 74 Double time, Float elevation, Vector<Float> spectra) 92 Double time, Float elevation, 93 const Vector<Float> &spectra, 94 const Vector<uChar> &flagtra) 75 95 { 76 96 if (irow >= (uInt)nrow()) { … … 86 106 elCol_.put(irow, elevation); 87 107 spectraCol_.put(irow, spectra); 108 flagtraCol_.put(irow, flagtra); 88 109 } 89 110 90 111 void STCalSkyTable::appenddata(uInt scanno, uInt cycleno, 91 112 uInt beamno, uInt ifno, uInt polno, uInt freqid, 92 Double time, Float elevation, Vector<Float> spectra) 113 Double time, Float elevation, 114 const Vector<Float> &spectra, 115 const Vector<uChar> &flagtra) 93 116 { 94 117 uInt irow = nrow(); 95 118 table_.addRow(1, True); 96 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation, spectra); 119 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation, 120 spectra, flagtra); 97 121 } 98 122
Note: See TracChangeset
for help on using the changeset viewer.