[2696] | 1 | // |
---|
| 2 | // C++ Implementation: STCalTsys |
---|
| 3 | // |
---|
| 4 | // Description: |
---|
| 5 | // |
---|
| 6 | // |
---|
| 7 | // Author: Takeshi Nakazato |
---|
| 8 | // |
---|
| 9 | // Copyright: See COPYING file that comes with this distribution |
---|
| 10 | // |
---|
| 11 | // |
---|
| 12 | #include <casa/Exceptions/Error.h> |
---|
| 13 | #include <tables/Tables/TableDesc.h> |
---|
| 14 | #include <tables/Tables/SetupNewTab.h> |
---|
| 15 | #include <tables/Tables/ArrColDesc.h> |
---|
| 16 | #include <tables/Tables/ScaColDesc.h> |
---|
| 17 | #include <tables/Tables/TableRecord.h> |
---|
| 18 | #include <measures/TableMeasures/TableMeasDesc.h> |
---|
| 19 | #include <measures/TableMeasures/TableMeasRefDesc.h> |
---|
| 20 | #include <measures/TableMeasures/TableMeasValueDesc.h> |
---|
| 21 | |
---|
| 22 | #include "Scantable.h" |
---|
| 23 | #include "STCalTsys.h" |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | using namespace casa; |
---|
| 27 | |
---|
| 28 | namespace asap { |
---|
| 29 | |
---|
| 30 | const String STCalTsys::name_ = "APPLY_TSYS"; |
---|
| 31 | |
---|
| 32 | STCalTsys::STCalTsys(const Scantable& parent) |
---|
| 33 | : STApplyTable(parent, name_) |
---|
| 34 | { |
---|
| 35 | setup(); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | STCalTsys::~STCalTsys() |
---|
| 39 | { |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | void STCalTsys::setup() |
---|
| 43 | { |
---|
| 44 | table_.addColumn(ArrayColumnDesc<Float>("TSYS")); |
---|
| 45 | table_.addColumn(ScalarColumnDesc<Float>("ELEVATION")); |
---|
| 46 | |
---|
| 47 | table_.rwKeywordSet().define("ApplyType", "TSYS"); |
---|
| 48 | |
---|
| 49 | attachOptionalColumns(); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | void STCalTsys::attachOptionalColumns() |
---|
| 53 | { |
---|
| 54 | tsysCol_.attach(table_, "TSYS"); |
---|
| 55 | elCol_.attach(table_,"ELEVATION"); |
---|
| 56 | |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | void STCalTsys::setdata(uInt irow, uInt scanno, uInt cycleno, |
---|
| 60 | uInt beamno, uInt ifno, uInt polno, |
---|
| 61 | Double time, Float elevation, Vector<Float> tsys) |
---|
| 62 | { |
---|
| 63 | if (irow >= (uInt)nrow()) { |
---|
| 64 | throw AipsError("row index out of range"); |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | if (!sel_.empty()) { |
---|
| 68 | os_.origin(LogOrigin("STCalTsys","setdata",WHERE)); |
---|
| 69 | os_ << LogIO::WARN << "Data selection is effective. Specified row index may be wrong." << LogIO::POST; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | setbasedata(irow, scanno, cycleno, beamno, ifno, polno, time); |
---|
| 73 | elCol_.put(irow, elevation); |
---|
| 74 | tsysCol_.put(irow, tsys); |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | void STCalTsys::appenddata(uInt scanno, uInt cycleno, |
---|
| 78 | uInt beamno, uInt ifno, uInt polno, |
---|
| 79 | Double time, Float elevation, Vector<Float> tsys) |
---|
| 80 | { |
---|
| 81 | uInt irow = nrow(); |
---|
| 82 | table_.addRow(1, True); |
---|
| 83 | setdata(irow, scanno, cycleno, beamno, ifno, polno, time, elevation, tsys); |
---|
| 84 | } |
---|
| 85 | } |
---|