casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
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 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 #ifndef SYNTHESIS_HETARRAYCONVFUNC_H
00029 #define SYNTHESIS_HETARRAYCONVFUNC_H
00030 
00031 #include <synthesis/TransformMachines/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   class VisBuffer;
00056   class MosaicFT;
00057   class HetArrayConvFunc : public SimplePBConvFunc
00058 
00059   {
00060   public:
00061     HetArrayConvFunc();
00062     HetArrayConvFunc(const PBMathInterface::PBClass 
00063                      typeToUse);
00064     //Constructor from record
00065     //if for prediction only no need to recover fluxscale
00066     HetArrayConvFunc(const RecordInterface& rec, Bool calcFluxscale);
00067     virtual ~HetArrayConvFunc();
00068 
00069     //Returns the convfunctions in the Cubes...the rowMap maps the vb.row 
00070     //to the  plane of the convfunc appropriate 
00071 
00072     virtual void findConvFunction(const ImageInterface<Complex>& iimage, 
00073                                   const VisBuffer& vb,
00074                                   const Int& convSampling,
00075                                   Cube<Complex>& convFunc, 
00076                                   Cube<Complex>& weightConvFunc, 
00077                                   Vector<Int>& convsize,
00078                                   Vector<Int>& convSupport,
00079                                   Vector<Int>& rowMap);
00080 
00081     virtual ImageInterface<Float>&  getFluxScaleImage();
00082     // slice flux scale images 
00083     virtual void sliceFluxScale(const Int npol);
00084     //Serialization
00085    virtual Bool toRecord(RecordInterface& rec);
00086    virtual Bool fromRecord(String& err, const RecordInterface& rec, Bool calcFluxscale=False);
00087    virtual void reset();
00088 
00089     //----------------------------------------------
00090 
00091     private:
00092       
00093       Int factorial(Int n);
00094       // the return value are -1 or False for not in cache yet but pointing direction 
00095       //seems to be inside image
00096       // 1 if value is cached
00097       // 2 pointing is off image ...thus valid but not useful
00098       Int checkPBOfField(const VisBuffer& vb, Vector<Int>& rowMap);
00099       void findAntennaSizes(const VisBuffer& vb);
00100       void supportAndNormalize(Int plane, Int convSampling);
00101       void init(const PBMathInterface::PBClass typeToUse);
00102       void makerowmap(const VisBuffer& vb, Vector<Int>& rowMap);
00103       PBMathInterface::PBClass pbClass_p;
00104       //SimpleOrderedMap <String, Int> convFunctionMap_p;
00105       Vector<Int64> convFunctionMap_p;
00106       Int64 nDefined_p;
00107       SimpleOrderedMap <Double, Int> antDiam2IndexMap_p;
00108       Vector<Int> antIndexToDiamIndex_p;
00109       Block<CountedPtr<PBMathInterface> > antMath_p;
00110       Int msId_p;
00111       Int actualConvIndex_p;
00112       Cube<Complex> convFunc_p;
00113       Cube<Complex> weightConvFunc_p;
00114       Cube<Complex> convSave_p;
00115       Cube<Complex> weightSave_p;
00116       Int convSize_p; 
00117       Vector<Int> convSupport_p;
00118       Block <CountedPtr<Cube<Complex> > > convFunctions_p;
00119       Block <CountedPtr<Cube<Complex> > > convWeights_p;
00120       Block<CountedPtr<Vector<Int> > > convSizes_p;
00121       Block <CountedPtr<Vector<Int> > > convSupportBlock_p;
00122 
00123     };
00124 }; // end of namespace casa
00125 
00126 #endif