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