source: trunk/src/STCalSkyTable.cpp@ 2713

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