casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSCalEnums.h
Go to the documentation of this file.
00001 //# MSCalEnums.h: Field name dictionary for MS and CAL tables
00002 //# Copyright (C) 1996,1997,1998,2000,2001,2002
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 adressed 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$
00028 
00029 #ifndef MSVIS_MSCALENUMS_H
00030 #define MSVIS_MSCALENUMS_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/Containers/SimOrdMap.h>
00034 #include <casa/Containers/Block.h>
00035 #include <casa/Arrays/Vector.h>
00036 #include <casa/BasicSL/String.h>
00037 #include <casa/Utilities/DataType.h>
00038 
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 
00041 // <summary> 
00042 // MSCalEnums: Field name dictionary for MeasurementSet and calibration tables
00043 // </summary>
00044 
00045 // <use visibility=export>
00046 
00047 // <reviewed reviewer="" date="" tests="" demos="">
00048 
00049 // <prerequisite>
00050 //   <li> <linkto class="MeasurementSet">MeasurementSet</linkto> module
00051 // </prerequisite>
00052 //
00053 // <etymology>
00054 // From MeasurementSet and calibration enumerations.
00055 // </etymology>
00056 //
00057 // <synopsis>
00058 // MSCalEnums defines a global dictionary of field names and properties
00059 // used by both the MeasurementSet and calibration tables. Field names
00060 // and properties are accessed through enumerated constants, thus
00061 // ensuring a consistent and uniform interface. Both column names and
00062 // keywords are included here. All data are stored in static maps.
00063 // </synopsis>
00064 //
00065 // <example>
00066 // <srcblock>
00067 //      // Determine the column name for the SPECTRAL_WINDOW_ID column
00068 //      String name = MSC::fieldName (MSC::SPECTRAL_WINDOW_ID));
00069 //
00070 // </srcblock>
00071 // </example>
00072 //
00073 // <motivation>
00074 // Provide unified, consistent access to data fields used in the synthesis
00075 // system, in both the user interface and individual applications.
00076 // </motivation>
00077 //
00078 // <todo asof="98/01/05">
00079 // Expand the column description information stored by this class.
00080 // </todo>
00081 
00082 // Re-define MSCalEnums to MSC for simplified access. Requires
00083 // forward declaration of MSCalEnums
00084 
00085 class MSCalEnums;
00086 typedef MSCalEnums MSC;
00087 
00088 class MSCalEnums
00089 {
00090  public:
00091   // Enumerate all relevant data fields (columns and keywords)
00092   enum colDef {
00093   // First include all MeasurementSet MAIN columns which may be used
00094   // in calibration selection, interpolation or labelling.
00095   //
00096   // Antenna number
00097   ANTENNA1 = 0,
00098   ANTENNA2 = 1,
00099   // Feed identifier
00100   FEED1 = 2,
00101   FEED2 = 3,
00102   // Pulsar bin number
00103   PULSAR_BIN = 4,
00104   // Scan number
00105   SCAN_NUMBER = 5,
00106   // Time
00107   TIME = 6,
00108   // Extra time precision
00109   TIME_EXTRA_PREC = 7,
00110   // Interval
00111   INTERVAL = 8,
00112   // Array identifier
00113   ARRAY_ID = 9,
00114   // Processor identifier
00115   PROCESSOR_ID = 10,
00116   // Field identifier
00117   FIELD_ID = 11,
00118   // Observation identifier
00119   OBSERVATION_ID = 12,
00120   // Pulsar gate
00121   PULSAR_GATE_ID = 13,
00122   // Spectral window identifier
00123   SPECTRAL_WINDOW_ID = 14,
00124   // Phase identifier
00125   PHASE_ID = 15,
00126   // State identifier
00127   STATE_ID = 16,
00128   
00129   // Other secondary MeasurementSet columns
00130   //
00131   // Frequency group
00132   FREQ_GROUP = 100,
00133   // Frequency group name
00134   FREQ_GROUP_NAME = 101,
00135   // Field name
00136   FIELD_NAME = 102,
00137   // Field code
00138   FIELD_CODE = 103,
00139   // Source name
00140   SOURCE_NAME = 104,
00141   // Source code
00142   SOURCE_CODE = 105,
00143   // Source calibration group
00144   CALIBRATION_GROUP = 106,
00145   
00146   // Other calibration table columns
00147   //
00148   // Gain matrix values
00149   GAIN = 200,
00150   // Reference antenna
00151   REF_ANT = 201,
00152   // Reference feed
00153   REF_FEED = 202,
00154   // Reference receptor
00155   REF_RECEPTOR = 203,
00156   // Reference frequency
00157   REF_FREQUENCY = 204,
00158   // Reference frequency frame
00159   MEAS_FREQ_REF = 205,
00160   // Reference direction
00161   REF_DIRECTION = 206,
00162   // Reference direction frame
00163   MEAS_DIR_REF = 207,
00164   // Antenna pointing offsets
00165   POINTING_OFFSET = 208,
00166   // Pointing offset frame
00167   MEAS_POINTING = 209,
00168   // 
00169   // Calibration format descriptor
00170   CAL_DESC_ID = 300, 
00171   // Calibration history identifier
00172   CAL_HISTORY_ID = 301,
00173 
00174   // Solution statistics and weights
00175   //
00176   // Solution validity flag
00177   TOTAL_SOLUTION_OK = 400,
00178   // RMS of fit
00179   TOTAL_FIT = 401,
00180   // Sum of fit weights
00181   TOTAL_FIT_WEIGHT = 402,
00182   // Solution validity flag (per solution)
00183   SOLUTION_OK = 403,
00184   // RMS of fit (per solution)
00185   FIT = 404,
00186   // Sum of fit weights (per solution)
00187   FIT_WEIGHT = 405,
00188   // Solution FLAG (!SOLUTION_OK)
00189   FLAG = 406,
00190   // Solution SNR
00191   SNR = 407,
00192   
00193   // Calibration description columns
00194   //
00195   // Number of spectral windows
00196   NUM_SPW = 500,
00197   // Number of frequency channels
00198   NUM_CHAN = 501,
00199   // Number of receptors
00200   NUM_RECEPTORS = 502,
00201   // Jones matrix dimension
00202   N_JONES = 503,
00203   // Midpoint of frequency channels
00204   CHAN_FREQ = 504,
00205   // Frequency channel width
00206   CHAN_WIDTH = 505,
00207   // Channel range
00208   CHAN_RANGE = 506,
00209   // Jones matrix type
00210   JONES_TYPE = 507, 
00211   // Polarization enumerations
00212   POLARIZATION_TYPE = 508,
00213   // MeasurementSet name
00214   MS_NAME = 509,
00215   
00216   // Calibration history columns
00217   //
00218   // Application parameter values
00219   CAL_PARMS = 600,
00220   // Associated calibration tables
00221   CAL_TABLES = 601,
00222   // Calibration selection
00223   CAL_SELECT = 602,
00224   // Calibration notes
00225   CAL_NOTES = 603,
00226 
00227   // Keywords
00228   //
00229   // Cal Desc sub-table
00230   CAL_DESC = 700,
00231   // Cal History sub-table
00232   CAL_HISTORY = 701,
00233   
00234   // FJones additions
00235   ROT_MEASURE = 800,
00236   ROT_MEASURE_ERROR = 801,
00237   IONOSPH_TEC = 802,
00238   IONOSPH_TEC_ERROR = 803,
00239 
00240   // GJonesDelayRateSB additions
00241   PHASE_OFFSET = 900,
00242   SB_DELAY = 901,
00243   DELAY_RATE = 902,
00244 
00245   // General polynomial calibration additions
00246   POLY_TYPE = 1000,
00247   POLY_MODE = 1001,
00248   SCALE_FACTOR = 1002,
00249   VALID_DOMAIN = 1003,
00250   N_POLY_AMP = 1004,
00251   N_POLY_PHASE = 1005,
00252   POLY_COEFF_AMP = 1006,
00253   POLY_COEFF_PHASE = 1007,
00254   PHASE_UNITS = 1008,
00255 
00256   // BJonesPoly additions
00257   SIDEBAND_REF = 1100,
00258 
00259   // Spline polynomial calibration additions
00260   N_KNOTS_AMP = 1200,
00261   N_KNOTS_PHASE = 1201,
00262   SPLINE_KNOTS_AMP = 1202,
00263   SPLINE_KNOTS_PHASE = 1203
00264 
00265   };
00266 
00267   // Access functions for column/keyword description data
00268   static String fieldName (Int enumField);
00269   static Block<String> fieldNames (const Vector<Int>& enumFields);
00270   static DataType basicType (Int enumField);
00271  
00272  private:
00273   // Initialize the static maps
00274   static void initMaps();
00275   
00276   // Static ordered maps containing field descriptions
00277   // Enum => Field Name
00278   static SimpleOrderedMap <Int, String> theirFieldMap;
00279   // Enum => Basic data type
00280   static SimpleOrderedMap <Int, DataType> theirTypeMap;
00281 };
00282 
00283 
00284 } //# NAMESPACE CASA - END
00285 
00286 #endif
00287    
00288   
00289 
00290 
00291