Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.mrao.cam.ac.uk/~bn204/mk2/alma/aatm-dispersive.html
Дата изменения: Wed Nov 25 23:10:45 2009
Дата индексирования: Tue Oct 2 10:54:47 2012
Кодировка:

Поисковые слова: trifid nebula
Computing dispersive atmospheric delay with AATM
Cambridge > Cavendish Lab > MRAO
 

Computing dispersive atmospheric delay with AATM

Abstract

This is a short and simple illustration of how to use (A)ATM to calculate the dispersive path delay introduced by the atmosphere as well as the non-dispersive parts. The program has only two run-time parameters: the frequency at which to carry out the computation and the relative humidity at ground level.

If you have performed similar calculations and get same or different results, I would very much like to hear from you.

This program will be a part of AATM-0.06 examples when this version is released.

Example usage

The interaction with the program below is extremely simple and best illustrated by an example:

./dispersive --help
    

Produces the help message, which for current version is:

Compute dispersive delay in the atmosphere

This program is part of AATM version 0.06
GPL license -- you have the right to the source code. See COPYING

Allowed options:
  --help                Produce this help message
  --freq arg            Frequency at which to compute the dispersion (GHz)
  --ghum arg            Relative humidity at ground level (percent)
    

The actual computation can look like this:

./dispersive --freq 330 --ghum 25
Freq	Wet Non-Disp		Wet Disp		Dry Non-Disp
330	0.0137844		0.00144976		1.47484
    

Program source code


// Copyright (2008) Bojan Nikolic <b.nikolic@mrao.cam.ac.uk>
// 
// This file is part of AATM
//
// AATM is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// AATM is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
// License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with AATM.  If not, see <http://www.gnu.org/licenses/>.
//
// Comments regarding this example welcome at: 
// Bojan Nikolic <b.nikolic@mrao.cam.ac.uk>
//

#include <string>
#include <vector>
#include <iostream>
#include <fstream>

// Unfortunately the using statement below is required because of poor
// desgin of the header files
using namespace std;

#include "ATMRefractiveIndexProfile.h"
#include "ATMPercent.h"
#include "ATMPressure.h"
#include "ATMNumberDensity.h"
#include "ATMMassDensity.h"
#include "ATMTemperature.h"
#include "ATMLength.h"
#include "ATMInverseLength.h"
#include "ATMOpacity.h"  
#include "ATMHumidity.h"
#include "ATMFrequency.h"
#include "ATMWaterVaporRadiometer.h"
#include "ATMWVRMeasurement.h"
#include "ATMAtmosphereType.h"
#include "ATMType.h"
#include "ATMProfile.h"
#include "ATMSpectralGrid.h"
#include "ATMRefractiveIndex.h"
#include "ATMSkyStatus.h"
#include "ATMTypeName.h"
#include "ATMAngle.h"

// ------------ End ATM inclusion part ------------

#include "../config.h"

#include <boost/program_options.hpp>

typedef boost::shared_ptr<atm::AtmProfile> pAtmProf;

pAtmProf
simpleAOSAtmo(double ghum)
{
  using namespace atm;

  Atmospheretype   atmType = tropical; // Atmospheric type (to reproduce behavior above the tropopause)
  Temperature      T( 270.0,"K" );     // Ground temperature
  Pressure         P( 560.0,"mb");     // Ground Pressure
  Humidity         H(  ghum,"%" );     // Ground Relative Humidity (indication)
  Length         Alt(  5000,"m" );     // Altitude of the site 
  Length         WVL(   2.0,"km");     // Water vapor scale height
  double         TLR=  -5.6      ;     // Tropospheric lapse rate (must be in K/km)
  Length      topAtm(  48.0,"km");     // Upper atm. boundary for calculations
  Pressure     Pstep(  10.0,"mb");     // Primary pressure step
  double   PstepFact=         1.2;     // Pressure step ratio between two consecutive layers

  return pAtmProf(new AtmProfile(Alt,
				 P,
				 T,
				 TLR,
				 H,
				 WVL,
				 Pstep,
				 PstepFact,
				 topAtm, 
				 atmType));
}

void dispersive(double freq,
		double ghum)
{
  pAtmProf atmo(simpleAOSAtmo(ghum));

  atm::Frequency  afreq(freq,
			"GHz");

  atm::RefractiveIndexProfile rip(afreq,
				  *atmo);
  
  std::cout<<"Freq"
	   <<"\t"
	   <<"Wet Non-Disp"
	   <<"\t\t"
	   <<"Wet Disp" 
	   <<"\t\t"
	   <<"Dry Non-Disp"
	   <<std::endl;

  std::cout<<freq
	   <<"\t"
	   <<rip.getNonDispersiveWetPathLength().get()
	   <<"\t\t"
  	   <<rip.getDispersiveWetPathLength().get()
	   <<"\t\t"
	   <<rip.getNonDispersiveDryPathLength().get()
	   <<std::endl;
}

int main(int ac, char* av[])
{   
  using namespace boost::program_options;
  
  options_description desc("Allowed options");
  desc.add_options()
    ("help", "Produce this help message")
    ("freq", value<double>(), "Frequency at which to compute the dispersion (GHz)")
    ("ghum", value<double>(), "Relative humidity at ground level (percent)")
    ;

  variables_map vm;        
  store(parse_command_line(ac, av, desc), vm);
  notify(vm);    

  if (vm.count("help"))
  {
    std::cout<<"Compute dispersive delay in the atmosphere"
	     <<std::endl
	     <<std::endl
	     <<"This program is part of AATM version " + std::string(VERSION)
	     <<std::endl
	     <<"GPL license -- you have the right to the source code. See COPYING"
	     <<std::endl
	     <<std::endl
	     <<desc;
  }
  else
  {
    dispersive(vm["freq"].as<double>(),
	       vm["ghum"].as<double>()
	       );
  }
  
  return 0;
}