casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalInterpolation.h
Go to the documentation of this file.
00001 //# CalInterpolation.h: A class to hold calibration interpolation parameters
00002 //# Copyright (C) 1996,1997,1998,1999,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 adressed 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 CALIBRATION_CALINTERPOLATION_H
00030 #define CALIBRATION_CALINTERPOLATION_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/Arrays/Vector.h>
00034 #include <casa/Quanta/Quantum.h>
00035 #include <synthesis/MSVis/MSCalEnums.h>
00036 #include <ms/MeasurementSets/MSSelection.h>
00037 
00038 namespace casa { //# NAMESPACE CASA - BEGIN
00039 
00040 // <summary> 
00041 // CalInterpolation: a class to hold calibration interpolation parameters
00042 // </summary>
00043 
00044 // <use visibility=export>
00045 
00046 // <reviewed reviewer="" date="" tests="" demos="">
00047 
00048 // <prerequisite>
00049 //   <li> <linkto class="MSCalEnums">MSCalEnums</linkto> module
00050 //   <li> <linkto class="CalBuffer">CalBuffer</linkto> module
00051 //   <li> <linkto class="MSSelection">MSSelection</linkto> module
00052 // </prerequisite>
00053 //
00054 // <etymology>
00055 // From "calibration" and "interpolation".
00056 // </etymology>
00057 //
00058 // <synopsis>
00059 // The CalInterpolation class holds calibration interpolation parameters 
00060 // which define how calibration is to be applied. Specializations for 
00061 // parametrized Jones matrices, which required sampling before 
00062 // interpolation, are provided through inheritance.
00063 // </etymology>
00064 //
00065 // <example>
00066 // <srcblock>
00067 // </srcblock>
00068 // </example>
00069 //
00070 // <motivation>
00071 // This class is used by the calibration interpolater classes.
00072 // </motivation>
00073 //
00074 // <todo asof="2001/08/25">
00075 // (i)
00076 // </todo>
00077 
00078 class CalInterpolation
00079 {
00080  public:
00081   // Basic interpolation type
00082   enum Type {
00083     // Linear two-point
00084     LINEAR = 0,
00085 
00086     // Nearest calibration solution only
00087     NEAREST_NEIGHBOUR = 1,
00088 
00089     // Fit a polynomial and interpolate
00090     POLYNOMIAL = 2,
00091 
00092     // Use natural cubic splines to interpolate
00093     SPLINE = 3
00094   };
00095 
00096   // Interpolation weighting type
00097   enum Weighting {
00098     // Weight by the calibration solution weight
00099     WEIGHTED = 1,
00100 
00101     // Use unit weighting for all points 
00102     UNWEIGHTED = 0
00103   };
00104 
00105   // Default null constructor, and destructor
00106   CalInterpolation();
00107   virtual ~CalInterpolation();
00108 
00109   // Copy constructor and assignment operator
00110   CalInterpolation (const CalInterpolation& other);
00111   virtual CalInterpolation& operator= (const CalInterpolation& other);
00112 
00113   // Set interpolation axes
00114   virtual void setAxes (const Vector<Int>& axes) {axes_p = axes;}
00115 
00116   // Set interpolation type
00117   virtual void setType (const Type& type) {type_p = type;};
00118 
00119   // Set interpolation weighting
00120   virtual void setWeighting (const Weighting& weighting) 
00121     {weighting_p = weighting;};
00122 
00123   // Set interpolation window (per axis)
00124   virtual void setWindows (const Vector<Quantity>& windows) 
00125     {windows_p = windows;};
00126 
00127   // Set polynomial order
00128   virtual void setNpoly (const Int& npoly) {npoly_p = npoly;};
00129 
00130   // Set interpolation index mapping
00131   virtual void setIndexMap (const Vector<MSSelection>& msIndex,
00132                             const Vector<MSSelection>& calIndex)
00133     {msIndex_p = msIndex; calIndex_p = calIndex;};   
00134 
00135   // Get number and type of interpolation axes
00136   virtual Vector<Int> axes() {return axes_p;};
00137   virtual Int nAxes() {return axes_p.nelements();};
00138 
00139   // Get interpolation type
00140   virtual Type type() {return type_p;};
00141 
00142   // Get interpolation weighting type
00143   virtual Weighting weighting() {return weighting_p;};
00144 
00145   // Get interpolation windows for each axis
00146   virtual Vector<Quantity> windows() {return windows_p;};
00147 
00148   // Get polynomial order
00149   virtual Int nPoly() {return npoly_p;};
00150 
00151   // Get interpolation index mapping
00152   virtual Vector<MSSelection> msIndex() {return msIndex_p;};
00153   virtual Vector<MSSelection> calIndex() {return calIndex_p;};
00154 
00155  protected:
00156 
00157  private:
00158   // Interpolation axes
00159   Vector<Int> axes_p;
00160 
00161   // Interpolation type
00162   Type type_p;
00163 
00164   // Interpolation weighting type
00165   Weighting weighting_p;
00166 
00167   // Interpolation windows
00168   Vector<Quantity> windows_p;
00169 
00170   // Polynomial order
00171   Int npoly_p;
00172 
00173   // Interpolation index mapping
00174   Vector<MSSelection> msIndex_p, calIndex_p;
00175  };
00176 
00177 
00178 } //# NAMESPACE CASA - END
00179 
00180 #endif
00181