source: trunk/src/STApplyCal.h@ 2737

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

New Development: No

JIRA Issue: Yes CAS-4770

Ready for Test: Yes

Interface Changes: Yes/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...

  • clean up log messages
  • interface changes to be easier to call from Python layer
  • added reset and completeReset method
File size: 3.3 KB
Line 
1//
2// C++ Interface: STApplyCal
3//
4// Description:
5//
6// Apply any apply tables to target data.
7//
8// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp> (C) 2012
9//
10// Copyright: See COPYING file that comes with this distribution
11//
12//
13#ifndef ASAP_APPLY_CAL_H
14#define ASAP_APPLY_CAL_H
15
16#include <map>
17#include <vector>
18
19#include <casa/Containers/Block.h>
20#include <casa/Arrays/Vector.h>
21#include <casa/Logging/LogIO.h>
22#include <tables/Tables/Table.h>
23#include <tables/Tables/ScalarColumn.h>
24#include <measures/TableMeasures/ScalarMeasColumn.h>
25
26#include "Scantable.h"
27#include "STSelector.h"
28#include "STApplyTable.h"
29#include "STCalEnum.h"
30#include "Calibrator.h"
31#include "Interpolator1D.h"
32#include "STCalSkyTable.h"
33#include "STCalTsysTable.h"
34
35namespace asap {
36
37/**
38Apply any apply tables to target data
39
40@author Takeshi Nakazato
41@date $Date:$
42@version $Revision:$
43*/
44class STApplyCal {
45public:
46 STApplyCal();
47 STApplyCal(casa::CountedPtr<Scantable> target);
48
49 ~STApplyCal();
50
51 // set data
52 void setTarget(casa::CountedPtr<Scantable> target);
53 void setTarget(const casa::String &name);
54
55 // push new caltable
56 void push(STCalSkyTable *table);
57 void push(STCalTsysTable *table);
58
59 // set interpolation method
60 //void setInterpolation(STCalEnum::InterpolationAxis axis, STCalEnum::InterpolationType itype, casa::Int order=-1);
61 void setTimeInterpolation(STCalEnum::InterpolationType itype, casa::Int order=-1);
62 void setFrequencyInterpolation(STCalEnum::InterpolationType itype, casa::Int order=-1);
63
64 // set IF (spw) mapping for Tsys transfer
65 void setTsysTransfer(casa::uInt from, casa::Vector<casa::uInt> to);
66
67 // apply tables
68 void apply(casa::Bool insitu=true);
69
70 // split target data and store it to disk
71 void save(const casa::String &name);
72
73 // reset all settings except target scantable
74 void reset();
75
76 // reset all settings
77 void completeReset();
78
79private:
80 // initialization
81 void init();
82
83 // setup interpolator
84 void initInterpolator();
85
86 // single loop element in apply()
87 void doapply(casa::uInt beamno, casa::uInt ifno, casa::uInt polno,
88 casa::Vector<casa::uInt> &rows,
89 casa::Vector<casa::uInt> &skylist);
90
91 // get frequency information from FREQUENCIES subtable
92 casa::Vector<casa::Double> getBaseFrequency(casa::uInt whichrow);
93
94 // time sort
95 casa::Vector<casa::uInt> timeSort(casa::Vector<casa::Double> &t);
96
97 // search spwmap_ to get IFNO for Tsys
98 casa::uInt getIFForTsys(casa::uInt to);
99
100 // target data
101 casa::CountedPtr<Scantable> target_;
102
103 // working data
104 casa::CountedPtr<Scantable> work_;
105
106 // calibrator
107 casa::CountedPtr<Calibrator> calibrator_;
108
109 // interpolation method
110 STCalEnum::InterpolationType iTime_;
111 STCalEnum::InterpolationType iFreq_;
112 casa::Int order_;
113 casa::CountedPtr<Interpolator1D<casa::Double, casa::Float> > interpolatorT_;
114 casa::CountedPtr<Interpolator1D<casa::Double, casa::Float> > interpolatorF_;
115 casa::CountedPtr<Interpolator1D<casa::Double, casa::Float> > interpolatorS_;
116
117 // IF (spw) mapping for Tsys transfer
118 map<casa::uInt, casa::Vector<casa::uInt> > spwmap_;
119
120 // list of apply tables
121 std::vector<STCalSkyTable*> skytable_;
122 std::vector<STCalTsysTable*> tsystable_;
123
124 // calibration type
125 STCalEnum::CalType caltype_;
126 casa::Bool doTsys_;
127
128 // selector
129 STSelector sel_;
130
131 // logger
132 casa::LogIO os_;
133};
134
135}
136
137#endif
Note: See TracBrowser for help on using the repository browser.