casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
GBTMSAntennaFiller.h
Go to the documentation of this file.
00001 //# GBTMSAntennaFiller.h: GBTMSAntennaFiller fills the MSAntenna table for GBT fillers
00002 //# Copyright (C) 2000,2001
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$
00028 
00029 #ifndef NRAO_GBTMSANTENNAFILLER_H
00030 #define NRAO_GBTMSANTENNAFILLER_H
00031 
00032 #include <casa/aips.h>
00033 #include <measures/Measures/MPosition.h>
00034 #include <ms/MeasurementSets/MSAntenna.h>
00035 
00036 //# Forward Declarations
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 class MSAntennaColumns;
00039 } //# NAMESPACE CASA - END
00040 
00041 #include <casa/namespace.h>
00042 
00043 class GBTAntennaFile;
00044 
00045 // <summary>
00046 // GBTMSAntennaFiller fills the MSAntenna table for GBT fillers
00047 // </summary>
00048 
00049 // <use visibility=local>
00050 
00051 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00052 // </reviewed>
00053 
00054 // <prerequisite>
00055 //   <li> MeasurementSets
00056 //   <li> GBT FITS files
00057 // </prerequisite>
00058 //
00059 // <etymology>
00060 // This class puts GBT data (fills) into the MSAntenna table.
00061 // </etymology>
00062 //
00063 // <synopsis>
00064 // This class puts the appropriate values for the GBT in an MSAntenna
00065 // table (which has been previously created as part of a MeasurementSet).
00066 // On each fill() any necessary additions to the MSAntenna are made.  
00067 // For GBT data at there will usually only be one row in this table.   This
00068 // row is added using information in the Antenna file when available or
00069 // the NRAO_GBT position from the Measures observatory table.  A new row
00070 // is added when the telescope information in the Antenna file changes.
00071 //
00072 // The antennaId is available to be used by 
00073 // other GBTMS*Fillers as other subtables are filled in turn.
00074 //
00075 // </synopsis>
00076 //
00077 // <example>
00078 // </example>
00079 //
00080 // <motivation>
00081 // Writing a filler is a daunting task.  There are various dependencies
00082 // between the subtables.  It helps to encapsulate the knowlege and
00083 // task of filling a specific subtable to separate classes.
00084 // </motivation>
00085 //
00086 //#! <thrown>
00087 //#! A list of exceptions thrown if errors are discovered in the function.
00088 //#! This tag will appear in the body of the header file, preceding the
00089 //#! declaration of each function which throws an exception.
00090 //#! </thrown>
00091 
00092 class GBTMSAntennaFiller
00093 {
00094 public:
00095 
00096     // The default ctor.  No MSAntenna table has been attached yet.
00097     // Calling fill on such a filler will throw an exception.
00098     // It is present so that this object can be instantiated before
00099     // an MSAntenna has been created.
00100     GBTMSAntennaFiller();
00101 
00102     // A filler attached to an MSAntenna table
00103     GBTMSAntennaFiller(MSAntenna &msAntenna);
00104 
00105     ~GBTMSAntennaFiller();
00106 
00107     // attach it to an MSAntenna
00108     void attach(MSAntenna &msAntenna);
00109 
00110     // fill using the supplied Antenna file if attached or the
00111     // "GBT" entry in the Measures observatory table.
00112     // rows are reused if the name and position match
00113     void fill(const GBTAntennaFile &antennaFile);
00114 
00115     // this is the row number of the most recently "filled" MSAntenna row
00116     Int antennaId() const {return antId_p;}
00117 
00118     // flush the underlying MS subtable
00119     void flush() {msAntenna_p->flush();}
00120 
00121 private:
00122     MSAntenna *msAntenna_p;
00123     MSAntennaColumns *msAntCols_p;
00124 
00125     MPosition position_p;
00126     String name_p;
00127 
00128     Int antId_p;
00129 
00130     // initialize the above for the first time
00131     void init(MSAntenna &msAntenna);
00132 
00133     // undefined and unavailable
00134     GBTMSAntennaFiller(const GBTMSAntennaFiller &other);
00135     void operator=(const GBTMSAntennaFiller &other);
00136 };
00137 
00138 #endif
00139 
00140