Changeset 2955
- Timestamp:
- 06/25/14 15:28:36 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STCalSkyPSAlma.cpp
r2915 r2955 53 53 uInt beamno, uInt ifno, uInt polno, 54 54 uInt freqid, Double time, Float elevation, 55 Vector<Float> any_data) 55 const Vector<Float> &any_data, 56 const Vector<uChar> &channel_flag) 56 57 { 57 58 STCalSkyTable *p = dynamic_cast<STCalSkyTable *>(&(*applytable_)); 58 59 p->appenddata(scanno, cycleno, beamno, ifno, polno, 59 freqid, time, elevation, any_data );60 freqid, time, elevation, any_data, channel_flag); 60 61 } 61 62 -
trunk/src/STCalSkyPSAlma.h
r2915 r2955 46 46 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 47 47 casa::uInt freqid, casa::Double time, casa::Float elevation, 48 casa::Vector<casa::Float> any_data); 48 const casa::Vector<casa::Float> &any_data, 49 const casa::Vector<casa::uChar> &channel_flag); 49 50 }; 50 51 -
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 -
trunk/src/STCalSkyTable.h
r2742 r2955 47 47 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 48 48 casa::uInt freqid, casa::Double time, casa::Float elevation, 49 casa::Vector<casa::Float> spectra); 49 const casa::Vector<casa::Float> &spectra, 50 const casa::Vector<casa::uChar> &flagtra); 50 51 void appenddata(casa::uInt scanno, casa::uInt cycleno, casa::uInt beamno, 51 52 casa::uInt ifno, casa::uInt polno, casa::uInt freqid, 52 53 casa::Double time, casa::Float elevation, 53 casa::Vector<casa::Float> spectra); 54 const casa::Vector<casa::Float> &spectra, 55 const casa::Vector<casa::uChar> &flagtra); 54 56 55 57 casa::Vector<casa::Float> getElevation() {return elCol_.getColumn();} … … 63 65 const casa::String caltype_; 64 66 casa::ArrayColumn<casa::Float> spectraCol_; 67 casa::ArrayColumn<casa::uChar> flagtraCol_; 65 68 casa::ScalarColumn<casa::Float> elCol_; 66 69 }; -
trunk/src/STCalTsys.cpp
r2924 r2955 75 75 uInt beamno, uInt ifno, uInt polno, 76 76 uInt freqid, Double time, Float elevation, 77 Vector<Float> any_data) 77 const Vector<Float> &any_data, 78 const Vector<uChar> &channel_flag) 78 79 { 79 80 STCalTsysTable *p = dynamic_cast<STCalTsysTable *>(&(*applytable_)); … … 81 82 LogIO os(LogOrigin("STCalTsys", "appenddata", WHERE)); 82 83 Vector<Float> averaged_data(any_data.size()); 84 Vector<uChar> averaged_flag(any_data.size(), 0); 83 85 Float averaged_value = 0.0; 84 86 size_t num_value = 0; … … 104 106 os << LogIO::DEBUGGING << "any_data = " << any_data << LogIO::POST; 105 107 p->appenddata(scanno, cycleno, beamno, ifno, polno, 106 freqid, time, elevation, averaged_data); 108 freqid, time, elevation, averaged_data, 109 averaged_flag); 107 110 } 108 111 else { 109 112 p->appenddata(scanno, cycleno, beamno, ifno, polno, 110 freqid, time, elevation, any_data); 113 freqid, time, elevation, any_data, 114 channel_flag); 111 115 } 112 116 } -
trunk/src/STCalTsys.h
r2923 r2955 49 49 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 50 50 casa::uInt freqid, casa::Double time, casa::Float elevation, 51 casa::Vector<casa::Float> any_data); 51 const casa::Vector<casa::Float> &any_data, 52 const casa::Vector<casa::uChar> &channel_flag); 52 53 53 54 vector<int> iflist_; -
trunk/src/STCalTsysTable.cpp
r2756 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> … … 42 43 : STApplyTable(name) 43 44 { 45 if (!table_.tableDesc().isColumn("FLAGTRA")) { 46 LogIO os(LogOrigin("STCalTsysTable", "STCalTsysTable", WHERE)); 47 os << "Adding FLAGTRA column to " << name << " with initial value of 0 (all data valid)." << LogIO::POST; 48 table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA")); 49 TableIterator iter(table_, "IFNO"); 50 while (!iter.pastEnd()) { 51 Table t = iter.table(); 52 ArrayColumn<Float> tsysCol(t, "TSYS"); 53 IPosition shape(2, tsysCol.shape(0)[0], t.nrow()); 54 ArrayColumn<uChar> flagtraCol(t, "FLAGTRA"); 55 Array<uChar> flagtra(shape, (uChar)0); 56 flagtraCol.putColumn(flagtra); 57 iter.next(); 58 } 59 } 60 44 61 attachOptionalColumns(); 45 62 } … … 52 69 { 53 70 table_.addColumn(ArrayColumnDesc<Float>("TSYS")); 71 table_.addColumn(ArrayColumnDesc<uChar>("FLAGTRA")); 54 72 table_.addColumn(ScalarColumnDesc<Float>("ELEVATION")); 55 73 … … 62 80 { 63 81 tsysCol_.attach(table_, "TSYS"); 82 flagtraCol_.attach(table_, "FLAGTRA"); 64 83 elCol_.attach(table_,"ELEVATION"); 65 84 … … 68 87 void STCalTsysTable::setdata(uInt irow, uInt scanno, uInt cycleno, 69 88 uInt beamno, uInt ifno, uInt polno, uInt freqid, 70 Double time, Float elevation, Vector<Float> tsys) 89 Double time, Float elevation, 90 const Vector<Float> &tsys, 91 const Vector<uChar> &flagtra) 71 92 { 72 93 if (irow >= (uInt)nrow()) { … … 82 103 elCol_.put(irow, elevation); 83 104 tsysCol_.put(irow, tsys); 105 flagtraCol_.put(irow, flagtra); 84 106 } 85 107 86 108 void STCalTsysTable::appenddata(uInt scanno, uInt cycleno, 87 109 uInt beamno, uInt ifno, uInt polno, uInt freqid, 88 Double time, Float elevation, Vector<Float> tsys) 110 Double time, Float elevation, 111 const Vector<Float> &tsys, 112 const Vector<uChar> &flagtra) 89 113 { 90 114 uInt irow = nrow(); 91 115 table_.addRow(1, True); 92 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation, tsys); 116 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, elevation, 117 tsys, flagtra); 93 118 } 94 119 -
trunk/src/STCalTsysTable.h
r2720 r2955 45 45 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 46 46 casa::uInt freqid, casa::Double time, casa::Float elevation, 47 casa::Vector<casa::Float> tsys); 47 const casa::Vector<casa::Float> &tsys, 48 const casa::Vector<casa::uChar> &flagtra); 48 49 void appenddata(casa::uInt scanno, casa::uInt cycleno, 49 50 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 50 51 casa::uInt freqid, casa::Double time, casa::Float elevation, 51 casa::Vector<casa::Float> tsys); 52 const casa::Vector<casa::Float> &tsys, 53 const casa::Vector<casa::uChar> &flagtra); 52 54 53 55 casa::Vector<casa::Float> getElevation() {return elCol_.getColumn();} … … 60 62 static const casa::String name_ ; 61 63 casa::ArrayColumn<casa::Float> tsysCol_; 64 casa::ArrayColumn<casa::uChar> flagtraCol_; 62 65 casa::ScalarColumn<casa::Float> elCol_; 63 66 }; -
trunk/src/STCalibration.cpp
r2916 r2955 79 79 uInt irow = rows[0]; 80 80 appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"), 81 freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow)); 81 freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow), 82 flagCol(irow)); 82 83 iter.next(); 83 84 continue; … … 126 127 timeCen /= (Double)count * 86400.0; // sec->day 127 128 elCen /= (Float)count; 128 appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"), 129 freqidCol(irow), timeCen, elCen, acc.getSpectrum()); 129 const Vector<Bool> &mask = acc.getMask(); 130 Vector<uChar> flag(mask.shape(), (uChar)0); 131 const uChar userFlag = 1 << 7; 132 for (uInt k = 0; k < flag.nelements(); ++k) { 133 if (mask[k] == True) 134 flag[k] = userFlag; 135 } 136 appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), 137 current.asuInt("POLNO"), 138 freqidCol(irow), timeCen, elCen, 139 acc.getSpectrum(), flag); 130 140 } 131 141 acc.reset() ; -
trunk/src/STCalibration.h
r2915 r2955 53 53 casa::uInt beamno, casa::uInt ifno, casa::uInt polno, 54 54 casa::uInt freqid, casa::Double time, casa::Float elevation, 55 casa::Vector<casa::Float> any_data) = 0; 55 const casa::Vector<casa::Float> &any_data, 56 const casa::Vector<casa::uChar> &channel_flag) = 0; 56 57 57 58 STSelector sel_;
Note:
See TracChangeset
for help on using the changeset viewer.