casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSFeedIndex.h
Go to the documentation of this file.
00001 //# MSFeedIndex: index into a MeasurementSet FEED subtable
00002 //# Copyright (C) 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 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: MSFeedIndex.h 18093 2004-11-30 17:51:10Z ddebonis $
00028 
00029 #ifndef MS_MSFEEDINDEX_H
00030 #define MS_MSFEEDINDEX_H
00031 
00032 #include <ms/MeasurementSets/MSTableIndex.h>
00033 
00034 #include <ms/MeasurementSets/MSFeedColumns.h>
00035 #include <casa/Containers/RecordField.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 //# forward declarations
00040 class MSFeed;
00041 
00042 // <summary>
00043 // </summary>
00044 
00045 // <use visibility=export>
00046 
00047 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00048 // </reviewed>
00049 
00050 // <prerequisite>
00051 //   <li> MeasurementSet
00052 //   <li> MSTableIndex
00053 // </prerequisite>
00054 //
00055 // <etymology>
00056 // </etymology>
00057 //
00058 // <synopsis>
00059 // </synopsis>
00060 //
00061 // <example>
00062 // </example>
00063 //
00064 // <motivation>
00065 // </motivation>
00066 //
00067 // <thrown>
00068 //    <li>
00069 //    <li>
00070 // </thrown>
00071 //
00072 
00073 class MSFeedIndex : public MSTableIndex
00074 {
00075 public:
00076     // no index attached, use the attach function or assignment operator to change that
00077   MSFeedIndex();
00078 
00079   // construct one using the indicated FEED table
00080   MSFeedIndex(const MSFeed &feed);
00081 
00082   // construct one from another
00083   MSFeedIndex(const MSFeedIndex &other);
00084 
00085   virtual ~MSFeedIndex();
00086 
00087   MSFeedIndex &operator=(const MSFeedIndex &other);
00088 
00089   void attach(const MSFeed &feed);
00090 
00091   // access to the antenna ID key, throws an exception if isNull() is False
00092   Int &antennaId() {return *antennaId_p;}
00093 
00094   // access to the feed ID key, throws an exception if isNull() is False
00095   Int &feedId() {return *feedId_p;}
00096 
00097   // access to the spectral window ID key, throws an exception if isNull() is False
00098   Int &spectralWindowId() {return *spwId_p;}
00099 
00100   // return feed id.'s (and associated row numbers) for a given antenna id., 
00101   // polzn type and receptor angle
00102   Vector<Int> matchFeedPolznAndAngle(const Int& antennaId, 
00103                                      const Vector<String>& polznType,
00104                                      const Vector<Float>& receptorAngle,
00105                                      const Float& tol,
00106                                      Vector<Int>& rowNumbers);
00107 
00108   // return feed id.'s (and associated row numbers) for a given antenna id.
00109   Vector<Int> matchAntennaId(const Int& antennaId, Vector<Int>& rowNumbers);
00110 
00111 protected:
00112   // the specialized compare function to pass to the
00113   // <linkto class=ColumnsIndex>ColumnsIndex</linkto> object.  This supports -1
00114   // values for the SPECTRAL_WINDOW_ID
00115   static Int compare (const Block<void*>& fieldPtrs,
00116                       const Block<void*>& dataPtrs,
00117                       const Block<Int>& dataTypes,
00118                       Int index);
00119   
00120 private:
00121   RecordFieldPtr<Int> antennaId_p, feedId_p, spwId_p;
00122 
00123   // Pointer to FEED columns accessor
00124   ROMSFeedColumns* msFeedCols_p;
00125 
00126   void attachIds();
00127 };
00128 
00129 
00130 } //# NAMESPACE CASA - END
00131 
00132 #endif
00133