casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSObsIndex.h
Go to the documentation of this file.
00001 //# MSObsIndex: index or lookup in an MS OBSERVATION 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: MSObsIndex.h 18093 2004-11-30 17:51:10Z ddebonis $
00028 
00029 #ifndef MS_MSOBSINDEX_H
00030 #define MS_MSOBSINDEX_H
00031 
00032 //# includes
00033 #include <casa/aips.h>
00034 #include <ms/MeasurementSets/MSObservation.h>
00035 #include <ms/MeasurementSets/MSObsColumns.h>
00036 #include <casa/Arrays/Vector.h>
00037 #include <casa/Arrays/Matrix.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 an MS OBSERVATION 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> MSObservation
00056 // </prerequisite>
00057 //
00058 // <etymology>
00059 // From "MeasurementSet", "OBSERVATION subtable" and "index".
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // This class provides lookup and indexing into an MS OBSERVATION
00064 // subtable. These services include returning rows numbers (which 
00065 // for the OBSERVATION subtable are OBSERVATION_ID's) associated 
00066 // 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 // OBSERVATION subtable, for encapsulation and efficiency.
00075 // </motivation>
00076 //
00077 // <thrown>
00078 //    <li>
00079 //    <li>
00080 // </thrown>
00081 //
00082 
00083 class MSObservationIndex 
00084 {
00085 public:
00086   // Construct from an MS OBSERVATION subtable
00087   MSObservationIndex(const MSObservation& observationTable);
00088 
00089   // Null destructor
00090   virtual ~MSObservationIndex() {};
00091 
00092   // Look up OBSERVATION_ID's for a given project code
00093   Vector<Int> matchProjectCode(const String& projectCode);
00094 
00095 private:
00096   // Disallow null constructor
00097   MSObservationIndex();
00098 
00099   // OBSERVATION subtable column accessor
00100   ROMSObservationColumns msObservationCols_p;
00101 
00102   // Vector cache of observation id's
00103   Vector<Int> observationIds_p;
00104   Int nrows_p;
00105 };
00106 
00107 
00108 } //# NAMESPACE CASA - END
00109 
00110 #endif
00111