casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSSpWindowIndex.h
Go to the documentation of this file.
00001 //# MSSpWindowIndex: index/lookup in a MeasurementSet SPECTRAL_WINDOW 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: MSSpWindowIndex.h 18093 2004-11-30 17:51:10Z ddebonis $
00028 
00029 #ifndef MS_MSSPWINDOWINDEX_H
00030 #define MS_MSSPWINDOWINDEX_H
00031 
00032 //# includes
00033 #include <casa/aips.h>
00034 #include <measures/Measures/MFrequency.h>
00035 #include <ms/MeasurementSets/MSSpectralWindow.h>
00036 #include <ms/MeasurementSets/MSSpWindowColumns.h>
00037 #include <casa/Arrays/Vector.h>
00038 #include <casa/BasicSL/String.h>
00039 
00040 namespace casa { //# NAMESPACE CASA - BEGIN
00041 
00042 //# forward declarations
00043 
00044 // <summary>
00045 // Class to handle lookup or indexing into a MS SPECTRAL_WINDOW subtable
00046 // </summary>
00047 
00048 // <use visibility=export>
00049 //
00050 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00051 // </reviewed>
00052 
00053 // <prerequisite>
00054 //   <li> MeasurementSet
00055 //   <li> MSSpWindowription
00056 // </prerequisite>
00057 //
00058 // <etymology>
00059 // From "MeasurementSet", "SPECTRAL_WINDOW subtable" and "index".
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // This class provides lookup and indexing into an MS SPECTRAL_WINDOW
00064 // subtable. These services include returning rows numbers
00065 // (which for the SPECTRAL_WINDOW subtable are SPECTRAL_WINDOW_ID's) 
00066 // associated with specific data in the subtable.
00067 // </synopsis>
00068 //
00069 // <example>
00070 // </example>
00071 //
00072 // <motivation>
00073 // Collect together all subtable indexing and lookup for the
00074 // SPECTRAL_WINDOW subtable, for encapsulation and efficiency.
00075 // </motivation>
00076 //
00077 // <thrown>
00078 //    <li>
00079 //    <li>
00080 // </thrown>
00081 //
00082 
00083 class MSSpWindowIndex 
00084 {
00085 public:
00086   // Construct from an MS SPECTRAL_WINDOW subtable
00087   MSSpWindowIndex(const MSSpectralWindow& spectralWindow);
00088 
00089   // Null destructor
00090   virtual ~MSSpWindowIndex() {};
00091 
00092   // Look up SPECTRAL_WINDOW_ID's for a given frequency group or groups
00093   Vector<Int> matchFreqGrp(const Int& freqGrp);
00094   Vector<Int> matchFreqGrp(const Vector<Int>& freqGrps);
00095 
00096   // Look up SPECTRAL_WINDOW_ID's for a given frequency group name
00097   Vector<Int> matchFreqGrpName(const String& freqGrpName);
00098 
00099   // Look up SPECTRAL_WINDOW_ID's for a given frequency axis sampling
00100   Vector<Int> matchFreq(const Vector<MFrequency>& chanFreq,
00101                         const Vector<MVFrequency>& chanWidth,
00102                         const Double& freqTol);
00103 
00104 private:
00105   // Disallow null constructor
00106   MSSpWindowIndex();
00107 
00108   // SPECTRAL_WINDOW subtable column accessor
00109   ROMSSpWindowColumns msSpWindowCols_p;
00110 
00111   // Vector cache of SpWindow id's
00112   Vector<Int> spWindowIds_p;
00113   Int nrows_p;
00114 };
00115 
00116 
00117 } //# NAMESPACE CASA - END
00118 
00119 #endif
00120