casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SetJyGridFT.h
Go to the documentation of this file.
00001 //# SetJyGridFT.h: Definition for GridFT
00002 //# Copyright (C) 2012
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 SYNTHESIS_SETJYGRIDFT_H
00030 #define SYNTHESIS_SETJYGRIDFT_H
00031 
00032 #include <synthesis/TransformMachines/GridFT.h>
00033 
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary>  An FTMachine for Gridded Fourier transforms specializing in setjy frequency scaling </summary>
00038 
00039 // <use visibility=export>
00040 
00041 // <reviewed reviewer="" date="" tests="" demos="">
00042 
00043 // <prerequisite>
00044 //   <li> <linkto class=FTMachine>GridFT</linkto> module
00045 //   <li> <linkto class=SkyEquation>SkyEquation</linkto> module
00046 //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
00047 // </prerequisite>
00048 //
00049 // <etymology>
00050 // Inheriting from GridFT which does
00051 // Grid-based Fourier transforms.
00052 // special case for setjy style frequency scaling
00053 // </etymology>
00054 //
00055 // <synopsis> 
00056 
00057 // </synopsis> 
00058 //
00059 // <example>
00060 // </example>
00061 //
00062 // <motivation>
00063 // Define an interface to allow efficient processing of chunks of 
00064 // visibility data
00065 // </motivation>
00066 //
00067 // <todo asof="2012/05/08">
00068 //
00069 // </todo>
00070 
00071 class SetJyGridFT : public GridFT {
00072 public:
00073 
00074   // Constructor: cachesize is the size of the cache in words
00075   // (e.g. a few million is a good number), tilesize is the
00076   // size of the tile used in gridding (cannot be less than
00077   // 12, 16 works in most cases), and convType is the type of
00078   // gridding used (SF is prolate spheriodal wavefunction,
00079   // and BOX is plain box-car summation). mLocation is
00080   // the position to be used in some phase rotations. If
00081   // mTangent is specified then the uvw rotation is done for
00082   // that location iso the image center.
00083   // <group>
00084 
00085   SetJyGridFT(Long cachesize, Int tilesize, String convType,
00086          MPosition mLocation, MDirection mTangent, Float passing=1.0,
00087          Bool usezero=True, Bool useDoublePrec=False,
00088               const Vector<Double>& freqscale=Vector<Double>(1, 0.0), const Vector<Double>& scale=Vector<Double>(1, 1.0));
00089   // </group>
00090 
00091   // Construct from a Record containing the GridFT state
00092   SetJyGridFT(const RecordInterface& stateRec);
00093 
00094   // Copy constructor
00095   SetJyGridFT(const SetJyGridFT &other);
00096 
00097   // Assignment operator
00098   SetJyGridFT &operator=(const SetJyGridFT &other);
00099 
00100   virtual ~SetJyGridFT();
00101 
00102   // Initialize transform to Visibility plane using the image
00103   // as a template. The image is loaded and Fourier transformed.
00104   virtual void initializeToVis(ImageInterface<Complex>& image,
00105                        const VisBuffer& vb);
00106   
00107   // Finalize transform to Visibility plane: flushes the image
00108   // cache and shows statistics if it is being used.
00109   //void finalizeToVis();
00110 
00111   // Get actual coherence from grid by degridding
00112   void get(VisBuffer& vb, Int row=-1);
00113 
00114   
00115   // Save and restore the GridFT to and from a record
00116   virtual Bool toRecord(String& error, RecordInterface& outRec, 
00117                         Bool withImage=False);
00118   virtual Bool fromRecord(String& error, const RecordInterface& inRec);
00119 
00120   virtual void setScale(const Vector<Double>& freq, const Vector<Double>& scale);
00121 
00122   virtual String name() const;
00123 
00124 
00125 protected:
00126 
00127 
00128 
00129 
00130   //Prepare the grid for degridding
00131   //void prepGridForDegrid();
00132 
00133   Vector<Double> freqscale_p;
00134   Vector<Double> scale_p;
00135   Vector<Double> interpscale_p;
00136 
00137 
00138 
00139 };
00140 
00141 } //# NAMESPACE CASA - END
00142 
00143 #endif