casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaselineTable.h
Go to the documentation of this file.
1 //# BaselineTable.cc: this code defines baseline table
2 //# Copyright (C) 2015
3 //# National Astronomical Observatory of Japan
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 #ifndef SD_BASELINETABLE_H
28 #define SD_BASELINETABLE_H
29 
30 #include <casa/aips.h>
31 #include <casa/Arrays/Vector.h>
32 #include <casa/Logging/LogIO.h>
36 #include <tables/Tables/Table.h>
39 #include <libsakura/sakura.h>
40 
41 #define BaselineType_kPolynomial 0
42 #define BaselineType_kChebyshev 1
43 #define BaselineType_kCubicSpline 2
44 #define BaselineType_kSinusoid 3
45 #define BaselineType_kNumElements 4
46 
47 namespace casa {
48 
50 public:
54 
55  virtual ~BaselineTable();
56 
57  void setup();
58  const casacore::String& name() const {return name_;};
59 
60  const casacore::Table& table() const { return table_; }
62  void attach();
63  void attachBaseColumns();
64  void attachOptionalColumns();
65 
67 
68  casacore::uInt getScan(casacore::uInt irow) const {return scanCol_.get(irow);}
69  casacore::uInt getBeam(casacore::uInt irow) const {return beamCol_.get(irow);}
70  casacore::uInt getAntenna(casacore::uInt irow) const {return antCol_.get(irow);}
71  uint getSpw(casacore::uInt irow) const {return static_cast<uint>(ifCol_.get(irow));}
72  double getTime(casacore::uInt irow) const {return static_cast<double>(timeCol_.get(irow));}
73 
74  bool getApply(casacore::uInt irow, casacore::uInt ipol) const;
75  uint getBaselineType(casacore::uInt irow, casacore::uInt ipol) const;
76  int getFPar(casacore::uInt irow, casacore::uInt ipol) const;
77 
78  void setdata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt beamno,
79  casacore::uInt antno, casacore::uInt ifno,
95  void appenddata(casacore::uInt scanno, casacore::uInt beamno,
96  casacore::uInt antno, casacore::uInt ifno,
112  void appendbasedata(int scanno, int beamno, int antno, int ifno,
113  int freqid, casacore::Double time);
114  void setresult(casacore::uInt irow,
117  void save(const std::string &filename);
119 
121  void setApply(int irow, int ipol, bool apply);
131  casacore::uInt getNChan(int irow);
138 
139  std::vector<bool> getMaskFromMaskList(casacore::uInt const nchan, std::vector<int> const& masklist);
140 
141 private:
142  void setbasedata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt beamno, casacore::uInt antno,
148  static const casacore::String name_;
149 
164 };
165 
166 }
167 
168 #endif
casacore::uInt getScan(casacore::uInt irow) const
Definition: BaselineTable.h:68
casacore::ArrayColumn< casacore::Int > fparCol_
Main interface class to a read/write table.
Definition: Table.h:153
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::uInt getBeam(casacore::uInt irow) const
Definition: BaselineTable.h:69
casacore::Matrix< casacore::Float > getLineFinderThreshold()
casacore::ArrayColumn< casacore::uInt > citerCol_
void apply(const Jones &j1, VisVector &v, const Jones &j2)
Apply a pair of Jones to a VisVector:
casacore::ArrayColumn< casacore::Float > resCol_
casacore::uInt nchan(casacore::uInt ifno)
uint getSpw(casacore::uInt irow) const
Definition: BaselineTable.h:71
virtual ~BaselineTable()
void setresult(casacore::uInt irow, casacore::Vector< casacore::Float > res, casacore::Array< casacore::Float > rms)
casacore::Matrix< casacore::Bool > getApply()
const casacore::String & name() const
Definition: BaselineTable.h:58
casacore::Matrix< casacore::Float > getFuncFParam(casacore::uInt irow)
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
casacore::MEpoch::ScalarColumn timeMeasCol_
casacore::Vector< casacore::uInt > getNChan()
casacore::Matrix< casacore::Int > getFuncParam(casacore::uInt irow)
casacore::ArrayColumn< casacore::Float > ffparCol_
casacore::uInt nrow()
Definition: BaselineTable.h:66
void save(const std::string &filename)
casacore::ArrayColumn< casacore::Bool > applyCol_
casacore::ArrayColumn< casacore::uInt > lfedgeCol_
casacore::Table table_
int getFPar(casacore::uInt irow, casacore::uInt ipol) const
void appendbasedata(int scanno, int beamno, int antno, int ifno, int freqid, casacore::Double time)
casacore::ArrayColumn< casacore::Float > rmsCol_
casacore::ScalarColumn< casacore::Double > timeCol_
casacore::ScalarColumn< casacore::uInt > antCol_
casacore::Matrix< casacore::Float > getClipThreshold()
casacore::Matrix< casacore::uInt > getClipIteration()
casacore::ArrayColumn< casacore::Bool > uselfCol_
casacore::Matrix< casacore::Int > getFuncParam()
void setApply(int irow, int ipol, bool apply)
casacore::Matrix< casacore::Float > getRms()
double Double
Definition: aipstype.h:55
casacore::Matrix< casacore::Float > getResult(casacore::uInt irow)
casacore::ScalarColumn< casacore::uInt > nchanCol_
const casacore::Table & table() const
Definition: BaselineTable.h:60
casacore::ScalarColumn< casacore::uInt > scanCol_
void appenddata(casacore::uInt scanno, casacore::uInt beamno, casacore::uInt antno, casacore::uInt ifno, casacore::uInt freqid, casacore::Double time, casacore::Array< casacore::Bool > apply, casacore::Array< casacore::uInt > ftype, casacore::Array< casacore::Int > fpar, casacore::Array< casacore::Float > ffpar, casacore::Array< casacore::uInt > mask, casacore::Array< casacore::Float > res, casacore::Array< casacore::Float > rms, casacore::uInt nchan, casacore::Array< casacore::Float > cthres, casacore::Array< casacore::uInt > citer, casacore::Array< casacore::Bool > uself, casacore::Array< casacore::Float > lfthres, casacore::Array< casacore::uInt > lfavg, casacore::Array< casacore::uInt > lfedge)
casacore::uInt getAntenna(casacore::uInt irow) const
Definition: BaselineTable.h:70
casacore::Matrix< casacore::Bool > getUseLineFinder()
void attachOptionalColumns()
casacore::Table originaltable_
uInt nrow() const
Get the number of rows.
Definition: Table.h:1201
casacore::ArrayColumn< casacore::Float > lfthresCol_
std::vector< bool > getMaskFromMaskList(casacore::uInt const nchan, std::vector< int > const &masklist)
casacore::Matrix< casacore::Float > getFuncFParam()
A Table intended to hold astronomical data (a set of Measurements).
void setdata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt beamno, casacore::uInt antno, casacore::uInt ifno, casacore::uInt freqid, casacore::Double time, casacore::Array< casacore::Bool > apply, casacore::Array< casacore::uInt > ftype, casacore::Array< casacore::Int > fpar, casacore::Array< casacore::Float > ffpar, casacore::Array< casacore::uInt > mask, casacore::Array< casacore::Float > res, casacore::Array< casacore::Float > rms, casacore::uInt nchan, casacore::Array< casacore::Float > cthres, casacore::Array< casacore::uInt > citer, casacore::Array< casacore::Bool > uself, casacore::Array< casacore::Float > lfthres, casacore::Array< casacore::uInt > lfavg, casacore::Array< casacore::uInt > lfedge)
static const casacore::String name_
casacore::ArrayColumn< casacore::uInt > ftypeCol_
void getColumn(Array< T > &array, Bool resize=False) const
Get the array of all values in a column.
casacore::Matrix< casacore::uInt > getLineFinderChanAvg()
casacore::ScalarColumn< casacore::uInt > beamCol_
casacore::Table table()
Definition: BaselineTable.h:61
void get(uInt rownr, T &value) const
Get the data from a particular cell (i.e.
Definition: ScalarColumn.h:137
casacore::Matrix< casacore::uInt > getLineFinderEdge()
casacore::ArrayColumn< casacore::Float > cthresCol_
casacore::ArrayColumn< casacore::uInt > maskCol_
TableExprNode rms(const TableExprNode &array)
Definition: ExprNode.h:1637
casacore::ArrayColumn< casacore::uInt > lfavgCol_
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Matrix< casacore::uInt > getMaskList()
casacore::ScalarColumn< casacore::uInt > ifCol_
void get(uInt rownr, Array< T > &array, Bool resize=False) const
Get the array value in a particular cell (i.e.
casacore::Matrix< casacore::Float > getResult()
casacore::ScalarColumn< casacore::uInt > freqidCol_
uint getBaselineType(casacore::uInt irow, casacore::uInt ipol) const
unsigned int uInt
Definition: aipstype.h:51
double getTime(casacore::uInt irow) const
Definition: BaselineTable.h:72
void getColumn(Vector< T > &vec, Bool resize=False) const
Get the vector of all values in the column.
void setbasedata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt beamno, casacore::uInt antno, casacore::uInt ifno, casacore::uInt freqid, casacore::Double time)