casa
$Rev:20696$
|
00001 //# MSDataDescIndex: index or lookup in a MeasurementSet DATA_DESC 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: MSDataDescIndex.h 18475 2005-03-17 20:10:58Z dguo $ 00028 00029 #ifndef MS_MSDATADESCINDEX_H 00030 #define MS_MSDATADESCINDEX_H 00031 00032 //# includes 00033 #include <casa/aips.h> 00034 #include <ms/MeasurementSets/MSDataDescription.h> 00035 #include <ms/MeasurementSets/MSDataDescColumns.h> 00036 #include <casa/Arrays/Vector.h> 00037 #include <casa/BasicSL/String.h> 00038 00039 namespace casa { //# NAMESPACE CASA - BEGIN 00040 00041 //# forward declarations 00042 00043 // <summary> 00044 // Class to handle lookup or indexing into a MS DATA_DESC subtable 00045 // </summary> 00046 00047 // <use visibility=export> 00048 // 00049 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00050 // </reviewed> 00051 00052 // <prerequisite> 00053 // <li> MeasurementSet 00054 // <li> MSDataDescription 00055 // </prerequisite> 00056 // 00057 // <etymology> 00058 // From "MeasurementSet", "DATA_DESC subtable" and "index". 00059 // </etymology> 00060 // 00061 // <synopsis> 00062 // This class provides lookup and indexing into an MS DATA_DESC 00063 // subtable. These services include returning rows numbers 00064 // (which for the DATA_DESC subtable are DATA_DESC_ID's) associated 00065 // with specific data in the subtable. 00066 // </synopsis> 00067 // 00068 // <example> 00069 // </example> 00070 // 00071 // <motivation> 00072 // Collect together all subtable indexing and lookup for the 00073 // DATA_DESC subtable, for encapsulation and efficiency. 00074 // </motivation> 00075 // 00076 // <thrown> 00077 // <li> 00078 // <li> 00079 // </thrown> 00080 // 00081 00082 class MSDataDescIndex 00083 { 00084 public: 00085 // Construct from an MS DATA_DESC subtable 00086 MSDataDescIndex(const MSDataDescription& dataDescription); 00087 00088 // Null destructor 00089 virtual ~MSDataDescIndex() {}; 00090 00091 // Look up DATA_DESC_ID's for a given spectral window id 00092 Vector<Int> matchSpwId(const Int& spwId); 00093 Vector<Int> matchSpwId(const Vector<Int>& spwIds); 00094 00095 // Look up DATA_DESC_ID's for a given polarization id 00096 Vector<Int> matchPolId(const Int& polId); 00097 Vector<Int> matchPolId(const Vector<Int>& polIds); 00098 00099 // Look up DATA_DESC_ID's for a given spectral window and polarization id. 00100 Vector<Int> matchSpwIdAndPolznId(const Int& spwId, const Int& polznId); 00101 00102 private: 00103 // Disallow null constructor 00104 MSDataDescIndex(); 00105 00106 // DATA_DESC subtable column accessor 00107 ROMSDataDescColumns msDataDescCols_p; 00108 00109 // Vector cache of DataDesc id's 00110 Vector<Int> dataDescIds_p; 00111 Int nrows_p; 00112 }; 00113 00114 00115 } //# NAMESPACE CASA - END 00116 00117 #endif 00118