LCOV - code coverage report
Current view: top level - atmosphere/ATM/test - SkyStatusTest.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 102 102 100.0 %
Date: 2024-10-29 13:38:20 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*******************************************************************************
       2             :  * ALMA - Atacama Large Millimeter Array
       3             :  * (c) Instituto de Estructura de la Materia, 2011
       4             :  * (in the framework of the ALMA collaboration).
       5             :  * All rights reserved.
       6             :  * 
       7             :  * This library is free software; you can redistribute it and/or
       8             :  * modify it under the terms of the GNU Lesser General Public
       9             :  * License as published by the Free Software Foundation; either
      10             :  * version 2.1 of the License, or (at your option) any later version.
      11             :  * 
      12             :  * This library is distributed in the hope that it will be useful,
      13             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
      15             :  * Lesser General Public License for more details.
      16             :  * 
      17             :  * You should have received a copy of the GNU Lesser General Public
      18             :  * License along with this library; if not, write to the Free Software
      19             :  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
      20             :  *******************************************************************************/
      21             : 
      22             : #include <string>
      23             : #include <vector>
      24             : #include <iostream>
      25             : #include <fstream>
      26             : using namespace std;
      27             : 
      28             : #include <atmosphere/ATM/ATMPercent.h>
      29             : #include <atmosphere/ATM/ATMPressure.h>
      30             : #include <atmosphere/ATM/ATMNumberDensity.h>
      31             : #include <atmosphere/ATM/ATMMassDensity.h>
      32             : #include <atmosphere/ATM/ATMTemperature.h>
      33             : #include <atmosphere/ATM/ATMLength.h>
      34             : #include <atmosphere/ATM/ATMInverseLength.h>
      35             : #include <atmosphere/ATM/ATMOpacity.h>
      36             : #include <atmosphere/ATM/ATMAngle.h>
      37             : #include <atmosphere/ATM/ATMHumidity.h>
      38             : #include <atmosphere/ATM/ATMFrequency.h>
      39             : #include <atmosphere/ATM/ATMWaterVaporRadiometer.h>
      40             : #include <atmosphere/ATM/ATMWVRMeasurement.h>
      41             : #include <atmosphere/ATM/ATMProfile.h>
      42             : #include <atmosphere/ATM/ATMSpectralGrid.h>
      43             : #include <atmosphere/ATM/ATMRefractiveIndex.h>
      44             : #include <atmosphere/ATM/ATMRefractiveIndexProfile.h>
      45             : #include <atmosphere/ATM/ATMSkyStatus.h>
      46             : using namespace atm;
      47             :   /** \brief A C++ main code to test the <a href="classatm_1_1SkyStatus.html">SkyStatus</a> Class 
      48             :    *
      49             :    *   The test 1 is structured as follows:
      50             :    *         - Creates an object called "myProfile" belonging to the <a href="classatm_1_1AtmProfile.html">AtmProfile</a> Class. This object 
      51             :    *           is the same created in <a href="AtmProfileTest_8cpp.html">AtmProfileTest.cpp</a>
      52             :    *         - A single frequency is defined (850 GHz).
      53             :    *         - A refractive index profile, called "myRefractiveIndexProfile", for 850 GHz and "myProfile" 
      54             :    *        is constructed using  a constructor in the form 
      55             :    *        <a href="classatm_1_1RefractiveIndexProfile.html#z8_0">RefractiveIndexProfile (Frequency frequency, AtmProfile atmProfile)</a>.
      56             :    *         - An object of the <a href="classatm_1_1SkyStatus.html">SkyStatus</a> class is created using 
      57             :    *         <a href="classatm_1_1SkyStatus.html#z12_0">the basic constructor</a> of this class. This object is called "mySky_siglefreq"
      58             :    *         - Radiative transfer results are obtained for "mySky_siglefreq" forcing some parameters (such as the water vapor column) to different 
      59             :    *           values external to the object.
      60             :    *         - Several parameters are changed internally in the object "mySky_siglefreq" using setters, e.g. 
      61             :    *           <a href="classatm_1_1SkyStatus.html#z13_1">setUserWH2O</a> and 
      62             :    *           <a href="classatm_1_1SkyStatus.html#z13_3">setAirMass</a>, and new radiative transfer results are obtained.
      63             :    *         - In the final part of this test, a new object, called "mySky_1band_8channels", of the 
      64             :    *           <a href="classatm_1_1SkyStatus.html">SkyStatus</a> class is 
      65             :    *           created with again the <a href="classatm_1_1SkyStatus.html#z12_0">the basic constructor</a> but with an object 
      66             :    *         of the <a href="classatm_1_1RefractiveIndexProfile.html">RefractiveIndexProfile</a> class that has a 
      67             :    *         <a href="classatm_1_1SpectralGrid.html">SpectralGrid</a> with one band and eight frequecy channels. 
      68             :    *         - Radiative transfer results are obtained for the eight frequency channels under different conditions specified by setters. 
      69             :    *
      70             :    *  The output of this test is the following:
      71             :    *
      72             :    * <b>
      73             :    * SkyStatusTest: BASIC ATMOSPHERIC PARAMETERS TO GENERATE REFERENCE ATMOSPHERIC PROFILE
      74             :    * SkyStatusTest:   <br>
      75             :    * SkyStatusTest: Ground temperature T:         270 K<br>
      76             :    * SkyStatusTest: Ground pressure P:            560 mb<br>
      77             :    * SkyStatusTest: Relative humidity rh:         20 %<br>
      78             :    * SkyStatusTest: Scale height h0:              2 km<br>
      79             :    * SkyStatusTest: Pressure step dp:             5 mb<br>
      80             :    * SkyStatusTest: Altitude alti:                5000 m<br>
      81             :    * SkyStatusTest: Attitude top atm profile atmh:48 km<br>
      82             :    * SkyStatusTest: Pressure step factordp1:      1.1 <br>
      83             :    * SkyStatusTest: Tropospherique lapse rate:    -5.6 K/km<br>
      84             :    * SkyStatusTest: Atmospheric type:             tropical<br>
      85             :    * SkyStatusTest:   <br>
      86             :    * SkyStatusTest:   <br>
      87             :    * SkyStatusTest: Object myProfile built with the AtmProfile CONSTRUCTOR and the above entries<br>
      88             :    * SkyStatusTest:   <br>
      89             :    * SkyStatusTest: Number of layers returned:  22<br>
      90             :    * SkyStatusTest: Layer parameters:  <br>
      91             :    * SkyStatusTest: size of Temperature Profile: 22<br>
      92             :    * SkyStatusTest:  P: 554.977 mb T: 269.598 K Thickness: 143.444 m WaterVapor: 0.000762199 kg m-3 WaterVapor: 2.5504e+22 m-3 CO: 1.93876e+18 m-3 O3: 5.62901e+17 m-3 N2O: 4.76212e+18 m-3<br>
      93             :    * SkyStatusTest:  P: 543.967 mb T: 268.706 K Thickness: 175.101 m WaterVapor: 0.000703854 kg m-3 WaterVapor: 2.35517e+22 m-3 CO: 1.90629e+18 m-3 O3: 5.58954e+17 m-3 N2O: 4.68575e+18 m-3<br>
      94             :    * SkyStatusTest:  P: 530.751 mb T: 267.615 K Thickness: 214.579 m WaterVapor: 0.000638519 kg m-3 WaterVapor: 2.13656e+22 m-3 CO: 1.86583e+18 m-3 O3: 5.54106e+17 m-3 N2O: 4.59355e+18 m-3<br>
      95             :    * SkyStatusTest:  P: 514.888 mb T: 266.275 K Thickness: 264.252 m WaterVapor: 0.000566481 kg m-3 WaterVapor: 1.89551e+22 m-3 CO: 1.81512e+18 m-3 O3: 5.48123e+17 m-3 N2O: 4.48208e+18 m-3<br>
      96             :    * SkyStatusTest:  P: 495.844 mb T: 264.618 K Thickness: 327.475 m WaterVapor: 0.000488584 kg m-3 WaterVapor: 1.63486e+22 m-3 CO: 1.75116e+18 m-3 O3: 5.40691e+17 m-3 N2O: 4.34711e+18 m-3<br>
      97             :    * SkyStatusTest:  P: 472.979 mb T: 262.555 K Thickness: 409.147 m WaterVapor: 0.000406408 kg m-3 WaterVapor: 1.35988e+22 m-3 CO: 1.66905e+18 m-3 O3: 5.31317e+17 m-3 N2O: 4.18305e+18 m-3<br>
      98             :    * SkyStatusTest:  P: 445.521 mb T: 259.963 K Thickness: 516.736 m WaterVapor: 0.00032243 kg m-3 WaterVapor: 1.07889e+22 m-3 CO: 1.56532e+18 m-3 O3: 5.19589e+17 m-3 N2O: 3.98414e+18 m-3<br>
      99             :    * SkyStatusTest:  P: 412.536 mb T: 256.662 K Thickness: 662.272 m WaterVapor: 0.000240119 kg m-3 WaterVapor: 8.03464e+21 m-3 CO: 1.43556e+18 m-3 O3: 5.01384e+17 m-3 N2O: 3.74538e+18 m-3<br>
     100             :    * SkyStatusTest:  P: 372.891 mb T: 252.381 K Thickness: 866.58 m WaterVapor: 0.000163845 kg m-3 WaterVapor: 5.48243e+21 m-3 CO: 1.26268e+18 m-3 O3: 4.89541e+17 m-3 N2O: 3.44722e+18 m-3<br>
     101             :    * SkyStatusTest:  P: 325.19 mb T: 246.68 K Thickness: 1169.46 m WaterVapor: 9.84855e-05 kg m-3 WaterVapor: 3.29543e+21 m-3 CO: 1.03631e+18 m-3 O3: 4.87238e+17 m-3 N2O: 3.07023e+18 m-3<br>
     102             :    * SkyStatusTest:  P: 267.67 mb T: 238.76 K Thickness: 1658.92 m WaterVapor: 4.85606e-05 kg m-3 WaterVapor: 1.62489e+21 m-3 CO: 7.6885e+17 m-3 O3: 5.03793e+17 m-3 N2O: 2.58146e+18 m-3<br>
     103             :    * SkyStatusTest:  P: 256.935 mb T: 230.765 K Thickness: 1000 m WaterVapor: 2.49802e-05 kg m-3 WaterVapor: 8.35865e+20 m-3 CO: 5.53847e+17 m-3 O3: 5.37164e+17 m-3 N2O: 2.16403e+18 m-3<br>
     104             :    * SkyStatusTest:  P: 257.26 mb T: 224.015 K Thickness: 1000 m WaterVapor: 1.51513e-05 kg m-3 WaterVapor: 5.06978e+20 m-3 CO: 3.99903e+17 m-3 O3: 5.63587e+17 m-3 N2O: 1.87717e+18 m-3<br>
     105             :    * SkyStatusTest:  P: 211.112 mb T: 215.315 K Thickness: 1625 m WaterVapor: 7.86037e-06 kg m-3 WaterVapor: 2.63017e+20 m-3 CO: 2.48942e+17 m-3 O3: 5.7276e+17 m-3 N2O: 1.56008e+18 m-3<br>
     106             :    * SkyStatusTest:  P: 158.866 mb T: 203.315 K Thickness: 2000 m WaterVapor: 3.17588e-06 kg m-3 WaterVapor: 1.06268e+20 m-3 CO: 1.23924e+17 m-3 O3: 5.91703e+17 m-3 N2O: 1.1682e+18 m-3<br>
     107             :    * SkyStatusTest:  P: 114.088 mb T: 191.865 K Thickness: 2000 m WaterVapor: 1.16834e-06 kg m-3 WaterVapor: 3.90939e+19 m-3 CO: 5.57264e+16 m-3 O3: 1.47198e+18 m-3 N2O: 7.62395e+17 m-3<br>
     108             :    * SkyStatusTest:  P: 81.0467 mb T: 190.615 K Thickness: 2000 m WaterVapor: 4.29808e-07 kg m-3 WaterVapor: 1.43819e+19 m-3 CO: 2.61142e+16 m-3 O3: 2.77652e+18 m-3 N2O: 4.64509e+17 m-3<br>
     109             :    * SkyStatusTest:  P: 50.4577 mb T: 201.065 K Thickness: 3750 m WaterVapor: 1.02088e-07 kg m-3 WaterVapor: 3.41599e+18 m-3 CO: 1.54239e+16 m-3 O3: 3.93168e+18 m-3 N2O: 2.3445e+17 m-3<br>
     110             :    * SkyStatusTest:  P: 27.4549 mb T: 212.515 K Thickness: 4000 m WaterVapor: 1.47072e-08 kg m-3 WaterVapor: 4.9212e+17 m-3 CO: 1.04872e+16 m-3 O3: 4.55929e+18 m-3 N2O: 1.03582e+17 m-3<br>
     111             :    * SkyStatusTest:  P: 15.0592 mb T: 221.315 K Thickness: 4000 m WaterVapor: 1.99041e-09 kg m-3 WaterVapor: 6.66012e+16 m-3 CO: 7.05928e+15 m-3 O3: 3.23216e+18 m-3 N2O: 4.5226e+16 m-3<br>
     112             :    * SkyStatusTest:  P: 8.2977 mb T: 230.215 K Thickness: 4250 m WaterVapor: 2.53052e-10 kg m-3 WaterVapor: 8.46739e+15 m-3 CO: 4.4967e+15 m-3 O3: 1.76311e+18 m-3 N2O: 1.69912e+16 m-3<br>
     113             :    * SkyStatusTest:  P: 4.09633 mb T: 241.315 K Thickness: 6000 m WaterVapor: 1.95133e-11 kg m-3 WaterVapor: 6.52935e+14 m-3 CO: 2.56843e+15 m-3 O3: 6.47884e+17 m-3 N2O: 3.88669e+15 m-3<br>
     114             :    * SkyStatusTest: First guess precipitable water vapor content: 1.57182mm<br>
     115             :    * SkyStatusTest: (This value is estimated from the relative humidity at ground level and the water vapor scale height)<br>
     116             :    * SkyStatusTest:   <br>
     117             :    * SkyStatusTest:   <br>
     118             :    * SkyStatusTest:    TEST FOR JUST 1 FREQUENCY  <br>
     119             :    * SkyStatusTest:    =========================  <br>
     120             :    * SkyStatusTest:  <br>
     121             :    * SkyStatusTest: Frequency      : 850 GHz<br>
     122             :    * SkyStatusTest: Wet opacity    : 1.09385 nepers, for 1 mm H2O<br>
     123             :    * SkyStatusTest: Dry opacity    : 0.12149 nepers <br>
     124             :    * SkyStatusTest: Sky brightness : 189.623 K<br>
     125             :    * SkyStatusTest: (EXTERNAL CHANGE) water vapor column:           0.4 mm<br>
     126             :    * SkyStatusTest: (NEW OUTPUT) T_EBB =                         121.052 K <br>
     127             :    * SkyStatusTest: Current water vapor column in Radiance Class:1 mm<br>
     128             :    * SkyStatusTest:  <br>
     129             :    * SkyStatusTest: (INTERNAL CHANGE) Air mass:                     2   <br>
     130             :    * SkyStatusTest: (NEW OUTPUT) T_EBB =                         242.61 K <br>
     131             :    *<br>
     132             :    * SkyStatusTest: (INTERNAL CHANGE) water vapor column:           0.8 mm<br>
     133             :    * SkyStatusTest: (NEW OUTPUT) T_EBB =                         229.859 K <br>
     134             :    *<br>
     135             :    * SkyStatusTest:    TEST FOR ONE SPECTRAL WINDOW WITH SEVERAL CHANNELS  <br>
     136             :    * SkyStatusTest:    =====================================================  <br>
     137             :    * SkyStatusTest:  <br>
     138             :    * SkyStatusTest: water vapor column: 1 mm<br>
     139             :    * SkyStatusTest: Air mass          : 1<br>
     140             :    * <br>
     141             :    * SkyStatusTest: Freq: 847 GHz  /  T_EBB=190.099 K <br>
     142             :    * SkyStatusTest: Freq: 848 GHz  /  T_EBB=189.865 K <br>
     143             :    * SkyStatusTest: Freq: 849 GHz  /  T_EBB=196.705 K <br>
     144             :    * SkyStatusTest: Freq: 850 GHz  /  T_EBB=189.623 K <br>
     145             :    * SkyStatusTest: Freq: 851 GHz  /  T_EBB=189.39 K <br>
     146             :    * SkyStatusTest: Freq: 852 GHz  /  T_EBB=189.422 K <br>
     147             :    * SkyStatusTest: Freq: 853 GHz  /  T_EBB=189.933 K <br>
     148             :    * SkyStatusTest: Freq: 854 GHz  /  T_EBB=189.59 K <br>
     149             :    * SkyStatusTest:  <br>
     150             :    * SkyStatusTest: water vapor column: 1 mm<br>
     151             :    * SkyStatusTest: Air mass          : 1.2<br>
     152             :    * <br>
     153             :    * SkyStatusTest: Freq: 847 GHz  /  T_EBB=206.063 K <br>
     154             :    * SkyStatusTest: Freq: 848 GHz  /  T_EBB=205.841 K <br>
     155             :    * SkyStatusTest: Freq: 849 GHz  /  T_EBB=212.186 K <br>
     156             :    * SkyStatusTest: Freq: 850 GHz  /  T_EBB=205.61 K <br>
     157             :    * SkyStatusTest: Freq: 851 GHz  /  T_EBB=205.389 K <br>
     158             :    * SkyStatusTest: Freq: 852 GHz  /  T_EBB=205.419 K <br>
     159             :    * SkyStatusTest: Freq: 853 GHz  /  T_EBB=205.9 K <br>
     160             :    * SkyStatusTest: Freq: 854 GHz  /  T_EBB=205.578 K <br>
     161             :    * </b>
     162             :    */   
     163             : 
     164           1 : int main()
     165             : {  
     166             :   //  double h_div_k=0.04799274551;        // plank/boltz in un of K/GHz
     167             : 
     168             :   //  Atmospheretype   atmType = tropical; // Atmospheric type (to reproduce behavior above the tropopause)
     169           1 :   unsigned int atmType = 1; // TROPICAL
     170           2 :   Temperature      T( 270.0,"K" );     // Ground temperature
     171           2 :   Pressure         P( 560.0,"mb");     // Ground Pressure
     172           2 :   Humidity         H(  20.0,"%" );     // Ground Relative Humidity (indication)
     173           2 :   Length         Alt(  5000,"m" );     // Altitude of the site 
     174           2 :   Length         WVL(   2.0,"km");     // Water vapor scale height
     175           1 :   double         TLR=  -5.6      ;     // Tropospheric lapse rate (must be in K/km)
     176           2 :   Length      topAtm(  48.0,"km");     // Upper atm. boundary for calculations
     177           2 :   Pressure     Pstep(   5.0,"mb");     // Primary pressure step (10.0 mb)
     178           1 :   double   PstepFact=         1.1;     // Pressure step ratio between two consecutive layers
     179             : 
     180             : 
     181           1 :   cout<<" SkyStatusTest: BASIC ATMOSPHERIC PARAMETERS TO GENERATE REFERENCE ATMOSPHERIC PROFILE"<<endl; 
     182           1 :   cout<<" SkyStatusTest:   "<<endl;
     183           1 :   cout<<" SkyStatusTest: Ground temperature T:         " << T.get()         << " K"    <<endl; 
     184           1 :   cout<<" SkyStatusTest: Ground pressure P:            " << P.get("mb")     << " mb"   <<endl; 
     185           1 :   cout<<" SkyStatusTest: Relative humidity rh:         " << H.get("%")      << " %"    <<endl; 
     186           1 :   cout<<" SkyStatusTest: Scale height h0:              " << WVL.get("km")   << " km"   <<endl; 
     187           1 :   cout<<" SkyStatusTest: Pressure step dp:             " << Pstep.get("mb") << " mb"   <<endl; 
     188           1 :   cout<<" SkyStatusTest: Altitude alti:                " << Alt.get()       << " m"    <<endl; 
     189           1 :   cout<<" SkyStatusTest: Attitude top atm profile atmh:" << topAtm.get("km")<< " km"   <<endl; 
     190           1 :   cout<<" SkyStatusTest: Pressure step factordp1:      " << PstepFact          << " "    <<endl; 
     191           1 :   cout<<" SkyStatusTest: Tropospherique lapse rate:    " << TLR                << " K/km" <<endl;
     192             : 
     193           1 :   AtmProfile myProfile( Alt, P, T, TLR, H, WVL, Pstep, PstepFact,  topAtm, atmType );
     194             : 
     195           1 :   cout<<" SkyStatusTest: Atmospheric type:             " << myProfile.getAtmosphereType() <<endl;
     196           1 :   cout<<" SkyStatusTest:   "<<endl;
     197           1 :   cout<<" SkyStatusTest:   "<<endl;
     198             : 
     199           1 :   cout<<" SkyStatusTest: Object myProfile built with the AtmProfile CONSTRUCTOR and the above entries"<<endl; 
     200           1 :   cout<<" SkyStatusTest:   "<<endl;
     201           1 :   cout<<" SkyStatusTest: Number of layers returned:  " << myProfile.getNumLayer() <<endl;
     202           1 :   cout<<" SkyStatusTest: Layer parameters:  " <<endl;
     203             :   
     204             :     
     205           1 :   cout << " SkyStatusTest: size of Temperature Profile: " << myProfile.getTemperatureProfile().size() << endl;
     206          31 :   for(unsigned int i=0; i<myProfile.getNumLayer(); i++){
     207          60 :     cout << " SkyStatusTest:  P: "          << myProfile.getLayerPressure(i).get("mb")    << " mb" 
     208          60 :          << " T: "          << myProfile.getLayerTemperature(i).get("K")   << " K"
     209          60 :          << " Thickness: "  << myProfile.getLayerThickness(i).get("m")   << " m"
     210          60 :          << " WaterVapor: " << myProfile.getLayerWaterVaporMassDensity(i).get("kgm**-3")  << " kg m-3"
     211          60 :          << " WaterVapor: " << myProfile.getLayerWaterVaporNumberDensity(i).get("m**-3")  << " m-3"
     212          60 :          << " CO: "         << myProfile.getLayerCO(i).get("m**-3")      << " m-3"
     213          60 :          << " O3: "         << myProfile.getLayerO3(i).get("m**-3")          << " m-3"
     214          30 :          << " N2O: "        << myProfile.getLayerN2O(i).get("m**-3")         << " m-3" << endl;
     215             :   }
     216             : 
     217           1 :   cout << " SkyStatusTest: First guess precipitable water vapor content: " << myProfile.getGroundWH2O().get("mm") << "mm" << endl;
     218           1 :   cout << " SkyStatusTest: (This value is estimated from the relative humidity at ground level and the water vapor scale height)" << endl;
     219           1 :   cout<<" SkyStatusTest:   "<<endl;
     220           1 :   cout<<" SkyStatusTest:   "<<endl;
     221             : 
     222           1 :   cout << " SkyStatusTest:    TEST FOR JUST 1 FREQUENCY  " << endl;
     223           1 :   cout << " SkyStatusTest:    =========================  " << endl;
     224           1 :   cout << " SkyStatusTest:  " << endl;
     225             : 
     226           2 :   Frequency  mySingleFreq(850,"GHz");
     227             : 
     228           1 :   RefractiveIndexProfile myRefractiveIndexProfile(mySingleFreq, myProfile);
     229             : 
     230           1 :   SkyStatus mySky_siglefreq(myRefractiveIndexProfile);
     231             : 
     232           2 :   Length   new_wh2o0(1.0,"mm");  
     233           1 :   mySky_siglefreq.setUserWH2O(new_wh2o0);
     234             : 
     235             : 
     236           2 :   for(unsigned int i=0; i<mySky_siglefreq.getNumSpectralWindow(); i++){
     237             : 
     238           2 :     for(unsigned int j=0; j<mySky_siglefreq.getNumChan(i); j++){
     239             : 
     240           1 :       cout << " SkyStatusTest: Frequency      : " << mySky_siglefreq.getChanFreq(j).get("GHz") << " GHz" << endl; 
     241             : 
     242           1 :       cout << " SkyStatusTest: Wet opacity    : " << mySky_siglefreq.getWetOpacity(j).get() << " nepers, for " << mySky_siglefreq.getUserWH2O().get("mm") << " mm H2O" << endl; 
     243             : 
     244           1 :       cout << " SkyStatusTest: Dry opacity    : " << mySky_siglefreq.getDryOpacity(j).get() << " nepers " << endl; 
     245             :       
     246           1 :       cout << " SkyStatusTest: Sky brightness : " << mySky_siglefreq.getAverageTebbSky(j).get("K") << " K" << endl; 
     247             : 
     248             :     }
     249             : 
     250             :   }
     251             : 
     252           2 :   Length   new_wh2o(0.45,"mm");  
     253           1 :   cout << " SkyStatusTest: (EXTERNAL CHANGE) water vapor column:           " << new_wh2o.get("mm")                       << " mm" << endl;
     254           1 :   cout << " SkyStatusTest: (NEW OUTPUT) T_EBB =                         " << mySky_siglefreq.getAverageTebbSky(new_wh2o).get("K") << " K " << endl;
     255           1 :   cout << " SkyStatusTest: Current water vapor column in Radiance Class:" << mySky_siglefreq.getUserWH2O().get("mm")           << " mm" << endl;
     256           1 :   cout << " SkyStatusTest:  " <<endl;
     257             : 
     258             : 
     259           1 :   mySky_siglefreq.setAirMass(2.0);
     260             : 
     261           1 :   cout << " SkyStatusTest: (INTERNAL CHANGE) Air mass:                     " <<  mySky_siglefreq.getAirMass()              << "   " <<endl;
     262           1 :   cout << " SkyStatusTest: (NEW OUTPUT) T_EBB =                         " <<  mySky_siglefreq.getAverageTebbSky().get("K")     << " K " <<endl;
     263           1 :   cout << endl;
     264             : 
     265           2 :   Length   new_wh2o1(0.8,"mm" ); 
     266             :  
     267           1 :   mySky_siglefreq.setUserWH2O(new_wh2o1);
     268             : 
     269           1 :   cout<< " SkyStatusTest: (INTERNAL CHANGE) water vapor column:           " << mySky_siglefreq.getUserWH2O().get("mm")        << " mm" <<endl;
     270           1 :   cout<< " SkyStatusTest: (NEW OUTPUT) T_EBB =                         " << mySky_siglefreq.getAverageTebbSky().get("K")      << " K " <<endl;
     271           1 :   cout<<endl;
     272             : 
     273           1 :   cout << " SkyStatusTest:    TEST FOR ONE SPECTRAL WINDOW WITH SEVERAL CHANNELS  " << endl;
     274           1 :   cout << " SkyStatusTest:    =====================================================  " << endl;
     275           1 :   cout << " SkyStatusTest:  " << endl;
     276             : 
     277             :   //  unsigned int numchan=4;     /* 400; */      /* 500; */   /* 64; */
     278             :   //  unsigned int refchan=2;     /* 200;  */    /* 250; */    /* 32; */
     279             : 
     280             :   //  Frequency reffreq(899.55,"GHz");
     281             :   // Frequency chansep(  0.5,"GHz");
     282             : 
     283             : 
     284           1 :   unsigned int numchan=5;     /* 400; */      /* 500; */   /* 64; */
     285           1 :   unsigned int refchan=3;      /* 200;  */    /* 250; */    /* 32; */
     286             : 
     287           2 :   Frequency reffreq(616.50,"GHz");
     288           2 :   Frequency chansep(  0.01,"GHz");
     289             : 
     290             : 
     291           1 :   SpectralGrid band(numchan, refchan, reffreq, chansep);
     292           1 :   RefractiveIndexProfile abs_band(band, myProfile); 
     293           1 :   SkyStatus mySky_1band_8channels(abs_band);
     294             : 
     295             : 
     296           1 :   cout << " SkyStatusTest: water vapor column: " << mySky_1band_8channels.getUserWH2O().get("mm") << " mm" << endl;
     297           1 :   cout << " SkyStatusTest: Air mass          : " << mySky_1band_8channels.getAirMass() << endl;
     298           1 :   cout << " " << endl;
     299           6 :   for(unsigned int i=0; i<mySky_1band_8channels.getNumChan(0); i++){
     300             : 
     301           5 :     cout << " SkyStatusTest: Freq: " <<  mySky_1band_8channels.getChanFreq(i).get("GHz") << " GHz  /  T_EBB=" << mySky_1band_8channels.getTebbSky(i).get("K")  << " K " <<endl;
     302             : 
     303             :   }
     304           1 :   cout << " SkyStatusTest:  " << endl;
     305             : 
     306           1 :   mySky_1band_8channels.setAirMass(1.0);
     307           1 :   mySky_1band_8channels.setUserWH2O(0.45,"mm");
     308           1 :   mySky_siglefreq.setUserWH2O(0.45,"mm");
     309             : 
     310           1 :   cout << " SkyStatusTest: water vapor column: " << mySky_1band_8channels.getUserWH2O().get("mm") << " mm" << endl;
     311           1 :   cout << " SkyStatusTest: Air mass          : " << mySky_1band_8channels.getAirMass() << endl;
     312           1 :   cout << " " << endl;
     313             : 
     314           6 :   for(unsigned int i=0; i<mySky_1band_8channels.getNumChan(0); i++){
     315             : 
     316          10 :     cout << " SkyStatusTest: Freq: " <<  mySky_1band_8channels.getChanFreq(i).get("GHz") << " GHz  /  T_EBB=" << mySky_1band_8channels.getTebbSky(i).get("K")  << " Dry opacity: " << mySky_1band_8channels.getDryOpacity(i).get ("np") << " np " 
     317          10 :          << " Wet opacity: " << mySky_1band_8channels.getWetOpacity(i).get ("np") << " np " 
     318          10 :          << " Total opacity: " << mySky_1band_8channels.getTotalOpacity(i).get ("np") << " np " 
     319           5 : <<endl;
     320             : 
     321             :   }
     322             : 
     323             : 
     324           6 :   for(unsigned int i=0; i<mySky_1band_8channels.getNumChan(0); i++){
     325             : 
     326             :     //    cout << " SkyStatusTest: Freq: " <<  mySky_1band_8channels.getChanFreq(i).get("GHz") << " GHz  /  T_EBB=" << mySky_1band_8channels.getTebbSky(i).get("K")  << " K " <<endl;
     327             :     /*  cout << mySky_1band_8channels.getChanFreq(i).get("GHz") << " " << mySky_1band_8channels.getTebbSky(i).get("K")  << " " <<
     328             :       mySky_1band_8channels.getH2OLinesOpacity(i).get() << " " <<
     329             :       mySky_1band_8channels.getH2OContOpacity(i).get() << " " <<
     330             :       mySky_1band_8channels.getO2LinesOpacity(i).get() << " " <<
     331             :       mySky_1band_8channels.getDryContOpacity(i).get() << " " <<
     332             :       mySky_1band_8channels.getO3LinesOpacity(i).get() << " " <<
     333             :       endl; */
     334             : 
     335             :   }
     336             : 
     337           1 :   return 0;
     338             : 
     339           1 : }
     340             : 
     341             : 
     342             : 
     343             : 
     344             : 
     345             : 
     346             : 

Generated by: LCOV version 1.16