LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - PBMath1DIPoly.h (source / functions) Hit Total Coverage
Test: ctest_coverage.info Lines: 1 1 100.0 %
Date: 2023-11-06 10:06:49 Functions: 1 1 100.0 %

          Line data    Source code
       1             : //# PBMath1DIPoly.h: Definitions of 1-D Inverse casacore::Polynomial PBMath objects
       2             : //# Copyright (C) 1996,1997,1998,2003
       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: aips2-request@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_PBMATH1DIPOLY_H
      30             : #define SYNTHESIS_PBMATH1DIPOLY_H
      31             : 
      32             : #include <casacore/casa/aips.h>
      33             : #include <synthesis/TransformMachines/PBMath1D.h>
      34             : #include <casacore/measures/Measures.h>
      35             : 
      36             : namespace casa { //# NAMESPACE CASA - BEGIN
      37             : 
      38             : //#forward
      39             : 
      40             : // <summary> 
      41             : // PBMath1DIPoly is a 1-D Inverse casacore::Polynomial Expansion for a Primary Beam
      42             : // </summary>
      43             : 
      44             : // <use visibility=export>
      45             : 
      46             : // <reviewed reviewer="" date="" tests="" demos="">
      47             : 
      48             : // <prerequisite>
      49             : // <li> <linkto class="PBMathInterface">PBMathInterface</linkto> class
      50             : // <li> <linkto class="PBMath1D">PBMath1D</linkto> class
      51             : // </prerequisite>
      52             : //
      53             : // <etymology>
      54             : // PBMath1DIPoly: derived from  PBMath1D, implements an Inverse casacore::Polynomial PB and VP
      55             : // </etymology>
      56             : //
      57             : // <synopsis> 
      58             : //  See PBMath1D for a general synopsis of the 1D PB types.
      59             : //
      60             : // VP(x) = sum_i  coeff_i *  x ^{2i}, 
      61             : // out to maximumRadius (referenced to the reference frequency)
      62             : // 
      63             : // x is in arcminutes, referenced to the reference frequency
      64             : //
      65             : // This move may make me a bit unpopular: since the PBMath1D constructors
      66             : // construct a Voltage Pattern, the coeficienct for a polynomial type must
      67             : // be in terms of the VP, not the PB.  Hence, go back to the original PB
      68             : // data, take the square root, and fit the same type polynomial to the
      69             : // VP data.
      70             : //
      71             : // Inverse polynomial VP model: fit polynomial to 1/(VP_data).
      72             : // Optionally, you can fit to 1/(VP_data) - 1, ignoring the constant
      73             : // polynomial term so that the PB is constrained to be 1.0 at the beam
      74             : // center.
      75             : // </synopsis> 
      76             : //
      77             : //
      78             : // <example>
      79             : // <srcblock>
      80             : //    coef(0) = 1.0;     / VLA model
      81             : //    coef(1) = 7.22110e-04; 
      82             : //    coef(2) = 1.21421e-07;
      83             : //    coef(3) = 9.68612e-11; 
      84             : //    coef(4) = 1.86268e-13;
      85             : //    PBMath1DIPoly ipolyPB( coef, casacore::Quantity(43.0,"'"), casacore::Quantity(1.0,"GHz"));
      86             : //
      87             : // </srcblock>
      88             : // </example>
      89             : //
      90             : // <motivation>
      91             : // All of the 1-D PB types have everything in common except for the
      92             : // details of their parameterization.  This lightweight class
      93             : // deals with those differences: construction, filling the PBArray
      94             : // from construction parameters, and flushing to disk.
      95             : // The inverse polynomial PB type is used for VLA and ATNF models.
      96             : // </motivation>
      97             : //
      98             : // <todo asof="98/10/21">
      99             : // <li> constructor from a casacore::MS beam subtable
     100             : // <li> flush to casacore::MS beam subtable
     101             : // </todo>
     102             : 
     103             :  
     104             : class PBMath1DIPoly : public PBMath1D {
     105             : public:
     106             : 
     107             :   PBMath1DIPoly() {};
     108             : 
     109             :   // Instantiation from arguments; default = no squint
     110             :   // squint is the offset from pointing center if the casacore::Stokes R beam
     111             :   // useSymmetricBeam forces a fit to the squinted beam
     112             :   PBMath1DIPoly(const casacore::Vector<casacore::Double>& coeff, casacore::Quantity maxRad, 
     113             :                 casacore::Quantity refFreq, 
     114             :                 casacore::Bool isThisVP=false,
     115             :                 BeamSquint squint=BeamSquint(casacore::MDirection(casacore::Quantity(0.0, "deg"),
     116             :                                                         casacore::Quantity(0.0, "deg"),
     117             :                                                         casacore::MDirection::Ref(casacore::MDirection::AZEL)),
     118             :                                              casacore::Quantity(1.0, "GHz")),
     119             :                 casacore::Bool useSymmetricBeam=false);
     120             : 
     121             :   // Instantiation from arguments; default = no squint
     122             :   // squint is the offset from pointing center if the casacore::Stokes R beam
     123             :   // useSymmetricBeam forces a fit to the squinted beam
     124             :   // Each column in coeff corresponds to a frequency in freqs
     125             :   PBMath1DIPoly(const casacore::Matrix<casacore::Double>& coeff, const casacore::Vector<casacore::Double>& freqs,
     126             :                 casacore::Quantity maxRad, 
     127             :                 casacore::Quantity refFreq, 
     128             :                 casacore::Bool isThisVP=false,
     129             :                 BeamSquint squint=BeamSquint(casacore::MDirection(casacore::Quantity(0.0, "deg"),
     130             :                                                         casacore::Quantity(0.0, "deg"),
     131             :                                                         casacore::MDirection::Ref(casacore::MDirection::AZEL)),
     132             :                                              casacore::Quantity(1.0, "GHz")),
     133             :                 casacore::Bool useSymmetricBeam=false);
     134             : 
     135             :   // Instantiation from a row in the Beam subTable
     136             :   // PBMath1DIPoly(const casacore::Table& BeamSubTable, casacore::Int row,
     137             :   //           casacore::Bool useSymmetricBeam=false);
     138             : 
     139             :   // Copy constructor
     140             :   // PBMath1DIPoly(const PBMath1DIPoly& other);
     141             : 
     142             :   // Assignment operator, by reference
     143             :   PBMath1DIPoly& operator=(const PBMath1DIPoly& other);
     144             : 
     145             :   // Clone the object
     146             :   //  casacore::CountedPtr<PBMathInterface> clone();
     147             : 
     148             : 
     149             :   ~PBMath1DIPoly();  
     150             : 
     151             :   // Get the type of PB this is
     152          13 :   PBMathInterface::PBClass whichPBClass() { return PBMathInterface::IPOLY; }  
     153             : 
     154             :   // Flush the construction parameters to disk
     155             :   // casacore::Bool flushToTable(casacore::Table& beamSubTable, casacore::Int iRow);
     156             : 
     157             :   // Summarize the construction data for this primary beam
     158             :   void summary(casacore::Int nValues=0);
     159             : 
     160             : protected:
     161             : 
     162             :   // Fill in vp_p array from construction parameters
     163             :   void fillPBArray();
     164             : 
     165             : private:    
     166             : 
     167             :   casacore::Vector<casacore::Double> coeff_p;
     168             :   casacore::Matrix<casacore::Double> wbcoeff_p;
     169             : 
     170             : };
     171             : 
     172             : 
     173             : } //# NAMESPACE CASA - END
     174             : 
     175             : #endif

Generated by: LCOV version 1.16