casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSField.h
Go to the documentation of this file.
00001 //# MSField.h: The MeasurementSet FIELD Table
00002 //# Copyright (C) 1996,1999,2000
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id: MSField.h 20299 2008-04-03 05:56:44Z gervandiepen $
00028 
00029 #ifndef MS_MSFIELD_H
00030 #define MS_MSFIELD_H
00031 
00032 #include <casa/aips.h>
00033 #include <ms/MeasurementSets/MSTable.h>
00034 #include <ms/MeasurementSets/MSFieldEnums.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary> 
00039 // A Table intended to hold a MeasurementSet FIELD table.
00040 // </summary>
00041 
00042 // <use visibility=export>
00043 
00044 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
00045 
00046 // <prerequisite>
00047 //   <li> <linkto class="MeasurementSet:description">MeasurementSet</linkto> 
00048 //   <li> <linkto class="MSTable">MSTable</linkto> 
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // MSField stands for the MeasurementSet Field table.
00053 // </etymology>
00054 //
00055 // <synopsis> 
00056 // An MSField is a table intended to hold the FIELD table for
00057 // the MeasurementSet. It has an identical set of member functions as
00058 // the main MeasurementSet class, except (currently) for the default
00059 // calibration members. For further info and examples see the 
00060 // MeasurementSet class.
00061 // </synopsis> 
00062 //
00063 // <example>
00064 // See the MeasurementSet for an example of how to access and use this class.
00065 // </example>
00066 //
00067 // <motivation>
00068 // It was found that subtables and the main table of the MeasurementSet have
00069 // a lot in common, therefore they derive their interface from the same
00070 // base class. Each subtable has its own class to keep the enum definitions
00071 // and conversion functions in separate scopes.
00072 // </motivation>
00073 //
00074 // <todo asof="1999/01/13">
00075 // see MeasurementSet.
00076 // </todo>
00077 
00078 class MSField:public MSFieldEnums,
00079                 public MSTable<MSFieldEnums::PredefinedColumns,
00080                                MSFieldEnums::PredefinedKeywords>
00081 {
00082 public:
00083 
00084     // This constructs an empty MSField.
00085     MSField ();
00086 
00087     // These constructors mirror the Table ones with additional checking
00088     // on validity (verifying that the MSField will have the required columns
00089     // and keywords)
00090     // An exception is thrown if the constructed Table is not a valid MSField
00091     // <thrown>
00092     //   <li> AipsError
00093     // </thrown>
00094     // <group name=tableLikeConstructors>
00095     MSField (const String &tableName, TableOption = Table::Old);
00096     MSField (const String &tableName, const String &tableDescName,
00097                     TableOption = Table::Old);
00098     MSField (SetupNewTable &newTab, uInt nrrow = 0,
00099                     Bool initialize = False);
00100     MSField (const Table &table);
00101     MSField (const MSField &other);
00102     // </group>
00103 
00104     // As with tables, the destructor writes the table if necessary.
00105     // Additional checking is done here to verify that all required
00106     // columns are still present.
00107     // If it is NOT valid, it will write the table and then throw an exception.
00108     // <thrown>
00109     //   <li> AipsError
00110     // </thrown>
00111     ~MSField();
00112 
00113     //  Assignment operator, reference semantics
00114     MSField& operator=(const MSField&);
00115 
00116     // Make a special copy of this Table which references all columns from
00117     // this Table except those mentioned; those are empty and writable.
00118     // Each forwarded column has the same writable status as the underlying
00119     // column. The mentioned columns all use the AipsIO storage manager.
00120     // This function is inherited from MSTable and unlikely to be of use,
00121     // except in the class MeasurementSet (see comment there)..
00122     MSField referenceCopy(const String& newTableName,
00123                           const Block<String>& writableColumns) const;
00124 
00125     // Add an ephemeris table (there can be many) to the Field table.
00126     // The table is copied from inputEphemTableName and named
00127     // EPHEM<id>_<comment>.tab
00128     // If any tables of the same id exist already, they are removed beforehand.
00129     // The optional EPHEMERIS_ID column is added if it doesn't exist, yet.
00130     // Return False in case of errors.
00131     Bool addEphemeris(const uInt id, const String& inputEphemTableName,
00132                       const String& comment);
00133 
00134     // Remove (delete) any ephemeris tables with given id (without changes to
00135     // the EPHEMERIS_ID column).
00136     // Return False in case of errors (but True if the id didn't exist).
00137     Bool removeEphemeris(const uInt id);
00138 
00139     // Initialize the statics appropriately. This does not need to be
00140     // called by users, it is called by the implementation class
00141     // MSTableImpl.
00142     static void init();
00143 
00144 private:
00145 
00146     // required by the need to throw an exception in the destructor
00147     Bool hasBeenDestroyed_p;
00148 };
00149 
00150 
00151 } //# NAMESPACE CASA - END
00152 
00153 #endif
00154 
00155 
00156 
00157 
00158