source: trunk/src/STCalTsysTable.cpp@ 2715

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

New Development: Yes

JIRA Issue: Yes CAS-4770, 4771, 4772

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 calibration classes for sky calibration (STCalSkyPSAlma)
and Tsys calibration (STCalTsys), which are derived from base class
(STCalibration).

The caltable classes, STCalSky and STCalTsys, are renamed as STCalSkyTable
and STCalTsysTable, respectively.


File size: 2.1 KB
Line 
1//
2// C++ Implementation: STCalTsysTable
3//
4// Description:
5//
6//
7// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012
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 "STCalTsysTable.h"
24
25
26using namespace casa;
27
28namespace asap {
29
30const String STCalTsysTable::name_ = "APPLY_TSYS";
31
32STCalTsysTable::STCalTsysTable(const Scantable& parent)
33 : STApplyTable(parent, name_)
34{
35 setup();
36}
37
38STCalTsysTable::~STCalTsysTable()
39{
40}
41
42void STCalTsysTable::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 STCalTsysTable::attachOptionalColumns()
53{
54 tsysCol_.attach(table_, "TSYS");
55 elCol_.attach(table_,"ELEVATION");
56
57}
58
59void STCalTsysTable::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("STCalTsysTable","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 STCalTsysTable::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.