casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MSPolIndex.h
Go to the documentation of this file.
00001 //# MSPolIndex: index or lookup in an MS POLARIZATION 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: MSPolIndex.h 20739 2009-09-29 01:15:15Z Malte.Marquarding $
00028 
00029 #ifndef MS_MSPOLINDEX_H
00030 #define MS_MSPOLINDEX_H
00031 
00032 //# includes
00033 #include <casa/aips.h>
00034 #include <ms/MeasurementSets/MSPolarization.h>
00035 #include <ms/MeasurementSets/MSPolColumns.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 POLARIZATION 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> MSPolarization
00056 // </prerequisite>
00057 //
00058 // <etymology>
00059 // From "MeasurementSet", "POLARIZATION subtable" and "index".
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // This class provides lookup and indexing into an MS POLARIZATION
00064 // subtable. These services include returning rows numbers
00065 // (which for the POLARIZATION subtable are POLARIZATION_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 // POLARIZATION subtable, for encapsulation and efficiency.
00075 // </motivation>
00076 //
00077 // <thrown>
00078 //    <li>
00079 //    <li>
00080 // </thrown>
00081 //
00082 
00083 class MSPolarizationIndex 
00084 {
00085 public:
00086   // Construct from an MS POLARIZATION subtable
00087   MSPolarizationIndex(const MSPolarization& polarizationTable);
00088 
00089   // Null destructor
00090   virtual ~MSPolarizationIndex() {};
00091 
00092   // Look up POLARIZATION_ID's for a given set of polarization correlation
00093   // types and receptor cross-products
00094   Vector<Int> matchCorrTypeAndProduct(const Vector<Int>& corrType,
00095                                       const Matrix<Int>& corrProduct);
00096   // ///////////////////  Add for MS selection //////////////////////////////
00097   // Only Look up POLARIZATION_ID's for a given set of polarization correlation
00098   // types
00099   Vector<Int> matchCorrType(const Vector<Int>& corrType,Bool exactMatch=True);
00100 
00101 private:
00102   // Disallow null constructor
00103   MSPolarizationIndex();
00104 
00105   // POLARIZATION subtable column accessor
00106   ROMSPolarizationColumns msPolarizationCols_p;
00107 
00108   // Vector cache of polarization id's
00109   Vector<Int> polarizationIds_p;
00110   Int nrows_p;
00111 };
00112 
00113 
00114 } //# NAMESPACE CASA - END
00115 
00116 #endif
00117