source: trunk/src/STCalSky.cpp@ 2697

Last change on this file since 2697 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.1 KB
Line 
1//
2// C++ Implementation: STCalSky
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 <casa/Logging/LogIO.h>
14#include <tables/Tables/TableDesc.h>
15#include <tables/Tables/SetupNewTab.h>
16#include <tables/Tables/ArrColDesc.h>
17#include <tables/Tables/ScaColDesc.h>
18#include <tables/Tables/TableRecord.h>
19#include <measures/TableMeasures/TableMeasDesc.h>
20#include <measures/TableMeasures/TableMeasRefDesc.h>
21#include <measures/TableMeasures/TableMeasValueDesc.h>
22
23#include "Scantable.h"
24#include "STCalSky.h"
25
26
27using namespace casa;
28
29namespace asap {
30
31const String STCalSky::name_ = "APPLY_SKY";
32
33STCalSky::STCalSky(const Scantable& parent)
34 : STApplyTable(parent, name_)
35{
36 setup();
37}
38
39STCalSky::~STCalSky()
40{
41}
42
43void STCalSky::setup()
44{
45 table_.addColumn(ArrayColumnDesc<Float>("SPECTRA"));
46 table_.addColumn(ScalarColumnDesc<Float>("ELEVATION"));
47
48 table_.rwKeywordSet().define("ApplyType", "SKY");
49
50 attachOptionalColumns();
51}
52
53void STCalSky::attachOptionalColumns()
54{
55 spectraCol_.attach(table_, "SPECTRA");
56 elCol_.attach(table_,"ELEVATION");
57
58}
59
60void STCalSky::setdata(uInt irow, uInt scanno, uInt cycleno,
61 uInt beamno, uInt ifno, uInt polno,
62 Double time, Float elevation, Vector<Float> spectra)
63{
64 if (irow >= (uInt)nrow()) {
65 throw AipsError("row index out of range");
66 }
67
68 if (!sel_.empty()) {
69 os_.origin(LogOrigin("STCalSky","setdata",WHERE));
70 os_ << LogIO::WARN << "Data selection is effective. Specified row index may be wrong." << LogIO::POST;
71 }
72
73 setbasedata(irow, scanno, cycleno, beamno, ifno, polno, time);
74 elCol_.put(irow, elevation);
75 spectraCol_.put(irow, spectra);
76}
77
78void STCalSky::appenddata(uInt scanno, uInt cycleno,
79 uInt beamno, uInt ifno, uInt polno,
80 Double time, Float elevation, Vector<Float> spectra)
81{
82 uInt irow = nrow();
83 table_.addRow(1, True);
84 setdata(irow, scanno, cycleno, beamno, ifno, polno, time, elevation, spectra);
85}
86}
Note: See TracBrowser for help on using the repository browser.