source: trunk/src/STBaselineTable.h @ 2773

Last change on this file since 2773 was 2773, checked in by WataruKawasaki, 11 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: Yes

Module(s): sd

Description: optimisation/refactoring the baselining functions for scantable.


File size: 5.0 KB
Line 
1//
2// C++ Interface: STBaselineTable
3//
4// Description:
5//
6// ApplyTable for baseline subtraction.
7//
8// Author: Wataru Kawasaki <wataru.kawasaki@nao.ac.jp> (C) 2013
9//
10// Copyright: See COPYING file that comes with this distribution
11//
12//
13#ifndef ASAP_BASELINEPARAM_TABLE_H
14#define ASAP_BASELINEPARAM_TABLE_H
15
16#include <tables/Tables/ArrayColumn.h>
17#include <tables/Tables/ScalarColumn.h>
18
19#include "Scantable.h"
20#include "STApplyTable.h"
21#include "STBaselineEnum.h"
22
23namespace asap {
24
25/**
26ApplyTable for baseline subtraction
27
28@author Wataru Kawasaki
29@date $Date:$
30@version $Revision:$
31*/
32class STBaselineTable : public STApplyTable {
33public:
34  STBaselineTable() {;}
35  STBaselineTable(const Scantable& parent);
36  STBaselineTable(const casa::String &name);
37
38  virtual ~STBaselineTable();
39
40  void setup();
41  const casa::String& name() const {return name_;};
42
43  void attachOptionalColumns();
44  void save(const std::string &filename);
45  void setdata(casa::uInt irow, casa::uInt scanno, casa::uInt cycleno,
46               casa::uInt beamno, casa::uInt ifno, casa::uInt polno,
47               casa::uInt freqid, casa::Double time,
48               casa::Bool apply,
49               STBaselineFunc::FuncName ftype,
50               casa::Vector<casa::Int> fpar,
51               casa::Vector<casa::Float> ffpar,
52               casa::Vector<casa::uInt> mask,
53               casa::Vector<casa::Float> res,
54               casa::Float rms,
55               casa::uInt nchan,
56               casa::Float cthres,
57               casa::uInt citer,
58               casa::Float lfthres,
59               casa::uInt lfavg,
60               casa::Vector<casa::uInt> lfedge);
61  void appenddata(int scanno, int cycleno,
62                  int beamno, int ifno, int polno,
63                  int freqid, casa::Double time,
64                  bool apply,
65                  STBaselineFunc::FuncName ftype,
66                  vector<int> fpar,
67                  vector<float> ffpar,
68                  casa::Vector<casa::uInt> mask,
69                  vector<float> res,
70                  float rms,
71                  int nchan,
72                  float cthres,
73                  int citer,
74                  float lfthres,
75                  int lfavg,
76                  vector<int> lfedge);
77  void appenddata(int scanno, int cycleno,
78                  int beamno, int ifno, int polno,
79                  int freqid, casa::Double time,
80                  bool apply,
81                  STBaselineFunc::FuncName ftype,
82                  int fpar,
83                  vector<float> ffpar,
84                  casa::Vector<casa::uInt> mask,
85                  vector<float> res,
86                  float rms,
87                  int nchan,
88                  float cthres,
89                  int citer,
90                  float lfthres,
91                  int lfavg,
92                  vector<int> lfedge);
93  void appenddata(casa::uInt scanno, casa::uInt cycleno,
94                  casa::uInt beamno, casa::uInt ifno, casa::uInt polno,
95                  casa::uInt freqid, casa::Double time,
96                  casa::Bool apply,
97                  STBaselineFunc::FuncName ftype,
98                  casa::Vector<casa::Int> fpar,
99                  casa::Vector<casa::Float> ffpar,
100                  casa::Vector<casa::uInt> mask,
101                  casa::Vector<casa::Float> res,
102                  casa::Float rms,
103                  casa::uInt nchan,
104                  casa::Float cthres,
105                  casa::uInt citer,
106                  casa::Float lfthres,
107                  casa::uInt lfavg,
108                  casa::Vector<casa::uInt> lfedge);
109  void appendbasedata(int scanno, int cycleno,
110                      int beamno, int ifno, int polno,
111                      int freqid, casa::Double time);
112  void setresult(casa::uInt irow,
113                 casa::Vector<casa::Float> res,
114                 casa::Float rms);
115  casa::uInt nchan(casa::uInt ifno);
116  casa::Vector<casa::Bool> getApply() {return applyCol_.getColumn();}
117  bool getApply(int irow);
118  casa::Vector<casa::uInt> getFunction() {return ftypeCol_.getColumn();}
119  casa::Vector<STBaselineFunc::FuncName> getFunctionNames();
120  STBaselineFunc::FuncName getFunctionName(int irow);
121  casa::Matrix<casa::Int> getFuncParam() {return fparCol_.getColumn();}
122  std::vector<int> getFuncParam(int irow);
123  casa::Matrix<casa::Float> getFuncFParam() {return ffparCol_.getColumn();}
124  casa::Matrix<casa::uInt> getMaskList() {return maskCol_.getColumn();}
125  std::vector<bool> getMask(int irow);
126  casa::Matrix<casa::Float> getResult() {return resCol_.getColumn();}
127  casa::Vector<casa::Float> getRms() {return rmsCol_.getColumn();}
128  casa::Vector<casa::uInt> getNChan() {return nchanCol_.getColumn();}
129  casa::uInt getNChan(int irow);
130  casa::Vector<casa::Float> getClipThreshold() {return cthresCol_.getColumn();}
131  casa::Vector<casa::uInt> getClipIteration() {return citerCol_.getColumn();}
132  casa::Vector<casa::Float> getLineFinderThreshold() {return lfthresCol_.getColumn();}
133  casa::Vector<casa::uInt> getLineFinderChanAvg() {return lfavgCol_.getColumn();}
134  casa::Matrix<casa::uInt> getLineFinderEdge() {return lfedgeCol_.getColumn();}
135  void setApply(int irow, bool apply);
136
137private:
138  static const casa::String name_ ;
139  casa::ScalarColumn<casa::Bool> applyCol_;
140  casa::ScalarColumn<casa::uInt> ftypeCol_;
141  casa::ArrayColumn<casa::Int> fparCol_;
142  casa::ArrayColumn<casa::Float> ffparCol_;
143  casa::ArrayColumn<casa::uInt> maskCol_;
144  casa::ArrayColumn<casa::Float> resCol_;
145  casa::ScalarColumn<casa::Float> rmsCol_;
146  casa::ScalarColumn<casa::uInt> nchanCol_;
147  casa::ScalarColumn<casa::Float> cthresCol_;
148  casa::ScalarColumn<casa::uInt> citerCol_;
149  casa::ScalarColumn<casa::Float> lfthresCol_;
150  casa::ScalarColumn<casa::uInt> lfavgCol_;
151  casa::ArrayColumn<casa::uInt> lfedgeCol_;
152};
153
154}
155
156#endif
Note: See TracBrowser for help on using the repository browser.