casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSField.h
Go to the documentation of this file.
1 //# MSField.h: The MeasurementSet FIELD Table
2 //# Copyright (C) 1996,1999,2000
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 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 //#
27 //# $Id$
28 
29 #ifndef MS_MSFIELD_H
30 #define MS_MSFIELD_H
31 
32 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 // <summary>
39 // A Table intended to hold a MeasurementSet FIELD table.
40 // </summary>
41 
42 // <use visibility=export>
43 
44 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
45 
46 // <prerequisite>
47 // <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto>
48 // <li> <linkto class="MSTable">MSTable</linkto>
49 // </prerequisite>
50 //
51 // <etymology>
52 // MSField stands for the MeasurementSet Field table.
53 // </etymology>
54 //
55 // <synopsis>
56 // An MSField is a table intended to hold the FIELD table for
57 // the MeasurementSet. It has an identical set of member functions as
58 // the main MeasurementSet class, except (currently) for the default
59 // calibration members. For further info and examples see the
60 // MeasurementSet class.
61 // </synopsis>
62 //
63 // <example>
64 // See the MeasurementSet for an example of how to access and use this class.
65 // </example>
66 //
67 // <motivation>
68 // It was found that subtables and the main table of the MeasurementSet have
69 // a lot in common, therefore they derive their interface from the same
70 // base class. Each subtable has its own class to keep the enum definitions
71 // and conversion functions in separate scopes.
72 // </motivation>
73 //
74 // <todo asof="1999/01/13">
75 // see MeasurementSet.
76 // </todo>
77 
78 class MSField:public MSFieldEnums,
79  public MSTable<MSFieldEnums>
80 {
81 public:
82 
83  // This constructs an empty MSField.
84  MSField ();
85 
86  // These constructors mirror the Table ones with additional checking
87  // on validity (verifying that the MSField will have the required columns
88  // and keywords)
89  // An exception is thrown if the constructed Table is not a valid MSField
90  // <thrown>
91  // <li> AipsError
92  // </thrown>
93  // <group name=tableLikeConstructors>
95  MSField (const String &tableName, const String &tableDescName,
97  MSField (SetupNewTable &newTab, rownr_t nrrow = 0,
98  Bool initialize = False);
99  MSField (const Table &table);
100  MSField (const MSField &other);
101  // </group>
102 
103  // As with tables, the destructor writes the table if necessary.
104  // Additional checking is done here to verify that all required
105  // columns are still present.
106  // If it is NOT valid, it will write the table and then throw an exception.
107  // <thrown>
108  // <li> AipsError
109  // </thrown>
110  ~MSField();
111 
112  // Assignment operator, reference semantics
113  MSField& operator=(const MSField&);
114 
115  // Make a special copy of this Table which references all columns from
116  // this Table except those mentioned; those are empty and writable.
117  // Each forwarded column has the same writable status as the underlying
118  // column. The mentioned columns all use the AipsIO storage manager.
119  // This function is inherited from MSTable and unlikely to be of use,
120  // except in the class MeasurementSet (see comment there)..
121  MSField referenceCopy(const String& newTableName,
122  const Block<String>& writableColumns) const;
123 
124  // Add an ephemeris table (there can be many) to the Field table.
125  // The table is copied from inputEphemTableName and named
126  // EPHEM<id>_<comment>.tab
127  // If any tables of the same id exist already, they are removed beforehand.
128  // The optional EPHEMERIS_ID column is added if it doesn't exist, yet.
129  // Return False in case of errors.
130  Bool addEphemeris(const uInt id, const String& inputEphemTableName,
131  const String& comment);
132 
133  // Remove (delete) any ephemeris tables with given id (without changes to
134  // the EPHEMERIS_ID column).
135  // Return False in case of errors (but True if the id didn't exist).
136  Bool removeEphemeris(const uInt id);
137 
138  // Initialize the statics appropriately. This does not need to be
139  // called by users, it is called by the implementation class
140  // MSTableImpl.
141  static MSTableMaps initMaps();
142 
143 private:
144 
145  // required by the need to throw an exception in the destructor
147 };
148 
149 
150 } //# NAMESPACE CASACORE - END
151 
152 #endif
153 
154 
155 
156 
157 
Create a new table - define shapes, data managers, etc.
Definition: SetupNewTab.h:340
Main interface class to a read/write table.
Definition: Table.h:157
~MSField()
As with tables, the destructor writes the table if necessary.
MSField()
This constructs an empty MSField.
MSField referenceCopy(const String &newTableName, const Block< String > &writableColumns) const
Make a special copy of this Table which references all columns from this Table except those mentioned...
const String & tableName() const
Get the table name.
Definition: Table.h:1187
Enums for the MeasurementSet FIELD table.
Definition: MSFieldEnums.h:60
Bool addEphemeris(const uInt id, const String &inputEphemTableName, const String &comment)
Add an ephemeris table (there can be many) to the Field table.
MSField & operator=(const MSField &)
Assignment operator, reference semantics.
existing table
Definition: Table.h:174
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static MSTableMaps initMaps()
Initialize the statics appropriately.
Bool removeEphemeris(const uInt id)
Remove (delete) any ephemeris tables with given id (without changes to the EPHEMERIS_ID column)...
const Bool False
Definition: aipstype.h:44
A Table intended to hold a MeasurementSet FIELD table.
Definition: MSField.h:78
simple 1-D array
Definition: Allocator.h:210
Bool hasBeenDestroyed_p
required by the need to throw an exception in the destructor
Definition: MSField.h:146
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
A struct holding the maps used in MSTable.
Definition: MSTable.h:51
A Table intended to hold astronomical data.
Definition: MSTable.h:146
String: the storage and methods of handling collections of characters.
Definition: String.h:225
unsigned int uInt
Definition: aipstype.h:51
TableOption
Define the possible options how a table can be opened.
Definition: Table.h:172