LCOV - code coverage report
Current view: top level - atmosphere/ATM/test - RefractiveIndexProfileTest.cc (source / functions) Hit Total Coverage
Test: ctest_coverage.info Lines: 84 84 100.0 %
Date: 2023-11-02 14:27:30 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 <math.h>
      26             : using namespace std;
      27             : 
      28             : 
      29             : #include <atmosphere/ATM/ATMPercent.h>
      30             : #include <atmosphere/ATM/ATMPressure.h>
      31             : #include <atmosphere/ATM/ATMAngle.h>
      32             : #include <atmosphere/ATM/ATMNumberDensity.h>
      33             : #include <atmosphere/ATM/ATMMassDensity.h>
      34             : #include <atmosphere/ATM/ATMTemperature.h>
      35             : #include <atmosphere/ATM/ATMLength.h>
      36             : #include <atmosphere/ATM/ATMInverseLength.h>
      37             : #include <atmosphere/ATM/ATMOpacity.h>
      38             : #include <atmosphere/ATM/ATMHumidity.h>
      39             : #include <atmosphere/ATM/ATMFrequency.h>
      40             : #include <atmosphere/ATM/ATMProfile.h>
      41             : #include <atmosphere/ATM/ATMSpectralGrid.h>
      42             : #include <atmosphere/ATM/ATMRefractiveIndex.h>
      43             : #include <atmosphere/ATM/ATMRefractiveIndexProfile.h>
      44             : 
      45             : using namespace atm;
      46             :   /** \brief A C++ main code to test the <a href="classatm_1_1RefractiveIndexProfile.html">RefractiveIndexProfile</a> Class 
      47             :    *
      48             :    *   The test is structured as follows:
      49             :    *         - Creates an object called "myProfile" belonging to the <a href="classatm_1_1AtmProfile.html">AtmProfile</a> Class. This object 
      50             :    *           is the same created in <a href="AtmProfileTest_8cpp.html">AtmProfileTest.cpp</a>
      51             :    *         - A single frequency is defined (850 GHz).
      52             :    *         - A refractive index profile for 850 GHz and "myProfile" is constructed using  a constructor in the form 
      53             :    *        <a href="classatm_1_1RefractiveIndexProfile.html#z8_0">RefractiveIndexProfile (Frequency frequency, AtmProfile atmProfile)</a>.
      54             :    *         - Several test are then preformed on this created RefractiveIndexProfile object (called "myRefractiveIndexProfile") 
      55             :    *           are then performed and written on the screen.
      56             :    *
      57             :    *  The output of this test is the following:
      58             :    *
      59             :    *  <b>
      60             :    * RefractiveIndexProfileTest: BASIC ATMOSPHERIC PARAMETERS TO GENERATE REFERENCE ATMOSPHERIC PROFILE<br>
      61             :    *  <br>
      62             :    * RefractiveIndexProfileTest: Ground temperature T:         270 K<br>
      63             :    * RefractiveIndexProfileTest: Ground pressure P:            560 mb<br>
      64             :    * RefractiveIndexProfileTest: Relative humidity rh:         20 %<br>
      65             :    * RefractiveIndexProfileTest: Scale height h0:              2 km<br>
      66             :    * RefractiveIndexProfileTest: Pressure step dp:             5 mb<br>
      67             :    * RefractiveIndexProfileTest: Altitude alti:                5000 m<br>
      68             :    * RefractiveIndexProfileTest: Attitude top atm profile atmh:48 km<br>
      69             :    * RefractiveIndexProfileTest: Pressure step factordp1:      1.1 <br>
      70             :    * RefractiveIndexProfileTest: Tropospherique lapse rate:    -5.6 K/km<br>
      71             :    * RefractiveIndexProfileTest: Atmospheric type:             tropical<br>
      72             :    * RefractiveIndexProfileTest:   <br>
      73             :    * RefractiveIndexProfileTest:   <br>
      74             :    * RefractiveIndexProfileTest: Object myProfile built with the AtmProfile CONSTRUCTOR and the above entries<br>
      75             :    * RefractiveIndexProfileTest:   <br>
      76             :    * RefractiveIndexProfileTest: Number of layers returned:  22<br>
      77             :    * RefractiveIndexProfileTest: Layer parameters:  <br>
      78             :    * RefractiveIndexProfileTest:  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>
      79             :    * RefractiveIndexProfileTest:  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>
      80             :    * RefractiveIndexProfileTest:  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>
      81             :    * RefractiveIndexProfileTest:  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>
      82             :    * RefractiveIndexProfileTest:  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>
      83             :    * RefractiveIndexProfileTest:  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>
      84             :    * RefractiveIndexProfileTest:  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>
      85             :    * RefractiveIndexProfileTest:  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>
      86             :    * RefractiveIndexProfileTest:  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>
      87             :    * RefractiveIndexProfileTest:  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>
      88             :    * RefractiveIndexProfileTest:  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>
      89             :    * RefractiveIndexProfileTest:  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>
      90             :    * RefractiveIndexProfileTest:  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>
      91             :    * RefractiveIndexProfileTest:  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>
      92             :    * RefractiveIndexProfileTest:  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>
      93             :    * RefractiveIndexProfileTest:  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>
      94             :    * RefractiveIndexProfileTest:  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>
      95             :    * RefractiveIndexProfileTest:  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>
      96             :    * RefractiveIndexProfileTest:  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>
      97             :    * RefractiveIndexProfileTest:  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>
      98             :    * RefractiveIndexProfileTest:  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>
      99             :    * RefractiveIndexProfileTest:  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>
     100             :    * RefractiveIndexProfileTest: First guess precipitable water vapor content: 1.57182mm<br>
     101             :    * RefractiveIndexProfileTest: (This value is estimated from the relative humidity at ground level and the water vapor scale height)<br>
     102             :    * RefractiveIndexProfileTest:   <br>
     103             :    * RefractiveIndexProfileTest:   <br>
     104             :    * RefractiveIndexProfileTest: Example 1: Absorption profile for a single frequency: 850 GHz<br>
     105             :    *  <br>
     106             :    * RefractiveIndexProfileTest: Absorption Profile built from RefractiveIndexProfile CONSTRUCTOR. Summary of results:<br>
     107             :    *<br>
     108             :    * RefractiveIndexProfileTest: Total Dry Opacity at      850 GHz for 1.0 air mass: 0.12149<br>
     109             :    *<br>
     110             :    * RefractiveIndexProfileTest: Total Dry Cont Opacity at      850 GHz for 1.0 air mass: 0.102063<br>
     111             :    * RefractiveIndexProfileTest: Total O2 lines Opacity at      850 GHz for 1.0 air mass: 0.0136942<br>
     112             :    * RefractiveIndexProfileTest: Total O3 lines Opacity at      850 GHz for 1.0 air mass: 0.00506383<br>
     113             :    * RefractiveIndexProfileTest: Total CO lines Opacity at      850 GHz for 1.0 air mass: 2.21902e-06<br>
     114             :    * RefractiveIndexProfileTest: Total N2O lines Opacity at      850 GHz for 1.0 air mass: 0.000666054<br>
     115             :    *<br>
     116             :    * RefractiveIndexProfileTest: Total Wet Opacity at      850 GHz for 1.0 air mass: 1.71934<br>
     117             :    *<br>
     118             :    * RefractiveIndexProfileTest: Total H2O lines Opacity at      850 GHz for 1.0 air mass: 1.1558<br>
     119             :    * RefractiveIndexProfileTest: Total H2O Cont Opacity at      850 GHz for 1.0 air mass: 0.563542<br>
     120             :    *<br>
     121             :    *<br>
     122             :    * RefractiveIndexProfileTest: Total Dispersive Delay at 850 GHz for 1.0 air mass: 0.0018242 meters <br>
     123             :    * RefractiveIndexProfileTest: Total Non-Dispersive Delay at 850 GHz for 1.0 air mass: 0.0110324 meters <br>
     124             :    * RefractiveIndexProfileTest: Total Dry Delay at 850 GHz for 1.0 air mass: 1.47498 meters <br>
     125             :    * RefractiveIndexProfileTest: Total O2 lines Delay at 850 GHz for 1.0 air mass: -3.91084e-05 meters <br>
     126             :    * RefractiveIndexProfileTest: Total O3 lines Delay at 850 GHz for 1.0 air mass: 2.49173e-07 meters <br>
     127             :    * RefractiveIndexProfileTest: Total CO lines Delay at 850 GHz for 1.0 air mass: 8.40603e-09 meters <br>
     128             :    * RefractiveIndexProfileTest: Total N2O lines Delay at 850 GHz for 1.0 air mass: 1.4191e-07 meters <br>
     129             :    *<br>
     130             :    *<br>
     131             :    * RefractiveIndexProfileTest: (your actual water vapor column is 1.57182 mm; 1.57182 mm<br>
     132             :    *  </b>
     133             :   */
     134             : 
     135             : 
     136             : 
     137           1 : int main()
     138             : {  
     139             :   //  double h_div_k=0.04799274551;        // plank/boltz in units of K/GHz
     140             : 
     141             :   // Atmospheretype   atmType = tropical; // Atmospheric type (to reproduce behavior above the tropopause)
     142           1 :   unsigned int atmType = 1;  // TROPICAL
     143           3 :   Temperature      T( 270.0,"K" );     // Ground temperature
     144           3 :   Pressure         P( 560.0,"mb");     // Ground Pressure
     145           3 :   Humidity         H(  20.0,"%" );     // Ground Relative Humidity (indication)
     146           3 :   Length         Alt(  5000,"m" );     // Altitude of the site 
     147           3 :   Length         WVL(   2.0,"km");     // Water vapor scale height
     148           1 :   double         TLR=  -5.6      ;     // Tropospheric lapse rate (must be in K/km)
     149           3 :   Length      topAtm(  48.0,"km");     // Upper atm. boundary for calculations
     150           3 :   Pressure     Pstep(   5.0,"mb");     // Primary pressure step
     151           1 :   double   PstepFact=         1.1;     // Pressure step ratio between two consecutive layers
     152             : 
     153             : 
     154           1 :   cout<<" RefractiveIndexProfileTest: BASIC ATMOSPHERIC PARAMETERS TO GENERATE REFERENCE ATMOSPHERIC PROFILE"<<endl; 
     155           1 :   cout<<"  "<<endl;
     156           1 :   cout<<" RefractiveIndexProfileTest: Ground temperature T:         " << T.get()         << " K"    <<endl; 
     157           1 :   cout<<" RefractiveIndexProfileTest: Ground pressure P:            " << P.get("mb")     << " mb"   <<endl; 
     158           1 :   cout<<" RefractiveIndexProfileTest: Relative humidity rh:         " << H.get("%")      << " %"    <<endl; 
     159           1 :   cout<<" RefractiveIndexProfileTest: Scale height h0:              " << WVL.get("km")   << " km"   <<endl; 
     160           1 :   cout<<" RefractiveIndexProfileTest: Pressure step dp:             " << Pstep.get("mb") << " mb"   <<endl; 
     161           1 :   cout<<" RefractiveIndexProfileTest: Altitude alti:                " << Alt.get()       << " m"    <<endl; 
     162           1 :   cout<<" RefractiveIndexProfileTest: Attitude top atm profile atmh:" << topAtm.get("km")<< " km"   <<endl; 
     163           1 :   cout<<" RefractiveIndexProfileTest: Pressure step factordp1:      " << PstepFact          << " "    <<endl; 
     164           1 :   cout<<" RefractiveIndexProfileTest: Tropospherique lapse rate:    " << TLR                << " K/km" <<endl;
     165             : 
     166           2 :   AtmProfile myProfile( Alt, P, T, TLR, H, WVL, Pstep, PstepFact,  topAtm, atmType );
     167             : 
     168           1 :   cout<<" RefractiveIndexProfileTest: Atmospheric type:             " << myProfile.getAtmosphereType() <<endl;
     169           1 :   cout<<" RefractiveIndexProfileTest:   "<<endl;
     170           1 :   cout<<" RefractiveIndexProfileTest:   "<<endl;
     171             : 
     172           1 :   cout<<" RefractiveIndexProfileTest: Object myProfile built with the AtmProfile CONSTRUCTOR and the above entries"<<endl; 
     173           1 :   cout<<" RefractiveIndexProfileTest:   "<<endl;
     174           1 :   cout<<" RefractiveIndexProfileTest: Number of layers returned:  " << myProfile.getNumLayer() <<endl;
     175           1 :   cout<<" RefractiveIndexProfileTest: Layer parameters:  " <<endl;
     176             :   
     177             :     
     178          31 :   for(unsigned int i=0; i<myProfile.getNumLayer(); i++){
     179          60 :     cout << " RefractiveIndexProfileTest:  P: "          << myProfile.getLayerPressure(i).get("mb")    << " mb" 
     180          60 :          << " T: "          << myProfile.getLayerTemperature(i).get("K")   << " K"
     181          60 :          << " Thickness: "  << myProfile.getLayerThickness(i).get("m")   << " m"
     182          60 :          << " WaterVapor: " << myProfile.getLayerWaterVaporMassDensity(i).get("kgm**-3")  << " kg m-3"
     183          60 :          << " WaterVapor: " << myProfile.getLayerWaterVaporNumberDensity(i).get("m**-3")  << " m-3"
     184          60 :          << " CO: "         << myProfile.getLayerCO(i).get("m**-3")          << " m-3"
     185          60 :          << " O3: "         << myProfile.getLayerO3(i).get("m**-3")          << " m-3"
     186          30 :          << " N2O: "        << myProfile.getLayerN2O(i).get("m**-3")         << " m-3" << endl;
     187             :   }
     188             : 
     189             : 
     190             :   //  int mylayers=myProfile.getNumLayer();
     191             : 
     192             :  
     193           1 :   cout << " RefractiveIndexProfileTest: First guess precipitable water vapor content: " << myProfile.getGroundWH2O().get("mm") << "mm" << endl;
     194           1 :   cout << " RefractiveIndexProfileTest: (This value is estimated from the relative humidity at ground level and the water vapor scale height)" << endl;
     195           1 :   cout<<" RefractiveIndexProfileTest:   "<<endl;
     196           1 :   cout<<" RefractiveIndexProfileTest:   "<<endl;
     197             : 
     198           3 :   Frequency          mySingleFreq(850,"GHz");
     199           1 :   cout << " RefractiveIndexProfileTest: Example 1: Absorption profile for a single frequency: " << mySingleFreq.get("GHz") << " GHz" << endl;
     200           1 :   cout<<"  "<<endl;
     201             : 
     202             : 
     203           2 :   RefractiveIndexProfile myRefractiveIndexProfile(mySingleFreq, myProfile);
     204             :  
     205             : 
     206           1 :   cout<<" RefractiveIndexProfileTest: Absorption Profile built from RefractiveIndexProfile CONSTRUCTOR. Summary of results:"<<endl; 
     207           1 :   cout<<endl;
     208           1 :   cout<<" RefractiveIndexProfileTest: Total Dry Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getDryOpacity().get() <<endl;
     209           1 :   cout<<endl;
     210           1 :   cout<<" RefractiveIndexProfileTest: Total Dry Cont Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getDryContOpacity().get() <<endl;
     211           1 :   cout<<" RefractiveIndexProfileTest: Total O2 lines Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getO2LinesOpacity().get() <<endl;
     212           1 :   cout<<" RefractiveIndexProfileTest: Total O3 lines Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getO3LinesOpacity().get() <<endl;
     213           1 :   cout<<" RefractiveIndexProfileTest: Total CO lines Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getCOLinesOpacity().get() <<endl;
     214           1 :   cout<<" RefractiveIndexProfileTest: Total N2O lines Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getN2OLinesOpacity().get() <<endl;
     215           1 :   cout<<endl;
     216           1 :   cout<<" RefractiveIndexProfileTest: Total Wet Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " <<  myRefractiveIndexProfile.getWetOpacity().get() << endl; 
     217           1 :   cout<<endl;
     218           1 :   cout<<" RefractiveIndexProfileTest: Total H2O lines Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " <<  myRefractiveIndexProfile.getH2OLinesOpacity().get() << endl; 
     219           1 :   cout<<" RefractiveIndexProfileTest: Total H2O Cont Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " <<  myRefractiveIndexProfile.getH2OContOpacity().get() << endl; 
     220           1 :   cout<<endl;
     221           1 :   cout<<endl;
     222           2 :    cout<<" RefractiveIndexProfileTest: Total Dispersive PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     223           1 :      myRefractiveIndexProfile.getDispersiveH2OPathLength().get() << " meters " << endl;
     224             : 
     225           2 :    cout<<" RefractiveIndexProfileTest: Total Non-Dispersive PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     226           1 :      myRefractiveIndexProfile.getNonDispersiveH2OPathLength().get() << " meters " << endl;
     227             : 
     228           2 :    cout<<" RefractiveIndexProfileTest: Ratio Dispersive/Non-Dispersive PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     229           1 :      myRefractiveIndexProfile.getDispersiveH2OPathLength().get()/myRefractiveIndexProfile.getNonDispersiveH2OPathLength().get() << endl;
     230             : 
     231           2 :    cout<<" RefractiveIndexProfileTest: Total Dry PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     232           1 :      myRefractiveIndexProfile.getNonDispersiveDryPathLength().get() << " meters " << endl;
     233             :   
     234           2 :    cout<<" RefractiveIndexProfileTest: Total O2 lines PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     235           1 :      myRefractiveIndexProfile.getO2LinesPathLength().get() << " meters " << endl;
     236           2 :    cout<<" RefractiveIndexProfileTest: Total O3 lines PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     237           1 :      myRefractiveIndexProfile.getO3LinesPathLength().get() << " meters " << endl;
     238           2 :    cout<<" RefractiveIndexProfileTest: Total CO lines PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     239           1 :      myRefractiveIndexProfile.getCOLinesPathLength().get() << " meters " << endl;
     240           2 :    cout<<" RefractiveIndexProfileTest: Total N2O lines PathLength at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     241           1 :      myRefractiveIndexProfile.getN2OLinesPathLength().get() << " meters " << endl;
     242             : 
     243             : 
     244           1 :   cout<<endl;
     245           1 :   cout<<endl;
     246           1 :   cout << " RefractiveIndexProfileTest: (your actual water vapor column is " << (myProfile.getGroundWH2O()).get("mm") << " mm; " << (myRefractiveIndexProfile.getGroundWH2O()).get("mm") << " mm" <<endl;
     247           1 :   cout<<endl;
     248             : 
     249             : 
     250             : 
     251             :   /*
     252             :   cout << "change the basic parameter"<<endl;
     253             :   cout << "=========================="<<endl;
     254             :   cout << "Old ground temperature: "<< T.get() << " K"    <<endl; 
     255             :   Temperature newT(275.0,"K");   
     256             :   cout << "New ground temperature:" << newT.get() << " K"    <<endl; 
     257             :   
     258             :   myRefractiveIndexProfile.setBasicAtmosphericParameters(Alt, P, newT, TLR, H, WVL); 
     259             : 
     260             :   cout << "(your actual water vapor column is " << (myRefractiveIndexProfile.getGroundWH2O()).get("mm") << " mm" <<endl;
     261             : 
     262             : 
     263             :   cout<<"Absorption Profile with this new temperature. Summary of results:"<<endl; 
     264             :   cout<<endl;
     265             :   cout<<"Total Dry Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getDryOpacity().get() <<endl;
     266             :   cout<<"Total Wet Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     267             :     myRefractiveIndexProfile.getWetOpacity().get()/(myProfile.getGroundWH2O()).get("mm") << " per mm " << endl; 
     268             : 
     269             : 
     270             :   cout<<"Total Dispersive Delay at "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << 
     271             :     (myRefractiveIndexProfile.getDispersivePathLength().get())/((myProfile.getGroundWH2O()).get("mm")) << " meters per mm of water vapor (" << 
     272             :     (100*(myRefractiveIndexProfile.getDispersivePathLength().get())/(myProfile.getGroundWH2O().get("mm")))/
     273             :     ((myRefractiveIndexProfile.getNonDispersivePathLength().get())/((myProfile.getGroundWH2O().get("mm")))) <<" % of the Non-dispersive one)" << endl;  
     274             : 
     275             : 
     276             : 
     277             :   cout << "(your actual water vapor column is " << (myProfile.getGroundWH2O()).get("mm") << " mm)" <<endl;
     278             :   cout<<endl;
     279             : 
     280             :   cout << "Add a spectral window"<<endl;
     281             :   cout << "====================="<<endl;
     282             : 
     283             :   int numChan = 4;
     284             :   int refChan = 2;
     285             :   Frequency refFreq(284.97346,"GHz");   // 350
     286             :   Frequency chanSep(2.0,"MHz");
     287             : 
     288             :   myRefractiveIndexProfile.add(numChan, refChan, refFreq, chanSep);
     289             : 
     290             :   int numSpw = myRefractiveIndexProfile.getNumSpectralWindow();
     291             : 
     292             :   cout << "There are now " << numSpw << " spectral windows" << endl;
     293             : 
     294             : 
     295             :   cout<<"Absorption profiles including this new spectral window. Summary of results:"<<endl; 
     296             :   cout<<endl;
     297             :   cout<<"Total Dry Opacity at      "<<mySingleFreq.get("GHz") << " GHz for 1.0 air mass: " << myRefractiveIndexProfile.getDryOpacity().get() <<endl;
     298             :   double freq;
     299             :   int    spwid=0;
     300             :   int    numCh;
     301             :   int    k=0;
     302             :   for(spwid=0; spwid<numSpw; spwid++){
     303             : 
     304             :     numCh = myRefractiveIndexProfile.getNumChan(spwid); cout <<"Spectral window "<<spwid<<" has "<<numCh<<" frequency channels"<<endl;
     305             :     for(int n=0; n<numCh; n++){
     306             : 
     307             :       freq = myRefractiveIndexProfile.getChanFreq(spwid,n).get("GHz"); 
     308             :       cout<<"Total Wet Opacity at      "<< freq << " GHz for 1.0 air mass: " <<
     309             :         myRefractiveIndexProfile.getWetOpacity(k).get()/(myRefractiveIndexProfile.getGroundWH2O()).get("mm") << " per mm " << endl; 
     310             : 
     311             :       cout<<"Total Non-Dispersive Delay at "<< freq << " GHz for 1.0 air mass: " << 
     312             :         (myRefractiveIndexProfile.getNonDispersivePathLength(k).get())/(myProfile.getGroundWH2O().get("mm")) << " meters per mm of water vapor " << endl; 
     313             : 
     314             :       cout<<"Total Dispersive Delay at "<< freq << " GHz for 1.0 air mass: " << 
     315             :         (myRefractiveIndexProfile.getDispersivePathLength(k).get())/(myProfile.getGroundWH2O().get("mm")) << " meters per mm of water vapor (" <<
     316             :         (100*(myRefractiveIndexProfile.getDispersivePathLength(k).get())/(myRefractiveIndexProfile.getGroundWH2O().get("mm")))/
     317             :         ((myRefractiveIndexProfile.getNonDispersivePathLength(k).get())/(myRefractiveIndexProfile.getGroundWH2O().get("mm"))) <<" % of the Non-dispersive one)" << endl;  
     318             :       
     319             :       cout<<"Total Dry Delay at "<< freq << " GHz for 1.0 air mass: " << 
     320             :         (myRefractiveIndexProfile.getDryPathLength(k).get("micron")) << " microns " << endl;
     321             : 
     322             :       
     323             :       cout << "(your actual water vapor column is " << (myRefractiveIndexProfile.getGroundWH2O()).get("mm") << " mm)." <<endl;
     324             :       cout<<endl;
     325             :       k++;
     326             :     }
     327             :   }
     328             :   */
     329             : 
     330             : 
     331           1 : }
     332             : 

Generated by: LCOV version 1.16