source: trunk/src/STBaselineParamTable.cpp@ 2730

Last change on this file since 2730 was 2728, checked in by WataruKawasaki, 12 years ago

New Development: Yes

JIRA Issue: Yes CAS-4794

Ready for Test: No

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd

Description: STBaselineParamTable extended from STApplyTable.


File size: 3.1 KB
Line 
1//
2// C++ Implementation: STBaselineParamTable
3//
4// Description:
5//
6//
7// Author: Wataru Kawasaki <wataru.kawasaki@nao.ac.jp> (C) 2013
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#include <assert.h>
13
14#include <casa/Exceptions/Error.h>
15#include <tables/Tables/TableDesc.h>
16#include <tables/Tables/SetupNewTab.h>
17#include <tables/Tables/ArrColDesc.h>
18#include <tables/Tables/ScaColDesc.h>
19#include <tables/Tables/TableRecord.h>
20#include <measures/TableMeasures/TableMeasDesc.h>
21#include <measures/TableMeasures/TableMeasRefDesc.h>
22#include <measures/TableMeasures/TableMeasValueDesc.h>
23
24#include "Scantable.h"
25#include "STBaselineParamTable.h"
26
27
28using namespace casa;
29
30namespace asap {
31
32const String STBaselineParamTable::name_ = "APPLY_BASELINE";
33
34STBaselineParamTable::STBaselineParamTable(const Scantable& parent)
35 : STApplyTable(parent, name_)
36{
37 setup();
38}
39
40STBaselineParamTable::STBaselineParamTable(const String &name)
41 : STApplyTable(name)
42{
43 attachOptionalColumns();
44}
45
46STBaselineParamTable::~STBaselineParamTable()
47{
48}
49
50void STBaselineParamTable::setup()
51{
52 table_.addColumn(ScalarColumnDesc<uInt>("BLFUNC"));
53 table_.addColumn(ScalarColumnDesc<uInt>("ORDER"));
54 table_.addColumn(ArrayColumnDesc<Float>("BOUNDARY"));
55 table_.addColumn(ArrayColumnDesc<Float>("PARAMETER"));
56
57 table_.rwKeywordSet().define("ApplyType", "BASELINE");
58
59 attachOptionalColumns();
60}
61
62void STBaselineParamTable::attachOptionalColumns()
63{
64 blfuncCol_.attach(table_, "BLFUNC");
65 orderCol_.attach(table_, "ORDER");
66 boundaryCol_.attach(table_, "BOUNDARY");
67 paramCol_.attach(table_, "PARAMETER");
68
69}
70
71void STBaselineParamTable::setdata(uInt irow, uInt scanno, uInt cycleno,
72 uInt beamno, uInt ifno, uInt polno, uInt freqid,
73 Double time, uInt blfunc, uInt order,
74 Vector<Float> boundary, Vector<Float> param)
75{
76 if (irow >= (uInt)nrow()) {
77 throw AipsError("row index out of range");
78 }
79
80 if (!sel_.empty()) {
81 os_.origin(LogOrigin("STBaselineParamTable","setdata",WHERE));
82 os_ << LogIO::WARN << "Data selection is effective. Specified row index may be wrong." << LogIO::POST;
83 }
84
85 setbasedata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time);
86 blfuncCol_.put(irow, blfunc);
87 orderCol_.put(irow, order);
88 boundaryCol_.put(irow, boundary);
89 paramCol_.put(irow, param);
90}
91
92void STBaselineParamTable::appenddata(uInt scanno, uInt cycleno,
93 uInt beamno, uInt ifno, uInt polno, uInt freqid,
94 Double time, uInt blfunc, uInt order,
95 Vector<Float> boundary, Vector<Float> param)
96{
97 uInt irow = nrow();
98 table_.addRow(1, True);
99 setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, blfunc, order, boundary, param);
100}
101
102 /*
103Vector<STBaselineEnum::BaselineType> getBlfunc()
104{
105 Vector<uInt> rawBlfuncColumn = blfuncCol_.getColumn();
106 Vector<STBaselineEnum::BaselineType> blfuncColumn;
107 for (uInt i = 0; i < rawBlfuncColumn.size(); ++i) {
108 blfuncColumn.append(STBaselineEnum::BaselineType(rawBlfuncColumn.get(i)));
109 }
110 return blfuncColumn;
111}
112 */
113
114}
Note: See TracBrowser for help on using the repository browser.