casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VisBufferUtil.h
Go to the documentation of this file.
00001 //# VisBufferUtil.h: Definitions for VisBuffer utilities
00002 //# Copyright (C) 1996,1997
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_VISBUFFERUTIL_H
00030 #define MSVIS_VISBUFFERUTIL_H
00031 
00032 #include <casa/aips.h>
00033 #include <synthesis/MSVis/VisBuffer.h>
00034 #include <measures/Measures/MDirection.h>
00035 #include <measures/Measures/MPosition.h>
00036 #include <measures/Measures/MFrequency.h>
00037 #include <ms/MeasurementSets/MeasurementSet.h>
00038 #include <scimath/Mathematics/InterpolateArray1D.h>
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 //forward 
00041 class VisBuffer;
00042 // <summary> 
00043 // </summary>
00044 
00045 // <reviewed reviewer="" date="" tests="" demos="">
00046 
00047 // <prerequisite>
00048 // </prerequisite>
00049 //
00050 // <etymology>
00051 // </etymology>
00052 //
00053 // <synopsis> 
00054 // </synopsis> 
00055 //
00056 // <example>
00057 // <srcblock>
00058 // </srcblock>
00059 // </example>
00060 //
00061 // <motivation>
00062 // </motivation>
00063 //
00064 // <todo asof="">
00065 // </todo>
00066 class VisBufferUtil{
00067 
00068 public:
00069 
00070   //Empty Constructor
00071   VisBufferUtil();
00072 
00073   // Construct from a VisBuffer (sets a MeasFrame)
00074   VisBufferUtil(const VisBuffer& vb);
00075 
00076   // Make PSF VisBuffer
00077   void makePSFVisBuffer(VisBuffer& vb);
00078   
00079 
00080   //Regrid the data on a new frequency grid (defined by outFreqGrid) , on the frequency 
00081   //frame (defined by freqFrame). It will pass back the interpolated data and flags 
00082  
00083   Bool interpolateFrequency(Cube<Complex>& data, 
00084                             Cube<Bool>& flags, 
00085                             const VisBuffer& vb,
00086                             const Vector<Float>& outFreqGrid, const MS::PredefinedColumns whichCol=MS::DATA,
00087                             const MFrequency::Types freqFrame=MFrequency::LSRK,
00088                             const InterpolateArray1D< Float, Complex>::InterpolationMethod interp = 
00089                             (InterpolateArray1D<Float,Complex>::nearestNeighbour));
00090 
00091   // Converts the frequency in this visbuffer to the frame requested
00092   void convertFrequency(Vector<Double>& outFreq, 
00093                         const VisBuffer& vb, 
00094                         const MFrequency::Types freqFrame);
00095 
00096   // Converts the frequency in this VisBuffer to velocity in the frame/def requested
00097   void toVelocity(Vector<Double>& outVel, 
00098                   const VisBuffer& vb, 
00099                   const MFrequency::Types freqFrame,
00100                   const MVFrequency restFreq,
00101                   const MDoppler::Types veldef);
00102 
00103  private:
00104   void swapyz(Cube<Bool>& out, const Cube<Bool>& in);
00105   void swapyz(Cube<Complex>& out, const Cube<Complex>& in);
00106 
00107   // A MeasFrame for conversions
00108   MeasFrame mframe_;
00109   
00110 
00111 };
00112 
00113 } //# NAMESPACE CASA - END
00114 
00115 #endif
00116