LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - PBMath1DAiry.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 46 0.0 %
Date: 2024-10-09 13:55:54 Functions: 0 6 0.0 %

          Line data    Source code
       1             : //# PBMath1DAiry.cc: Implementation for PBMath1DAiry
       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/Exceptions/Error.h>
      31             : #include <casacore/casa/BasicSL/Complex.h>
      32             : #include <casacore/casa/BasicMath/Math.h>
      33             : #include <synthesis/TransformMachines/PBMath1DAiry.h>
      34             : #include <casacore/casa/Quanta.h>
      35             : #include <casacore/measures/Measures.h>
      36             : 
      37             : 
      38             : 
      39             : using namespace casacore;
      40             : namespace casa { //# NAMESPACE CASA - BEGIN
      41             : 
      42           0 : PBMath1DAiry::PBMath1DAiry(Quantity dishDiam, Quantity blockedDiam,
      43             :                            Quantity maxRad, Quantity refFreq, 
      44             :                            BeamSquint squint,
      45           0 :                            Bool useSymmetricBeam) :
      46             :   PBMath1D(maxRad, refFreq, true, squint, useSymmetricBeam),
      47           0 :   dishDiam_p(dishDiam),  
      48           0 :   blockedDiam_p(blockedDiam)
      49             : {
      50           0 :   fillPBArray();    
      51             : 
      52           0 :   if (useSymmetricBeam) {
      53           0 :     symmetrizeSquintedBeam();
      54             :   }
      55           0 : };
      56             : 
      57           0 : PBMath1DAiry::~PBMath1DAiry()
      58             : {
      59           0 : };
      60             : 
      61             : 
      62           0 : PBMath1DAiry& PBMath1DAiry::operator=(const PBMath1DAiry& other)
      63             : {
      64           0 :   if (this == &other)
      65           0 :     return *this;
      66             : 
      67           0 :   PBMath1D::operator=(other);
      68           0 :   dishDiam_p = other.dishDiam_p;
      69           0 :   blockedDiam_p = other.blockedDiam_p;
      70             : 
      71           0 :   return *this;
      72             : };
      73             : 
      74             : 
      75             : 
      76           0 : void PBMath1DAiry::fillPBArray()
      77             : {
      78             : 
      79           0 :   LogIO os(LogOrigin("PBMath1DAiry", "fillPBArray"));
      80           0 :   uInt nSamples=10000;
      81           0 :   vp_p.resize(nSamples);
      82             : 
      83           0 :   inverseIncrementRadius_p=Double(nSamples-1)/maximumRadius_p.getValue("'");
      84             :   
      85             :   // This scales the maximum radius from arcminutes on the sky at
      86             :   // 1 GHz for a 24.5 m unblocked aperture to the J1 Bessel function
      87             :   // coordinates (7.016 at the 2ns null).
      88           0 :   Double dimensionless_maxRad = maximumRadius_p.getValue("'") * 
      89           0 :     7.016/(1.566*60.) * dishDiam_p.getValue("m") / 24.5;  
      90           0 :   Double dimensionless_iiR = Double(nSamples-1)/dimensionless_maxRad;
      91             :   Double x;
      92             :   Double bd;
      93             :   uInt i;
      94           0 :   bd = blockedDiam_p.getValue("m");
      95           0 :   if (bd == 0.0) {
      96           0 :     vp_p(0) = 1.0;
      97           0 :     for(i=1;i<nSamples;i++) {
      98           0 :       x = i / dimensionless_iiR;
      99           0 :       vp_p(i) = 2.0 * j1(x)/x;
     100             :     }
     101             :   } else {
     102           0 :     Double areaRatio = square( dishDiam_p.getValue("m")/ blockedDiam_p.getValue("m") );
     103           0 :     Double areaNorm = areaRatio - 1.0;
     104           0 :     Double lengthRatio = dishDiam_p.getValue("m")/ blockedDiam_p.getValue("m");
     105           0 :     vp_p(0) = 1.0;
     106             :     //    cout << " areaRat = " << areaRatio << endl;
     107             :     //    cout << " areaNrom = " << areaNorm << endl;
     108             :     //    cout << " lengthRat = " << lengthRatio << endl;
     109           0 :     for(i=1;i<nSamples;i++) {
     110           0 :       x = i / dimensionless_iiR;
     111           0 :       vp_p(i) = ( areaRatio * 2.0 * j1(x)/x 
     112           0 :                   - 2.0 * j1( x * lengthRatio)/(x*lengthRatio) )/ areaNorm;
     113             :     }
     114             :   }
     115           0 : };
     116             : 
     117             : 
     118             : // Bool PBMath1DAiry::flushToTable(Table& beamSubTable, Int iRow)
     119             : //{};
     120             : 
     121             : void
     122           0 : PBMath1DAiry::summary(Int nValues)
     123             : {
     124           0 :   PBMath1D::summary(nValues);
     125           0 :    LogIO os(LogOrigin("PBMath1DAiry", "summary"));
     126           0 :    os << "   Dish Diameter: " << dishDiam_p.getValue("m") << " m " <<  LogIO::POST;
     127           0 :    os << "Blocked Diameter: " << blockedDiam_p.getValue("m") << " m " <<  LogIO::POST;
     128           0 : };
     129             : 
     130             : } //# NAMESPACE CASA - END
     131             : 

Generated by: LCOV version 1.16