LCOV - code coverage report
Current view: top level - components/ComponentModels - FluxStdsQS.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 110 0.0 %
Date: 2024-10-04 18:58:15 Functions: 0 6 0.0 %

          Line data    Source code
       1             : //# FluxStdsQS.cc: Definition of the flux standards which do not explicitly
       2             : //# depend on time.
       3             : //# Copyright (C) 1996,1997,1999,2001,2002, 2010
       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: casa-feedback@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             : 
      28             : #include <components/ComponentModels/FluxStdsQS.h>
      29             : //#include <casa/Logging/LogIO.h>
      30             : 
      31             : using namespace casacore;
      32             : namespace casa { //# NAMESPACE CASA - BEGIN
      33             : 
      34             : // Each of these c'tors defines the polynomial coefficients for the
      35             : // log10(fluxDensity) = polynomial(log10(frequency)) calculations
      36             : // and optionally additional coefficients for estimating the flux density
      37             : // uncertainties. 
      38             : //
      39             : // fill_coeffs() with two RigidVectors uses the first one for the flux density
      40             : // coefficients and second one for the uncertainty coefficients, starting at
      41             : // order 0.  If the second RigidVector is omitted no uncertainty will be
      42             : // estimated.
      43             : 
      44             : 
      45           0 : Bool FluxStdBaars::setSourceCoeffs()
      46             : {
      47           0 :   Bool found = true;
      48             :   
      49           0 :   setFreqUnit("MHz");
      50           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
      51             :   
      52           0 :   if(srcEnum == FCQS::THREEC286)
      53           0 :     fill_coeffs(RVF3(1.480, 0.292, -0.124), RVF3(0.018, 0.006, 0.001));
      54           0 :   else if(srcEnum == FCQS::THREEC48)
      55           0 :     fill_coeffs(RVF3(2.345, 0.071, -0.138), RVF3(0.03, 0.001, 0.001));
      56           0 :   else if(srcEnum == FCQS::THREEC147)
      57           0 :     fill_coeffs(RVF3(1.766, 0.447, -0.184), RVF3(0.017, 0.006, 0.001));
      58           0 :   else if(srcEnum == FCQS::THREEC138)
      59           0 :     fill_coeffs(RVF3(2.009, -0.07176, -0.0862)); // No error specified
      60           0 :   else if(srcEnum == FCQS::NINETEEN34M638)
      61           0 :     fill_coeffs(RVF4(-23.839, 19.569, -4.8168, 0.35836)); // No error specified
      62           0 :   else if(srcEnum == FCQS::THREEC295)
      63           0 :     fill_coeffs(RVF3(1.485, 0.759, -0.255), RVF3(0.013, 0.009, 0.001));
      64             :   else
      65           0 :     found = false;
      66           0 :   return found;
      67             : }
      68             : 
      69           0 : Bool FluxStdPerley90::setSourceCoeffs()
      70             : {
      71           0 :   Bool found = true;
      72             :   
      73           0 :   setFreqUnit("MHz");
      74           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
      75             : 
      76           0 :   if(srcEnum == FCQS::THREEC286)
      77           0 :     fill_coeffs(RVF3(1.35899, 0.3599, -0.13338));
      78           0 :   else if(srcEnum == FCQS::THREEC48)
      79           0 :     fill_coeffs(RVF3(2.0868, 0.20889, -0.15498));
      80           0 :   else if(srcEnum == FCQS::THREEC147)
      81           0 :     fill_coeffs(RVF3(1.92641, 0.36072, -0.17389));
      82           0 :   else if(srcEnum == FCQS::THREEC138)
      83           0 :     fill_coeffs(RVF3(2.009, -0.07176, -0.0862));
      84           0 :   else if(srcEnum == FCQS::NINETEEN34M638)
      85           0 :     fill_coeffs(RVF4(-30.7667, 26.4908, -7.0977, 0.605334));
      86           0 :   else if(srcEnum == FCQS::THREEC295)
      87           0 :     fill_coeffs(RVF3(1.485, 0.759, -0.255));
      88             :   else
      89           0 :     found = false;
      90           0 :   return found;
      91             : }
      92             : 
      93           0 : Bool FluxStdPerleyTaylor95::setSourceCoeffs()
      94             : {
      95           0 :   Bool found = true;
      96             :   
      97           0 :   setFreqUnit("MHz");
      98           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
      99             : 
     100           0 :   if(srcEnum == FCQS::THREEC286)
     101           0 :     fill_coeffs(RVF4(0.50344, 1.05026, -0.31666, 0.01602));
     102           0 :   else if(srcEnum == FCQS::THREEC48)
     103           0 :     fill_coeffs(RVF4(1.16801, 1.07526, -0.42254, 0.02699));
     104           0 :   else if(srcEnum == FCQS::THREEC147)
     105           0 :     fill_coeffs(RVF4(0.05702, 2.09340, -0.7076, 0.05477));
     106           0 :   else if(srcEnum == FCQS::THREEC138)
     107           0 :     fill_coeffs(RVF4(1.97498, -0.23918, 0.01333, -0.01389));
     108           0 :   else if(srcEnum == FCQS::NINETEEN34M638)
     109           0 :     fill_coeffs(RVF4(-30.7667, 26.4908, -7.0977, 0.605334));
     110           0 :   else if(srcEnum == FCQS::THREEC295)
     111           0 :     fill_coeffs(RVF4(1.28872, 0.94172, -0.31113, 0.00569));
     112             :   else
     113           0 :     found = false;
     114           0 :   return found;
     115             : }
     116             : 
     117           0 : Bool FluxStdPerleyTaylor99::setSourceCoeffs()
     118             : {
     119           0 :   Bool found = true;
     120             :   
     121           0 :   setFreqUnit("GHz");
     122           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
     123             : 
     124             :   //LogIO os(LogOrigin("FluxStdPerleyTaylor99", "setSourceCoeffs", WHERE));
     125             :   // os << LogIO::NORMAL
     126             :   //    << "srcEnum before fill_coeffs() = " << srcEnum
     127             :   //    << LogIO::POST;
     128             : 
     129           0 :   if(srcEnum == FCQS::THREEC286)
     130           0 :     fill_coeffs(RVF4(1.23734, -0.43276, -0.14223, 0.00345));
     131           0 :   else if(srcEnum == FCQS::THREEC48)
     132           0 :     fill_coeffs(RVF4(1.31752, -0.74090, -0.16708, 0.01525));
     133           0 :   else if(srcEnum == FCQS::THREEC147)
     134           0 :     fill_coeffs(RVF4(1.44856, -0.67252, -0.21124, 0.04077));
     135           0 :   else if(srcEnum == FCQS::THREEC138)
     136           0 :     fill_coeffs(RVF4(1.00761, -0.55629, -0.11134, -0.0146));
     137           0 :   else if(srcEnum == FCQS::NINETEEN34M638){
     138             :     // The broken polynomial is smooth enough to be 1st-order differentiable.
     139             :     //
     140             :     // The coefficients have been shifted to use GHz instead of MHz.
     141           0 :     fill_lohi_coeffs(RVF4(1.170418, 0.248618, -1.649694, 0.605334),  // Low
     142           0 :                      MFrequency(Quantity(10.0, "GHz")),              // break
     143           0 :                      RVF4(-2.5739, 10.0707, -10.0595, 2.9372));      // High
     144             :   }
     145           0 :   else if(srcEnum == FCQS::THREEC295)
     146           0 :     fill_coeffs(RVF4(1.46744, -0.7735, -0.25912, 0.00752));
     147             :   else
     148           0 :     found = false;
     149           0 :   return found;
     150             : }
     151             : 
     152           0 : Bool FluxStdPerleyButler2010::setSourceCoeffs()
     153             : {
     154           0 :   Bool found = true;
     155             :   
     156           0 :   setFreqUnit("GHz");
     157           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
     158             : 
     159           0 :   if(srcEnum == FCQS::THREEC286)
     160           0 :     fill_coeffs(RVF4(1.2361, -0.4127, -0.1864, 0.0294));
     161           0 :   else if(srcEnum == FCQS::THREEC48)
     162           0 :     fill_coeffs(RVF4(1.3197, -0.7253, -0.2023, 0.0540));
     163           0 :   else if(srcEnum == FCQS::THREEC147)
     164           0 :     fill_coeffs(RVF4(1.4428, -0.6300, -0.3142, 0.1032));
     165           0 :   else if(srcEnum == FCQS::THREEC138)
     166           0 :     fill_coeffs(RVF4(1.0053, -0.4384, -0.1855, 0.0511));
     167           0 :   else if(srcEnum == FCQS::NINETEEN34M638){
     168             :     // The broken polynomial is smooth enough to be 1st-order differentiable.
     169             :     //
     170             :     // The coefficients have been shifted to use GHz instead of MHz.
     171           0 :     fill_lohi_coeffs(RVF4(1.170418, 0.248618, -1.649694, 0.605334),  // Low
     172           0 :                      MFrequency(Quantity(10.0, "GHz")),              // break
     173           0 :                      RVF4(-2.5739, 10.0707, -10.0595, 2.9372));      // High
     174             :   }
     175           0 :   else if(srcEnum == FCQS::THREEC295)
     176           0 :     fill_coeffs(RVF4(1.4605, -0.7043, -0.3951, 0.0815));
     177           0 :   else if(srcEnum == FCQS::THREEC196)
     178           0 :     fill_coeffs(RVF4(1.2753, -0.7971, -0.2255, 0.0380));
     179             :   else
     180           0 :     found = false;
     181           0 :   return found;
     182             : }
     183             : 
     184           0 : Bool FluxStdPerleyButler2013::setSourceCoeffs()
     185             : {
     186           0 :   Bool found = true;
     187           0 :   setFreqUnit("GHz");
     188           0 :   FCQS::Source srcEnum = FluxCalcQS::getSrcEnum();
     189             :   //Vector<Float> coeffs(5), coefferrs(5);
     190             : 
     191             :   // four sources: 3C123,3C196,3C286,3C295
     192             :   // this coefficients are as of 2012.09.13 given by Bryan Butler (CAS-4489)
     193             :   // revised coefficients Oct 1, 2012 (TT) 
     194             :   //
     195           0 :   if(srcEnum == FCQS::THREEC286)
     196             :     //2012.09.13 values
     197             :     //fill_coeffs(RVF4(1.2553, -0.4689, -0.1597, 0.0286), RVF4(0.0006, 0.0006, 0.0002, 0.0003));
     198             :     //3C286 revised values as of Oct 1, 2012.
     199           0 :     fill_coeffs(RVF4(1.2515, -0.4605, -0.1715, 0.0336), RVF4(0.0006, 0.0006, 0.0002, 0.0003));
     200           0 :   else if(srcEnum == FCQS::THREEC123) {
     201             :     
     202             :     /*** 2012.09.13 values
     203             :     coeffs(0)=1.8070;
     204             :     coefferrs(0)=0.0007;
     205             :     coeffs(1)=-0.7367;
     206             :     coefferrs(1)=0.0014;
     207             :     coeffs(2)=-0.3162;
     208             :     coefferrs(2)=0.0039;
     209             :     coeffs(3)=0.2045;
     210             :     coefferrs(3)=0.0037;
     211             :     coeffs(4)=-0.0672;
     212             :     coeffs(4)=0.0013;
     213             :     fill_coeffs(RVF5(coeffs),RVF5(coefferrs));
     214             :     ***/
     215             :     //3C123 revised values as of Oct 1, 2012 
     216             :     // now only given to 2nd order
     217           0 :     fill_coeffs(RVF3(1.8077, -0.8018, -0.1157),RVF3(0.0007, 0.0014, 0.0039));
     218             :   }
     219           0 :   else if(srcEnum == FCQS::THREEC295)
     220             :     // 2012.09.13 values  
     221             :     //fill_coeffs(RVF4(1.4832, -0.7749, -0.3529, 0.0767),RVF4(0.0007, 0.0006, 0.0003, 0.0003)); 
     222             :     // 3C295 Oct 1, 2012 
     223           0 :     fill_coeffs(RVF4(1.4866, -0.7871, -0.3440, 0.0749),RVF4(0.0007, 0.0006, 0.0003, 0.0003)); 
     224           0 :   else if(srcEnum == FCQS::THREEC196) {
     225             :     /*** 2012.09.13 values
     226             :     coeffs(0)=1.2892;
     227             :     coefferrs(0)=0.0007;
     228             :     coeffs(1)=-0.7973;
     229             :     coefferrs(1)=0.0017;
     230             :     coeffs(2)=-0.3504;
     231             :     coefferrs(2)=0.0036;
     232             :     coeffs(3)=0.1835;
     233             :     coefferrs(3)=0.0028;
     234             :     coeffs(4)=-0.0452;
     235             :     coefferrs(4)=0.0009;
     236             :     fill_coeffs(RVF5(coeffs),RVF5(coefferrs));
     237             :     ***/
     238             :     // 3C196 Oct 1 2012 values has less terms
     239           0 :     fill_coeffs(RVF4(1.2969, -0.8690, -0.1788, 0.0305), RVF4(0.0007, 0.0017, 0.0036, 0.0028));
     240             :   } 
     241             :   else
     242           0 :     found = false;
     243           0 :   return found;
     244             : }
     245             : 
     246             : 
     247             : } //# NAMESPACE CASA - END

Generated by: LCOV version 1.16