source: trunk/src/STCalTsys.cpp@ 2702

Last change on this file since 2702 was 2696, checked in by Takeshi Nakazato, 12 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

First version of single dish apply table.

STApplyTable: base class
STCalTsys: apply table for Tsys calibration
STCalSky: apply table for sky calibration


File size: 2.0 KB
Line 
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
26using namespace casa;
27
28namespace asap {
29
30const String STCalTsys::name_ = "APPLY_TSYS";
31
32STCalTsys::STCalTsys(const Scantable& parent)
33 : STApplyTable(parent, name_)
34{
35 setup();
36}
37
38STCalTsys::~STCalTsys()
39{
40}
41
42void 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
52void STCalTsys::attachOptionalColumns()
53{
54 tsysCol_.attach(table_, "TSYS");
55 elCol_.attach(table_,"ELEVATION");
56
57}
58
59void 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
77void 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}
Note: See TracBrowser for help on using the repository browser.