1 | // |
---|
2 | // C++ Interface: STApplyTable |
---|
3 | // |
---|
4 | // Description: |
---|
5 | // |
---|
6 | // Base class for application tables. |
---|
7 | // |
---|
8 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012 |
---|
9 | // |
---|
10 | // Copyright: See COPYING file that comes with this distribution |
---|
11 | // |
---|
12 | // |
---|
13 | #ifndef ASAP_APPLY_TABLE_H |
---|
14 | #define ASAP_APPLY_TABLE_H |
---|
15 | |
---|
16 | #include <casa/Arrays/Vector.h> |
---|
17 | #include <casa/Logging/LogIO.h> |
---|
18 | #include <tables/Tables/Table.h> |
---|
19 | #include <tables/Tables/ScalarColumn.h> |
---|
20 | #include <measures/TableMeasures/ScalarMeasColumn.h> |
---|
21 | |
---|
22 | #include "Scantable.h" |
---|
23 | #include "STSelector.h" |
---|
24 | |
---|
25 | namespace asap { |
---|
26 | |
---|
27 | /** |
---|
28 | Abstract base class for all application tables. |
---|
29 | |
---|
30 | @author Takeshi Nakazato |
---|
31 | @date $Date:$ |
---|
32 | @version $Revision:$ |
---|
33 | */ |
---|
34 | class STApplyTable { |
---|
35 | public: |
---|
36 | STApplyTable() {;} |
---|
37 | STApplyTable(const Scantable& parent, const casa::String& name); |
---|
38 | |
---|
39 | virtual ~STApplyTable(); |
---|
40 | |
---|
41 | /** |
---|
42 | * Add extra columns. To be implemented in derived class |
---|
43 | */ |
---|
44 | virtual void setup() = 0; |
---|
45 | |
---|
46 | /*** |
---|
47 | * Name of the table |
---|
48 | ***/ |
---|
49 | virtual const casa::String& name() const = 0; |
---|
50 | |
---|
51 | const casa::Table& table() const { return table_; } |
---|
52 | casa::Table table() { return table_; } |
---|
53 | void attach(); |
---|
54 | void attachBaseColumns(); |
---|
55 | virtual void attachOptionalColumns() = 0; |
---|
56 | |
---|
57 | casa::Int nrow() {return table_.nrow();} |
---|
58 | |
---|
59 | casa::Vector<casa::uInt> getScan() {return scanCol_.getColumn();} |
---|
60 | casa::Vector<casa::uInt> getCycle() {return cycleCol_.getColumn();} |
---|
61 | casa::Vector<casa::uInt> getBeam() {return beamCol_.getColumn();} |
---|
62 | casa::Vector<casa::uInt> getIF() {return ifCol_.getColumn();} |
---|
63 | casa::Vector<casa::uInt> getPol() {return polCol_.getColumn();} |
---|
64 | casa::Vector<casa::Double> getTime() {return timeCol_.getColumn();} |
---|
65 | |
---|
66 | void setSelection(STSelector &sel); |
---|
67 | void unsetSelection(); |
---|
68 | |
---|
69 | void save(const casa::String &name); |
---|
70 | |
---|
71 | protected: |
---|
72 | void setbasedata(casa::uInt irow, casa::uInt scanno, casa::uInt cycleno, |
---|
73 | casa::uInt beamno, casa::uInt ifno, casa::uInt polno, |
---|
74 | casa::Double time); |
---|
75 | |
---|
76 | casa::Table table_, originaltable_; |
---|
77 | casa::ScalarColumn<casa::uInt> scanCol_, cycleCol_, beamCol_, ifCol_, polCol_; |
---|
78 | casa::ScalarColumn<casa::Double> timeCol_; |
---|
79 | casa::MEpoch::ScalarColumn timeMeasCol_; |
---|
80 | STSelector sel_; |
---|
81 | casa::LogIO os_; |
---|
82 | |
---|
83 | private: |
---|
84 | }; |
---|
85 | |
---|
86 | } |
---|
87 | |
---|
88 | #endif |
---|