casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalTable2.h
Go to the documentation of this file.
1 //# CalTable.h: Calibration table access and creation
2 //# Copyright (C) 1996,1997,1998,1999,2001,2002,2003
3 //# Associated Universities, Inc. Washington DC, USA.
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 adressed 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 //#
27 //# $Id$
28 
29 #ifndef CALIBRATION_CALTABLE2_H
30 #define CALIBRATION_CALTABLE2_H
31 
32 #include <casa/aips.h>
33 #include <tables/Tables/Table.h>
34 #include <tables/TaQL/ExprNode.h>
35 #include <casa/Containers/Record.h>
36 #include <casa/Utilities/Sort.h>
41 
42 namespace casa { //# NAMESPACE CASA - BEGIN
43 
44  // <summary>
45  // CalTable: Calibration table access and creation
46  // </summary>
47 
48  // <use visibility=export>
49 
50  // <reviewed reviewer="" date="" tests="" demos="">
51 
52  // <prerequisite>
53  // <li> <linkto class="CalTableDesc">CalTableDesc</linkto> module
54  // </prerequisite>
55  //
56  // <etymology>
57  // From "calibration" and "table".
58  // </etymology>
59  //
60  // <synopsis>
61  // The CalTable classes provide basic access to calibration tables. This
62  // includes the creation of calibration tables, sorting and selection
63  // capabilities, and basic data access. Specializations for baseline-based,
64  // time-variable and solvable VisJones types, and sub-types, are provided
65  // through inheritance.
66  // </etymology>
67  //
68  // <example>
69  // <srcblock>
70  // </srcblock>
71  // </example>
72  //
73  // <motivation>
74  // This class is used by other calibration table accessors and iterators.
75  // </motivation>
76  //
77  // <todo asof="98/01/01">
78  // (i) Generic synthesis selection
79  // </todo>
80 
81  class CalTable2
82  {
83  public:
84  // Default null constructor, and destructor
85  CalTable2();
86  virtual ~CalTable2();
87 
88  // Construct from a specified table name, calibration table descriptor
89  // and table access option. Used for creating new tables.
90  CalTable2(const casacore::String& tableName, CalTableDesc2& ctableDesc,
92 
93  // Construct from a specified table name, and access option. Used
94  // for accessing existing tables.
96 
97  // Construct from an existing table object
98  CalTable2(const casacore::Table& table);
99 
100  // Copy constructor
101  CalTable2(const CalTable2& other);
102 
103  //
105  // Assignment operator
106  CalTable2& operator= (const CalTable2& other);
107 
108  // casacore::Sort (cal_main)
112 
113  // casacore::Sort (cal_main) IN PLACE
114  void sort2 (const casacore::Block <casacore::String>& columnNames,
117 
118  // Apply selection to the calibration table
119  CalTable2 select (const casacore::String& calSelect);
120 
121  // Apply selection to the calibration table IN PLACE
122  void select2 (const casacore::String& calSelect);
123 
124  // Return number of rows in cal_main, cal_desc or cal_history
125  casacore::Int nRowMain() const;
126  casacore::Int nRowDesc() const;
127  casacore::Int nRowHistory() const;
128 
129  // Add rows to cal_main, cal_desc or cal_history
130  void addRowMain (casacore::uInt nrrow = 1, casacore::Bool initialize = false)
131  {itsMainTable->addRow(nrrow, initialize);};
132  void addRowDesc (casacore::uInt nrrow = 1, casacore::Bool initialize = false)
133  {itsDescTable->addRow(nrrow, initialize);};
134  void addRowHistory (casacore::uInt nrrow = 1, casacore::Bool initialize = false)
135  {itsHistoryTable->addRow(nrrow, initialize);};
136 
137  // Get a row from cal_main, cal_desc or cal_history
141 
142  // Put a row to cal_main, cal_desc or cal_history
143  void putRowMain (const casacore::Int& jrow, CalMainRecord& tableRec);
144  void putRowDesc (const casacore::Int& jrow, CalDescRecord& tableRec);
145  void putRowHistory (const casacore::Int& jrow, CalHistoryRecord& tableRec);
146 
147  // Return the maximum antenna number in the table
148  virtual casacore::Int maxAntenna();
149 
150  // Return the number of unique time slots in the table
152 
153  // Create a new table
154  void createCalTable(const casacore::String& tableName, CalTableDesc2& ctableDesc,
156 
157  // Open an existing table
158  void openCalTable(const casacore::String& tableName,
160 
161  // Return cal_main and sub-tables as casacore::Table references
165  const casacore::Table& calMainAsTable() const {return *itsMainTable;};
166  const casacore::Table& calDescAsTable() const {return *itsDescTable;};
168  protected:
169 
170  // Friend class access from the ROCalMainColumns, ROCalDescColumns
171  // and ROCalHistoryColumns class hierarchies
172 // friend class ROCalMainColumns2;
173 // friend class CalMainColumns2;
174 // friend class ROCalDescColumns2;
175 // friend class CalDescColumns2;
176  friend class ROCalHistoryColumns;
177  friend class CalHistoryColumns;
178 
179  private:
180  // Pointer to underlying cal_main casacore::Table object
182 
183  // Pointers to the cal_desc and cal_history sub-tables
187  };
188 
189 } //# NAMESPACE CASA - END
190 
191 #endif
192 
casacore::Record getRowDesc(const casacore::Int &jrow)
void addRow(uInt nrrow=1, Bool initialize=False)
Add one or more rows at the end of the table.
Definition: Table.h:1235
int Int
Definition: aipstype.h:50
virtual casacore::Int maxAntenna()
Return the maximum antenna number in the table.
void putRowDesc(const casacore::Int &jrow, CalDescRecord &tableRec)
void openCalTable(const casacore::String &tableName, casacore::Table::TableOption access=casacore::Table::Old)
Open an existing table.
CalTable2 select(const casacore::String &calSelect)
Apply selection to the calibration table.
void addRowMain(casacore::uInt nrrow=1, casacore::Bool initialize=false)
Add rows to cal_main, cal_desc or cal_history.
Definition: CalTable2.h:130
Main interface class to a read/write table.
Definition: Table.h:153
void putRowMain(const casacore::Int &jrow, CalMainRecord &tableRec)
Put a row to cal_main, cal_desc or cal_history.
void createCalTable(const casacore::String &tableName, CalTableDesc2 &ctableDesc, casacore::Table::TableOption access=casacore::Table::New)
Create a new table.
casacore::Table * itsMainTable
Pointer to underlying cal_main casacore::Table object.
Definition: CalTable2.h:181
ROCalHistoryColumns: Read-only cal_history calibration table column access.
Order
Enumerate the sort order:
Definition: Sort.h:260
casacore::Table * itsDescTable
Pointers to the cal_desc and cal_history sub-tables.
Definition: CalTable2.h:184
CalTable: Calibration table access and creation.
Definition: CalTable2.h:81
CalDescRecord: Cal_desc table record access and creation.
Definition: CalDescRecord.h:72
CalTable2 sort(const casacore::Block< casacore::String > &columnNames, casacore::Sort::Order order=casacore::Sort::Ascending, casacore::Sort::Option option=casacore::Sort::HeapSort)
casacore::Sort (cal_main)
casacore::Table & calMainAsTable()
Return cal_main and sub-tables as casacore::Table references.
Definition: CalTable2.h:162
void sort2(const casacore::Block< casacore::String > &columnNames, casacore::Sort::Order order=casacore::Sort::Ascending, casacore::Sort::Option option=casacore::Sort::HeapSort)
casacore::Sort (cal_main) IN PLACE
CalTable2 & operator=(const CalTable2 &other)
Assignment operator.
casacore::Int parType_
Definition: CalTable2.h:186
CalHistoryRecord: Cal_ table record access and creation.
Definition: CalHistRecord.h:71
existing table
Definition: Table.h:170
double Double
Definition: aipstype.h:55
virtual ~CalTable2()
casacore::Int nRowMain() const
Return number of rows in cal_main, cal_desc or cal_history.
Option
Enumerate the sort options:
Definition: Sort.h:252
CalTable2()
Default null constructor, and destructor.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
CalMainRecord: Calibration table record access and creation.
Definition: CalMainRecord.h:74
void select2(const casacore::String &calSelect)
Apply selection to the calibration table IN PLACE.
void putRowHistory(const casacore::Int &jrow, CalHistoryRecord &tableRec)
casacore::Table & calDescAsTable()
Definition: CalTable2.h:163
const casacore::Table & calMainAsTable() const
Definition: CalTable2.h:165
casacore::Record getRowHistory(const casacore::Int &jrow)
casacore::Record getRowMain(const casacore::Int &jrow)
Get a row from cal_main, cal_desc or cal_history.
casacore::Int nRowHistory() const
String: the storage and methods of handling collections of characters.
Definition: String.h:223
CalHistoryColumns: Read-write cal_history calibration table column access.
casacore::Int numberTimeSlots(const casacore::Double &fracError)
Return the number of unique time slots in the table.
create table
Definition: Table.h:172
casacore::Int nRowDesc() const
casacore::Int parType()
Definition: CalTable2.h:104
void addRowHistory(casacore::uInt nrrow=1, casacore::Bool initialize=false)
Definition: CalTable2.h:134
casacore::Table & calHistoryAsTable()
Definition: CalTable2.h:164
casacore::Table * itsHistoryTable
Definition: CalTable2.h:185
void addRowDesc(casacore::uInt nrrow=1, casacore::Bool initialize=false)
Definition: CalTable2.h:132
const casacore::Table & calDescAsTable() const
Definition: CalTable2.h:166
CalTableDesc: Define the format of calibration tables.
Definition: CalTableDesc2.h:84
unsigned int uInt
Definition: aipstype.h:51
TableOption
Define the possible options how a table can be opened.
Definition: Table.h:168