ComponentFTMachine.h

Go to the documentation of this file.
00001 //# ComponentFTMachine.h: Definition for ComponentFTMachine
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001
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_TRANSFORM2_COMPONENTFTMACHINE_H
00030 #define SYNTHESIS_TRANSFORM2_COMPONENTFTMACHINE_H
00031 
00032 #include <components/ComponentModels/SkyComponent.h>
00033 #include <measures/Measures/MDirection.h>
00034 #include <measures/Measures/MPosition.h>
00035 #include <casa/Arrays/Array.h>
00036 #include <casa/Arrays/Vector.h>
00037 #include <casa/Arrays/Matrix.h>
00038 #include <casa/Logging/LogIO.h>
00039 #include <casa/Logging/LogSink.h>
00040 #include <casa/Logging/LogMessage.h>
00041 
00042 namespace casa { //# NAMESPACE CASA - BEGIN
00043 
00044 // Forward declarations
00045 class ComponentList;
00046 namespace vi{class VisBuffer2;}
00047 
00048 namespace refim{ // refactor namespace
00049 
00050 
00051 // <summary> 
00052 // ComponentFTMachine: a abstract base class defining the interface
00053 // for a Fourier Transform Machine to be used in the 
00054 // <linkto class=SkyEquation>SkyEquation</linkto> for the
00055 // transformation of SkyComponents
00056 // </summary>
00057 
00058 // <use visibility=export>
00059 
00060 // <reviewed reviewer="" date="" tests="" demos="">
00061 
00062 // <prerequisite>
00063 //   <li> <linkto class=SkyModel>SkyModel</linkto> module
00064 //   <li> <linkto class=SkyEquation>SkyEquation</linkto> module
00065 //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
00066 //   <li> <linkto class=SkyComponent>SkyComponent</linkto> class
00067 // </prerequisite>
00068 //
00069 // <etymology>
00070 // FTMachine is a Machine for Fourier Transforms
00071 // </etymology>
00072 //
00073 // <synopsis> 
00074 // The <linkto class=SkyEquation>SkyEquation</linkto> needs to be able
00075 // to perform Fourier transforms on visibility data. FTMachine
00076 // allows efficient Fourier Transform processing using a 
00077 // <linkto class=VisBuffer>VisBuffer</linkto> which encapsulates
00078 // a chunk of visibility (typically all baselines for one time)
00079 // together with all the information needed for processing
00080 // (e.g. UVW coordinates).
00081 // </synopsis> 
00082 //
00083 // <example>
00084 // A simple example of an ComponentFTMachine is found in 
00085 // <linkto class=GridFT>SimpleComponentFTMachine</linkto>.
00086 // See the example for <linkto class=SkyModel>SkyModel</linkto>.
00087 // </example>
00088 //
00089 // <motivation>
00090 // Define an interface to allow efficient processing of chunks of 
00091 // visibility data
00092 //
00093 // </motivation>
00094 //
00095 // <todo asof="98/01/25">
00096 // </li> SmearedComponentFTMachine to take into account
00097 // time and bandwidth smearing
00098 // </todo>
00099 
00100 
00101 
00102 
00103 class ComponentFTMachine {
00104 public:
00105 
00106   ComponentFTMachine();
00107 
00108   ComponentFTMachine(const ComponentFTMachine& other);
00109 
00110   ComponentFTMachine& operator=(const ComponentFTMachine& other);
00111 
00112   virtual ~ComponentFTMachine();
00113 
00114   // Get actual coherence : this is the only virtual method
00115   virtual void get(vi::VisBuffer2& vb, SkyComponent& component, Int row=-1) = 0;
00116   // Get actual coherence : this is the other only virtual method
00117   virtual void get(vi::VisBuffer2& vb, const ComponentList& componentList, Int row=-1) = 0;
00118 
00119   // Rotate the uvw from the observed phase center to the
00120   // desired phase center.
00121   void rotateUVW(Matrix<Double>& uvw, Vector<Double>& dphase,
00122                  const vi::VisBuffer2& vb, const MDirection& mDesired);
00123   // A version that use pointers to contigous matrix and vector 
00124   void rotateUVW(Double*& uvw, Double*& dphase, const Int nrows,
00125                  const vi::VisBuffer2& vb, const MDirection& mDesired);
00126   // Set number of threads to use when predicting. Setting it to -1 
00127   // basically tell openmp to use the number it can get
00128   void setnumthreads(const Int numthreads);
00129 protected:
00130 
00131   LogIO logIO_p;
00132 
00133   LogIO& logIO();
00134 
00135   // Default Position used for phase rotations
00136   MPosition mLocation_p;
00137   
00138   virtual void ok();
00139   Int numthreads_p;
00140 
00141 };
00142 
00143 } // end namespace refim
00144 } //# NAMESPACE CASA - END
00145 
00146 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1