LCOV - code coverage report
Current view: top level - synthesis/TransformMachines2 - AWConvFunc.h (source / functions) Hit Total Coverage
Test: ctest_coverage.info Lines: 5 10 50.0 %
Date: 2023-11-06 10:06:49 Functions: 5 8 62.5 %

          Line data    Source code
       1             : // -*- C++ -*-
       2             : //# AWConvFunc.h: Definition of the AWConvFunc class
       3             : //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
       4             : //# Associated Universities, Inc. Washington DC, USA.
       5             : //#
       6             : //# This library is free software; you can redistribute it and/or modify it
       7             : //# under the terms of the GNU Library General Public License as published by
       8             : //# the Free Software Foundation; either version 2 of the License, or (at your
       9             : //# option) any later version.
      10             : //#
      11             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      12             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      13             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      14             : //# License for more details.
      15             : //#
      16             : //# You should have received a copy of the GNU Library General Public License
      17             : //# along with this library; if not, write to the Free Software Foundation,
      18             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      19             : //#
      20             : //# Correspondence concerning AIPS++ should be addressed as follows:
      21             : //#        Internet email: aips2-request@nrao.edu.
      22             : //#        Postal address: AIPS++ Project Office
      23             : //#                        National Radio Astronomy Observatory
      24             : //#                        520 Edgemont Road
      25             : //#                        Charlottesville, VA 22903-2475 USA
      26             : //#
      27             : //# $Id$
      28             : //
      29             : #ifndef SYNTHESIS_TRANSFORM2_AWCONVFUNC_H
      30             : #define SYNTHESIS_TRANSFORM2_AWCONVFUNC_H
      31             : 
      32             : #include <synthesis/TransformMachines2/ConvolutionFunction.h>
      33             : #include <synthesis/TransformMachines2/PolOuterProduct.h>
      34             : #include <casacore/coordinates/Coordinates/DirectionCoordinate.h>
      35             : #include <synthesis/TransformMachines2/CFStore.h>
      36             : #include <synthesis/TransformMachines2/CFStore2.h>
      37             : #include <synthesis/TransformMachines2/CFBuffer.h>
      38             : #include <synthesis/TransformMachines2/VB2CFBMap.h>
      39             : #include <synthesis/TransformMachines2/PSTerm.h>
      40             : #include <synthesis/TransformMachines2/WTerm.h>
      41             : #include <synthesis/TransformMachines2/ATerm.h>
      42             : #include <casacore/images/Images/ImageInterface.h>
      43             : #include <casacore/images/Images/TempImage.h>
      44             : #include <casacore/casa/Logging/LogIO.h>
      45             : #include <casacore/casa/Logging/LogSink.h>
      46             : #include <casacore/casa/Logging/LogOrigin.h>
      47             : #include <casacore/casa/Arrays/ArrayFwd.h>
      48             : #include <msvis/MSVis/VisBuffer2.h>
      49             : namespace casacore{
      50             : 
      51             :   template<class T> class ImageInterface;
      52             : 
      53             : }
      54             : 
      55             : namespace casa { //# NAMESPACE CASA - BEGIN
      56             :   using namespace vi;
      57             :   //  class VisBuffer2;
      58             :   //
      59             :   //-------------------------------------------------------------------------------------------
      60             :   //
      61             :   namespace refim{
      62             :   class AWConvFunc : public ConvolutionFunction
      63             :   {
      64             :   public:
      65             :     AWConvFunc(const casacore::CountedPtr<ATerm> ATerm,
      66             :                const casacore::CountedPtr<PSTerm> psTerm,
      67             :                const casacore::CountedPtr<WTerm> wTerm,
      68             :                const casacore::Bool wbAWP=false,
      69             :                const casacore::Bool conjPB=casacore::True);
      70             : 
      71         244 :     ~AWConvFunc() {};
      72             :     AWConvFunc& operator=(const AWConvFunc& other);
      73             :     virtual void makeConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
      74             :                                   const VisBuffer2& vb,
      75             :                                   const casacore::Int wConvSize,
      76             :                                   const casacore::CountedPtr<PolOuterProduct>& pop,
      77             :                                   const casacore::Float pa,
      78             :                                   const casacore::Float dpa,
      79             :                                   const casacore::Vector<casacore::Double>& uvScale, const casacore::Vector<casacore::Double>& uvOffset,
      80             :                                   const casacore::Matrix<casacore::Double>& vbFreqSelection,
      81             :                                   CFStore2& cfs,
      82             :                                   CFStore2& cfwts,
      83             :                                   casacore::Bool fillCF=true);
      84             :     virtual void fillConvFuncBuffer(CFBuffer& cfb, CFBuffer& cfWtb,
      85             :                                     const casacore::Int& skyNX, const casacore::Int& skyNY,
      86             :                                     const casacore::Vector<casacore::Double>& skyIncr,
      87             :                                     const casacore::Int& nx, const casacore::Int& ny,
      88             :                                     const casacore::Vector<casacore::Double>& freqValues,
      89             :                                     const casacore::Vector<casacore::Double>& wValues,
      90             :                                     const casacore::Double& wScale,
      91             :                                     const casacore::Double& vbPA, const casacore::Double& freqHi,
      92             :                                     const PolMapType& muellerElements,
      93             :                                     const PolMapType& muellerElementsIndex,
      94             :                                     const VisBuffer2& vb, const casacore::Float& psScale,
      95             :                                     PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm, 
      96             :                                     casacore::Bool isDryRun=false);
      97             :     static void makeConvFunction2(const casacore::String& uvGridDiskimage,
      98             :                                   const casacore::Vector<casacore::Double>& uvScale, const casacore::Vector<casacore::Double>& uvOffset,
      99             :                                   const casacore::Matrix<casacore::Double>& vbFreqSelection,
     100             :                                   CFStore2& cfs,
     101             :                                   CFStore2& cfwts,
     102             :                                   const casacore::Bool psTermOn,
     103             :                                   const casacore::Bool aTermOn,
     104             :                                   const casacore::Bool conjBeams);
     105             :     static void fillConvFuncBuffer2(CFBuffer& cfb, CFBuffer& cfWtb,
     106             :                                     const casacore::Int& nx, const casacore::Int& ny,
     107             :                                     const casacore::ImageInterface<casacore::Complex>& skyImage,
     108             :                                     const CFCStruct& miscInfo,
     109             :                                     PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm,
     110             :                                     casacore::Bool conjBeams);
     111             : 
     112             :     virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb, 
     113             :                                      const casacore::ImageInterface<casacore::Complex>& image,
     114             :                                      casacore::ImageInterface<casacore::Float>& theavgPB,
     115             :                                      casacore::Bool reset=true);
     116             :     virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb, 
     117             :                                      const casacore::ImageInterface<casacore::Complex>& image,
     118             :                                      casacore::ImageInterface<casacore::Complex>& theavgPB,
     119             :                                      casacore::Bool reset=true);
     120           0 :     virtual int getVisParams(const VisBuffer2& vb,const casacore::CoordinateSystem& skyCoord=casacore::CoordinateSystem())
     121           0 :     {return aTerm_p->getVisParams(vb,skyCoord);};
     122          13 :     virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) {aTerm_p->setPolMap(polMap);};
     123             :     //    virtual void setFeedStokes(const casacore::Vector<casacore::Int>& feedStokes) {aTerm_p->setFeedStokes(feedStokes);};
     124             :     virtual casacore::Bool findSupport(casacore::Array<casacore::Complex>& func, casacore::Float& threshold,casacore::Int& origin, casacore::Int& R);
     125           0 :     virtual casacore::Vector<casacore::Double> findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /*image*/,
     126           0 :                                               const VisBuffer2& /*vb*/) {casacore::Vector<casacore::Double> tt(2); tt=0;return tt;};
     127             :     //virtual void prepareConvFunction(const VisBuffer2& vb, VBRow2CFBMapType& cfs);
     128             :     virtual void prepareConvFunction(const VisBuffer2& vb, VB2CFBMap& cfs);
     129           0 :     casacore::Int mapAntIDToAntType(const casacore::Int& ant) {return aTerm_p->mapAntIDToAntType(ant);};
     130             : 
     131             :     virtual casacore::Vector<casacore::Double> makeFreqValList(casacore::Double& freqScale,
     132             :                                                                const VisBuffer2& vb, 
     133             :                                                                const casacore::ImageInterface<casacore::Complex>& uvGrid,
     134             :                                                                casacore::Vector<casacore::String>& bandNames);
     135             :     virtual casacore::Vector<casacore::Double> makeWValList(const casacore::Double &dW, const casacore::Int &nW);
     136             : 
     137             :     virtual void setMiscInfo(const casacore::RecordInterface& params);
     138             :     virtual casacore::Matrix<casacore::Double> getFreqRangePerSpw(const VisBuffer2& vb);
     139             : 
     140             : 
     141             : 
     142             :     //
     143             :     // Global methods (services)
     144             :     //
     145             :     static void makeConjPolAxis(casacore::CoordinateSystem& cs, casacore::Int conjStokes_in=-1);
     146             :     static casacore::Complex cfArea(casacore::Matrix<casacore::Complex>& cf, const casacore::Int& xSupport, const casacore::Int& ySupport, const casacore::Float& sampling);
     147             :     static casacore::Bool awFindSupport(casacore::Array<casacore::Complex>& func, casacore::Float& threshold, casacore::Int& origin, casacore::Int& radius);
     148             :     static casacore::Bool setUpCFSupport(casacore::Array<casacore::Complex>& func, casacore::Int& xSupport, casacore::Int& ySupport,
     149             :                                const casacore::Float& sampling, const casacore::Complex& peak);
     150             :     static casacore::Bool resizeCF(casacore::Array<casacore::Complex>& func,  casacore::Int& xSupport, casacore::Int& ySupport,
     151             :                          const casacore::Int& supportBuffer, const casacore::Float& sampling, const casacore::Complex& peak);
     152             :     static int getOversampling(PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm);
     153         724 :     int getOversampling(){return getOversampling(*psTerm_p, *wTerm_p, *aTerm_p);}
     154             : 
     155           6 :     virtual casacore::CountedPtr<CFTerms> getTerm(const casacore::String& name)
     156           6 :     {if (name=="ATerm") return aTerm_p; else return NULL;}
     157             :     
     158             :     // virtual casacore::Vector<casacore::Vector<casacore::Double> >findPointingOffset(const casacore::ImageInterface<casacore::Complex>& /*image*/,
     159             :     //                                                            const VisBuffer2& /*vb*/, const casacore::Bool& doPointing);
     160             : 
     161             : 
     162             : 
     163             :     casacore::CountedPtr<ATerm> aTerm_p;
     164             :     casacore::CountedPtr<PSTerm> psTerm_p;
     165             :     casacore::CountedPtr<WTerm> wTerm_p;
     166             : 
     167             :   protected:
     168             :     void normalizeAvgPB(casacore::ImageInterface<casacore::Complex>& inImage,
     169             :                         casacore::ImageInterface<casacore::Float>& outImage);
     170             :     casacore::Bool makeAverageResponse_org(const VisBuffer2& vb, 
     171             :                                  const casacore::ImageInterface<casacore::Complex>& image,
     172             :                                  casacore::ImageInterface<casacore::Float>& theavgPB,
     173             :                                  casacore::Bool reset=true);
     174             :     void makePBSq(casacore::ImageInterface<casacore::Complex>& inImage);
     175             : 
     176             : 
     177             :     casacore::Vector<casacore::Double> thePix_p;
     178             :     casacore::Vector<casacore::Vector<casacore::Double> >pixFieldGrad_p;
     179             :     casacore::Double imRefFreq_p;
     180             :     casacore::Bool wbAWP_p, conjPB_p;
     181             :     casacore::CountedPtr<CFBuffer> baseCFB_p;
     182             :   };
     183             :   //
     184             :   //-------------------------------------------------------------------------------------------
     185             :   //
     186             : };
     187             : };
     188             : #endif

Generated by: LCOV version 1.16