HetArrayConvFunc.h

Go to the documentation of this file.
00001 //# HetArrayConvFunc.h: Definition for HetArrayConvFunc
00002 //# Copyright (C) 2008
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 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  General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU  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 #ifndef SYNTHESIS_TRANSFORM2_HETARRAYCONVFUNC_H
00029 #define SYNTHESIS_TRANSFORM2_HETARRAYCONVFUNC_H
00030 
00031 #include <synthesis/TransformMachines2/SimplePBConvFunc.h>
00032 
00033 namespace casa{
00034 
00035   // <summary>  A class to support FTMachines get their convolution Function </summary>
00036   
00037   // <use visibility=export>
00038   // <prerequisite>
00039   //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
00040   // </prerequisite>
00041   // <etymology>
00042   // "HetArray" for Heterogeneous Array => different dish sizes
00043   // "ConvFunc" for Convolution Functions 
00044   //  appropriate convfunctions for each pair of antenna generated and cached
00045   // </etymology>
00046   //
00047   // <synopsis> 
00048   // FTMachines like WProjection and MosaicFT need convolution functions to 
00049   // deal with directional dependent issues...
00050   // this class and related ones provide and cache  such functions for re-use 
00051   //</synopsis>
00052   //Forward declarations
00053   template<class T> class ImageInterface;
00054   template<class T> class Matrix;
00055  namespace vi{class VisBuffer2;}
00056  namespace refim{
00057   
00058   class HetArrayConvFunc : public SimplePBConvFunc
00059 
00060   {
00061   public:
00062     HetArrayConvFunc();
00063     HetArrayConvFunc(const PBMathInterface::PBClass 
00064                      typeToUse, const String vpTable="");
00065     //Constructor from record
00066     //if for prediction only no need to recover fluxscale
00067     HetArrayConvFunc(const RecordInterface& rec, Bool calcFluxscale);
00068     virtual ~HetArrayConvFunc();
00069 
00070     //Returns the convfunctions in the Arrays...the rowMap maps the vb.row 
00071     //to the  plane of the convfunc appropriate...chanMap and polMap similarly 
00072 
00073     virtual void findConvFunction(const ImageInterface<Complex>& iimage, 
00074                                   const vi::VisBuffer2& vb,
00075                                     const Int& convSampling,
00076                                   const Vector<Double>& visFreq,
00077                                     Array<Complex>& convFunc,
00078                                     Array<Complex>& weightConvFunc,
00079                                     Vector<Int>& convsize,
00080                                     Vector<Int>& convSupport,
00081                                     Vector<Int>& polMap, Vector<Int>& chanMap, Vector<Int>& rowMap);
00082 
00083     virtual ImageInterface<Float>&  getFluxScaleImage();
00084     // slice flux scale images 
00085     virtual void sliceFluxScale(const Int npol);
00086     //Serialization
00087    virtual Bool toRecord(RecordInterface& rec);
00088    virtual Bool fromRecord(String& err, const RecordInterface& rec, Bool calcFluxscale=False);
00089    virtual void reset();
00090 
00091     //----------------------------------------------
00092 
00093     private:
00094    void applyGradientToYLine(const Int iy, Complex*& convFunctions, 
00095                              Complex*& convWeights, const Double pixXdir, const Double pixYdir, 
00096                              Int convSize, const Int ndishpair, const Int nchan, const Int nPol);
00097       Int factorial(Int n);
00098       // the return value are -1 or False for not in cache yet but pointing direction 
00099       //seems to be inside image
00100       // 1 if value is cached..we have stopped caching..so it should not return this value
00101       // 2 pointing is off image ...thus valid but not useful
00102       Int checkPBOfField(const vi::VisBuffer2& vb, Vector<Int>& rowMap);
00103       void findAntennaSizes(const vi::VisBuffer2& vb);
00104       void supportAndNormalize(Int plane, Int convSampling);
00105       void supportAndNormalizeLatt(Int plane, Int convSampling, TempLattice<Complex>& convFuncLat,
00106                                    TempLattice<Complex>& weightConvFuncLat);
00107       void init(const PBMathInterface::PBClass typeToUse);
00108       void makerowmap(const vi::VisBuffer2& vb, Vector<Int>& rowMap);
00109       PBMathInterface::PBClass pbClass_p;
00110       //SimpleOrderedMap <String, Int> convFunctionMap_p;
00111       Vector<Int64> convFunctionMap_p;
00112       Int64 nDefined_p;
00113       SimpleOrderedMap <String, Int> antDiam2IndexMap_p;
00114       Vector<Int> antIndexToDiamIndex_p;
00115       Block<CountedPtr<PBMathInterface> > antMath_p;
00116       Int msId_p;
00117       Int actualConvIndex_p;
00118       Array<Complex> convFunc_p;
00119       Array<Complex> weightConvFunc_p;
00120       Array<Complex> convSave_p;
00121       Array<Complex> weightSave_p;
00122       Int convSize_p; 
00123       String vpTable_p;
00124       Vector<Int> convSupport_p;
00125       Block <CountedPtr<Array<Complex> > > convFunctions_p;
00126       Block <CountedPtr<Array<Complex> > > convWeights_p;
00127       Block<CountedPtr<Vector<Int> > > convSizes_p;
00128       Block <CountedPtr<Vector<Int> > > convSupportBlock_p;
00129 
00130     };
00131 }; // end of namespace casa
00132 }; //end of namespace refim
00133 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1