casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VisSetUtil.h
Go to the documentation of this file.
00001 //# VisSetUtil.h: Definitions for Stokes Image utilities
00002 //# Copyright (C) 1996,1997,1998
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 MSVIS_VISSETUTIL_H
00030 #define MSVIS_VISSETUTIL_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/BasicSL/Complex.h>
00034 #include <casa/Quanta/Quantum.h>
00035 #include <ms/MeasurementSets/MeasurementSet.h>
00036 #include <synthesis/MSVis/VisibilityIterator.h>
00037 
00038 namespace casa { //# NAMESPACE CASA - BEGIN
00039 
00040   class VisSet;
00041 
00042 // <summary> 
00043 // Utilities for operating on VisSets.
00044 // </summary>
00045 
00046 // <reviewed reviewer="" date="" tests="" demos="">
00047 
00048 // <prerequisite>
00049 // </prerequisite>
00050 //
00051 // <etymology>
00052 // </etymology>
00053 //
00054 // <synopsis> 
00055 // </synopsis> 
00056 //
00057 // <example>
00058 // <srcblock>
00059 // </srcblock>
00060 // </example>
00061 //
00062 // <motivation>
00063 // </motivation>
00064 //
00065 // <todo asof="">
00066 // </todo>
00067 
00068 
00069 class VisSetUtil {
00070   
00071 public:
00072   // Calculate sensitivity
00073   static void Sensitivity(VisSet &vs, Matrix<Double>& mssFreqSel,Matrix<Int>& mssChanSel,
00074                           Quantity& pointsourcesens, Double& relativesens,
00075                           Double& sumwt,
00076                           Vector<Vector<Int> >& nData,
00077                           Vector<Vector<Double> >& sumwtChan,
00078                           Vector<Vector<Double> >& sumwtsqChan,
00079                           Vector<Vector<Double> >& sumInverseVarianceChan);
00080   static void Sensitivity(ROVisibilityIterator &vi, 
00081                           Matrix<Double>& mssFreqSel,
00082                           Matrix<Int>& mssChanSel,
00083                           Quantity& pointsourcesens, 
00084                           Double& relativesens,
00085                           Double& sumwt,
00086                           Vector<Vector<Int> >& nData,
00087                           Vector<Vector<Double> >& sumwtChan,
00088                           Vector<Vector<Double> >& sumwtsqChan,
00089                           Vector<Vector<Double> >& sumInverseVarianceChan);
00090   // Hanning smoothing of spectral channels
00091   static void HanningSmooth(VisSet &vs, const String& dataCol="corrected", 
00092                             const Bool& doFlagAndWeight=True);
00093   static void HanningSmooth(VisibilityIterator &vi, const String& dataCol="corrected",
00094                             const Bool& doFlagAndWeight=True);
00095   // Subtract/add model from/to corrected visibility data
00096   static void UVSub(VisSet &vs, Bool reverse=False);
00097   static void UVSub(VisibilityIterator &vs, Bool reverse=False);
00098 
00099 
00100   // Add and (optionally) initialize scratch columns
00101   static void addScrCols(MeasurementSet& ms, Bool addModel, Bool addCorr, 
00102                          Bool init, Bool compress);
00103 
00104   // Initialize scr cols
00105   static void initScrCols(MeasurementSet& ms, Bool initModel, Bool initCorr);
00106   static void initScrCols(VisibilityIterator& ms, Bool initModel, Bool initCorr);
00107 
00108   // Remove OTF model keywords
00109   static void remOTFModel(MeasurementSet& ms);
00110 
00111   // Remove physical scrcols
00112   static void remScrCols(MeasurementSet& ms, Bool remModel, Bool remCorr);
00113 
00114    // Remove an existing cal set (a CORRECTED_DATA and MODEL_DATA 
00115   // column set and, optionally, any associated compression columns)
00116   //if removeModel=True...any model for OTF model vis saved in the header is removed
00117   static void removeCalSet(MeasurementSet& ms, Bool removeModel=False);
00118 
00119 };
00120 
00121 } //# NAMESPACE CASA - END
00122 
00123 #endif
00124 
00125