LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - PBMath1DPoly.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 24 36 66.7 %
Date: 2024-12-11 20:54:31 Functions: 4 6 66.7 %

          Line data    Source code
       1             : //# PBMath1DPoly.cc: Implementation for PBMath1DPoly
       2             : //# Copyright (C) 1996,1997,1998,1999,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: 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             : #include <casacore/casa/aips.h>
      30             : #include <casacore/casa/BasicSL/Complex.h>
      31             : #include <casacore/casa/BasicMath/Math.h>
      32             : #include <synthesis/TransformMachines/PBMath1DPoly.h>
      33             : #include <casacore/casa/Quanta.h>
      34             : #include <casacore/measures/Measures.h>
      35             : 
      36             : 
      37             : 
      38             : using namespace casacore;
      39             : namespace casa { //# NAMESPACE CASA - BEGIN
      40             : 
      41        1679 : PBMath1DPoly::PBMath1DPoly(const Vector<Double>& coeff, Quantity maxRad,
      42             :                            Quantity refFreq, 
      43             :                            Bool isThisVP,
      44             :                            BeamSquint squint,
      45        1679 :                            Bool useSymmetricBeam) :
      46             :   PBMath1D(maxRad, refFreq, isThisVP, squint, useSymmetricBeam),
      47        1679 :   coeff_p(coeff)
      48             : {
      49        1679 :   fillPBArray();    
      50             : 
      51        1679 :   if (useSymmetricBeam) {
      52        1174 :     symmetrizeSquintedBeam();
      53             :   }
      54        1679 : };
      55             : 
      56             : 
      57             : 
      58        3314 : PBMath1DPoly::~PBMath1DPoly()
      59             : {
      60        3314 : };
      61             : 
      62             : 
      63           0 : PBMath1DPoly& PBMath1DPoly::operator=(const PBMath1DPoly& other)
      64             : {
      65           0 :   if (this == &other)
      66           0 :     return *this;
      67             : 
      68           0 :   PBMath1D::operator=(other);
      69           0 :   coeff_p = other.coeff_p;
      70           0 :   return *this;
      71             : };
      72             : 
      73             : 
      74             : 
      75        1679 : void PBMath1DPoly::fillPBArray()
      76             : {
      77             : 
      78        3358 :   LogIO os(LogOrigin("PBMath1DPoly", "fillPBArray"));
      79        1679 :   uInt nSamples=10000;
      80        1679 :   vp_p.resize(nSamples);
      81             : 
      82        1679 :   inverseIncrementRadius_p=Double(nSamples-1)/maximumRadius_p.getValue("'");
      83             :   Double x2;   
      84             :   Double y;
      85             :   Double taper;
      86             : 
      87    16791679 :   for(uInt i=0;i<nSamples;i++) {
      88    16790000 :     taper = 0.0;
      89    16790000 :     x2 = square( (Double(i)/inverseIncrementRadius_p) );
      90    16790000 :     y = 1;
      91    85150000 :     for (uInt j=0;j<coeff_p.nelements();j++) {
      92    68360000 :       taper += y * coeff_p(j);
      93    68360000 :       y *= x2;
      94             :     }
      95    16790000 :     if (isThisVP_p) {
      96           0 :       vp_p(i) = taper;
      97             :     } else {
      98    16790000 :       vp_p(i) = sqrt(taper);
      99             :     }
     100             :   }
     101        1679 : };
     102             : 
     103             : 
     104             : //Bool PBMath1DPoly::flushToTable(Table& beamSubTable, Int iRow)
     105             : //{};
     106             : 
     107             : 
     108             : void
     109           0 : PBMath1DPoly::summary(Int nValues)
     110             : {
     111           0 :   PBMath1D::summary(nValues);
     112           0 :    LogIO os(LogOrigin("PBMath1DPoly", "summary"));
     113           0 :    os << "Even Powered Coefficients: " << coeff_p <<  LogIO::POST;
     114           0 : };
     115             : 
     116             : } //# NAMESPACE CASA - END
     117             : 

Generated by: LCOV version 1.16