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