LCOV - code coverage report
Current view: top level - synthesis/TransformMachines2 - VLACalcIlluminationConvFunc.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 1 5 20.0 %
Date: 2024-12-11 20:54:31 Functions: 1 4 25.0 %

          Line data    Source code
       1             : //# VLAIlluminationConvFunc.h: Definition for VLAIlluminationConvFunc
       2             : //# Copyright (C) 1996,1997,1998,1999,2000,2002
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be adressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : //#
      27             : //# $Id$
      28             : 
      29             : #ifndef SYNTHESIS_TRANSFORM2_VLACALCILLUMINATIONCONVFUNC_H
      30             : #define SYNTHESIS_TRANSFORM2_VLACALCILLUMINATIONCONVFUNC_H
      31             : 
      32             : #include <synthesis/TransformMachines2/IlluminationConvFunc.h>
      33             : //#include <synthesis/MeasurementComponents/BeamCalcConstants.h>
      34             : #include <synthesis/TransformMachines/BeamCalc.h>
      35             : //#include <synthesis/MeasurementComponents/BeamCalcAntenna.h>
      36             : #include <synthesis/MeasurementComponents/CExp.new3.h>
      37             : #include <synthesis/MeasurementComponents/ExpCache.h>
      38             : #include <casacore/images/Images/TempImage.h>
      39             : #include <casacore/casa/Exceptions.h>
      40             : #include <msvis/MSVis/VisBuffer2.h>
      41             : #include <sstream>
      42             : #include <synthesis/TransformMachines2/Utils.h>
      43             : namespace casa{
      44             :   namespace refim{
      45             :     using namespace vi;
      46             :   //  casacore::Int getVLABandID(casacore::Double& freq,casacore::String&telescopeName);
      47             :   class VLACalcIlluminationConvFunc: public IlluminationConvFunc
      48             :   {
      49             :   public:
      50             : 
      51             :     VLACalcIlluminationConvFunc();
      52             :     VLACalcIlluminationConvFunc(casacore::Int n):
      53             :       IlluminationConvFunc(n),
      54             :       convFunc_p(),resolution(),pbRead_p(false),freq_p(0),lastPA(0),ap()
      55             :     {pbRead_p=false;};
      56         148 :     ~VLACalcIlluminationConvFunc() {delete ap.aperture;};
      57             : 
      58             :     void setBandID(casacore::Int bandID) {ap.band=bandID;}
      59             :     // void storeImg(casacore::String &fileName,casacore::ImageInterface<casacore::Complex>& img);
      60             :     // void storeImg(casacore::String &fileName,casacore::ImageInterface<casacore::Float>& img);
      61             :     // void store(casacore::String &fileName);
      62             :     void loadFromImage(casacore::String &fileName);
      63             :     void getIdealConvFunc(casacore::Array<casacore::Complex>& buf);
      64             :     //void ftAperture(casacore::TempImage<casacore::Complex>& uvgrid);
      65             :     void ftAperture(casacore::ImageInterface<casacore::Complex>& uvgrid, casacore::Bool makeMueller);
      66             :     void ftAperture(casacore::ImageInterface<casacore::Complex>& uvgrid, casacore::Int makeMuerller=0);
      67             :     void ftAperture() {ftAperture(convFunc_p); pbRead_p=true;};
      68             :     void storePB(casacore::String& fileName);
      69             : 
      70             :     casacore::Bool pbReady() {return pbRead_p;}
      71             : 
      72             :     static casacore::CoordinateSystem makeUVCoords(const casacore::CoordinateSystem& imageCoordSys,
      73             :                                   const casacore::IPosition& shape, casacore::Double refFreq=-1.0);
      74             :     void regridAperture(casacore::CoordinateSystem& skyCS, 
      75             :                         casacore::IPosition& skyShape, 
      76             :                         casacore::TempImage<casacore::Complex>& uvGrid, 
      77             :                         //const VisBuffer2& vb,
      78             :                         casacore::Double& pa,
      79             :                         casacore::Bool doSquint=true,casacore::Int bandID=-1,casacore::Int muellerTerm=0 ,casacore::Double freqVal=-1.0);
      80             :     void regridAperture(casacore::CoordinateSystem& skyCS,
      81             :                         casacore::IPosition& skyShape,
      82             :                         casacore::TempImage<casacore::Complex>& uvGrid,
      83             :                         const VisBuffer2 &vb,
      84             :                         const casacore::Vector<casacore::Float>& paList,
      85             :                         casacore::Bool doSquint, casacore::Int bandID);
      86             :     void regridApertureEngine(ApertureCalcParams& ap,
      87             :                               const casacore::Int& inStokes);
      88             :     void setApertureParams(ApertureCalcParams& ap,
      89             :                            const casacore::Float& Freq, const casacore::Float& pa, 
      90             :                            const casacore::Int& bandID,
      91             :                            const casacore::IPosition& skyShape,
      92             :                            const casacore::Vector<casacore::Double>& uvIncr);
      93             : 
      94             : 
      95             :     void applyPB(casacore::ImageInterface<casacore::Float>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
      96             :                  const casacore::Vector<casacore::Float>& paList, casacore::Int bandID, casacore::Bool doSquint=false);
      97             :     void applyPB(casacore::ImageInterface<casacore::Float>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
      98             :                  casacore::Int bandID=-1, casacore::Bool doSquint=false, casacore::Double freqVal=-1.0);
      99             :     void applyPB(casacore::ImageInterface<casacore::Complex>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
     100             :                  casacore::Bool doSquint=true,casacore::Int bandID=-1, casacore::Int muellerTerm=0, casacore::Double freqVal=-1.0);
     101             :     void applyPBSq(casacore::ImageInterface<casacore::Float>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
     102             :                    const casacore::Vector<casacore::Float>& paList, casacore::Int bandID, casacore::Bool doSquint=false);
     103             :     void applyPBSq(casacore::ImageInterface<casacore::Float>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
     104             :                    casacore::Int bandID=-1, casacore::Bool doSquint=false);
     105             :     void applyPBSq(casacore::ImageInterface<casacore::Complex>& pbImage, casacore::Double& pa,//const VisBuffer2& vb, 
     106             :                    casacore::Int bandID=-1,  casacore::Bool doSquint=true);
     107             :     void makeFullJones(casacore::ImageInterface<casacore::Complex>& pbImage, const VisBuffer2& vb, casacore::Bool doSquint, 
     108             :                casacore::Int bandID, casacore::Double freqVal=-1.0);
     109             :     void skyMuller(casacore::ImageInterface<casacore::Complex>& skyJones);
     110             :     void skyMuller(casacore::ImageInterface<casacore::Complex>& skyJones, casacore::Int muellerTerm=0);
     111             :     void skyMuller(casacore::Array<casacore::Complex>& skyJones, const casacore::IPosition& shape, const casacore::Int& inStokes);
     112             : 
     113           0 :     casacore::Bool findSupport(casacore::Array<casacore::Complex>& /*func*/, casacore::Float& /*threshold*/,casacore::Int& /*origin*/, casacore::Int& /*R*/)
     114           0 :     {throw(casacore::AipsError("VLACalcIlluminationConvFunc::findSupport() not implemented"));};
     115           0 :     virtual casacore::Bool makeAverageResponse(const VisBuffer2& /*vb*/,
     116             :                                      const casacore::ImageInterface<casacore::Complex>& /*image*/,
     117             :                                      //                              casacore::TempImage<casacore::Float>& theavgPB,
     118             :                                      casacore::ImageInterface<casacore::Float>& /*theavgPB*/,
     119             :                                      casacore::Bool /*reset*/=true)
     120           0 :     {throw(casacore::AipsError("VLACalc::makeAverageRes() called"));};
     121             : 
     122             : 
     123             :   private:
     124             :     
     125             :     void fillPB(casacore::ImageInterface<casacore::Complex>& inImg, casacore::ImageInterface<casacore::Float>& outImg, casacore::Bool Square=false);
     126             :     void fillPB(casacore::ImageInterface<casacore::Complex>& inImg, casacore::ImageInterface<casacore::Complex>& outImg, casacore::Bool Square=false);
     127             : 
     128             :     casacore::TempImage<casacore::Complex> convFunc_p;
     129             :     //    casacore::TempImage<casacore::Float> reAperture_p, imAperture_p;
     130             :     casacore::Vector<casacore::Double> resolution;
     131             :     casacore::Bool pbRead_p;
     132             :     casacore::Float freq_p,lastPA;
     133             :     ApertureCalcParams ap;
     134             :   };
     135             :   };
     136             : };
     137             : #endif

Generated by: LCOV version 1.16