atm_funcs.cc File Reference

This file contains the code of functions releated to atmospheric physics or geometry. More...

#include <math.h>
#include <stdexcept>
#include "arts.h"
#include "matpackI.h"
#include "messages.h"
#include "math_funcs.h"
#include "make_vector.h"

Go to the source code of this file.

Functions

void planck (MatrixView B, ConstVectorView f, ConstVectorView t)
 Calculates a blackbody radiation (the Planck function) matrix.
void planck (VectorView B, ConstVectorView f, Numeric t)
 Calculates the Planck function for a single temperature.
void invplanck (VectorView y, ConstVectorView f, ConstVectorView za)
 Converts a vector with radiances to Plack brightness temperatures.
void invrayjean (VectorView y, ConstVectorView f, ConstVectorView za)
 Converts a vector with radiances to Rayleigh-Jean brightness temperatures.
Numeric number_density (Numeric p, Numeric t)
 Calculates the number density (scalar version).
Vector number_density (ConstVectorView p, ConstVectorView t)
 Calculates the number density (vector version).
Numeric g_of_z (Numeric r_geoid, Numeric g0, Numeric z)
 Calculates the gravitational accelaration for a geometrical altitude.
Numeric g_of_lat (Numeric latitude)
 Calculates the gravitational accelaration for a geocentric latitude.
void rte_iterate (VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, ConstMatrixView s, const Index n_f)
 Performs a single iteration for RTE calculations (one zenith angle).
void rte (VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, ConstMatrixView s, ConstVectorView y_space, const Index ground, ConstVectorView e_ground, ConstVectorView y_ground)
 Performs the RTE calculations for one zenith angle.
void bl_iterate (VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, const Index n_f)
 Performs a single iteration for BL calculations (one zenith angle).
void bl (Vector &y, const Index start_index, const Index stop_index, ConstMatrixView tr, const Index ground, ConstVectorView e_ground)
 Performs the BL (transmission) calculations for one zenith angle.
void z2p (VectorView p, ConstVectorView z0, ConstVectorView p0, ConstVectorView z)
 Converts an altitude vector to pressures.
void interpp (VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
 Interpolates a vertical profile at a new set of pressures.
void interpp_cloud (VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
void interpp (MatrixView A, ConstVectorView p0, ConstMatrixView A0, ConstVectorView p)
 Interpolates a matrix, such as an absorption matrix, at a new set of pressures.
Numeric interpp (ConstVectorView p0, ConstVectorView x0, const Numeric p)
 Interpolates a vertical profile at one pressure level.
void interpz (VectorView x, ConstVectorView p0, ConstVectorView z0, ConstVectorView x0, ConstVectorView z)
 Interpolates a vertical profile at a new set of vertical altitudes.
Numeric interpz (ConstVectorView p0, ConstVectorView z0, ConstVectorView x0, const Numeric z)
 Interpolates a vertical profile at a single vertical altitude.
Numeric ztan_geom (const Numeric za, const Numeric z_plat, const Numeric r_geoid)
 Calculates the geometrical tangent altitude (no refraction).
Numeric n_for_z (const Numeric z, ConstVectorView p_abs, ConstVectorView z_abs, ConstVectorView refr_index, const Numeric atm_limit)
 Returns the refractive index for a vertical altitude.
Numeric refr_constant (const Numeric r_geoid, const Numeric za, const Numeric z_plat, ConstVectorView p_abs, ConstVectorView z_abs, const Numeric atm_limit, ConstVectorView refr_index)
 Determines the constant for a refractive LOS.
Numeric ztan_refr (const Numeric c, const Numeric za, const Numeric z_plat, const Numeric z_ground, ConstVectorView p_abs, ConstVectorView z_abs, ConstVectorView refr_index, const Numeric r_geoid)
 Calculates the tangent altitude with refraction.
void e_eq_water (VectorView e_eq, ConstVectorView t)
 Calculates the equilibrium water vapor pressure over liquid water.
void e_eq_ice (VectorView e_eq, ConstVectorView t)
 Calculates the equilibrium water vapor pressure over ice.

Variables

const Numeric DEG2RAD
const Numeric RAD2DEG
const Numeric PLANCK_CONST
const Numeric SPEED_OF_LIGHT
const Numeric BOLTZMAN_CONST


Detailed Description

This file contains the code of functions releated to atmospheric physics or geometry.

Author:
Patrick Eriksson
Date:
2000-09-18

Definition in file atm_funcs.cc.


Function Documentation

void bl ( Vector y,
const Index  start_index,
const Index  stop_index,
ConstMatrixView  tr,
const Index  ground,
ConstVectorView  e_ground 
)

Performs the BL (transmission) calculations for one zenith angle.

This function allows calculation of transmission spectra for single zenith angles in functions beside yBlXx.

Return values:
y the spectrum
Parameters:
start_index start index for the integration
stop_index stop index for the integration
Tr transmission matrix
ground flag/index for ground intersection
e_ground ground emissivity
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 560 of file atm_funcs.cc.

void bl_iterate ( VectorView  y,
const Index  start_index,
const Index  stop_index,
ConstMatrixView  tr,
const Index  n_f 
)

Performs a single iteration for BL calculations (one zenith angle).

The vector Y is not initilised, Y is multiplied with the obtained values. Note that only a single iteration is performed.

This function can be used to calculate transmissions for parts of the atmosphere.

Return values:
y the spectrum
Parameters:
start_index start index for the integration
stop_index stop index for the integration
Tr transmission matrix
S source function matrix
n_f number of frequencies
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 518 of file atm_funcs.cc.

void e_eq_ice ( VectorView  e_eq,
ConstVectorView  t 
)

Calculates the equilibrium water vapor pressure over ice.

Calculation is done using Sontag's formula. Sonntag, D., Advancements in the field of hygrometry, Meteorologische Zeitschrift, 3, 51-66, 1994.

Sontag's formula:

e_eq = exp( a/T + b + c*T + d*T^2 + e*log(T) )

Return values:
e_eq equilibrium water vapor pressure in [Pa]
Parameters:
t a temperature value in [K]
Author:
Mashrab Kuvatov
Date:
2003-12-08

Definition at line 1038 of file atm_funcs.cc.

void e_eq_water ( VectorView  e_eq,
ConstVectorView  t 
)

Calculates the equilibrium water vapor pressure over liquid water.

Calculation is done using Sontag's formula. Sonntag, D., Advancements in the field of hygrometry, Meteorologische Zeitschrift, 3, 51-66, 1994.

Sontag's formula:

e_eq = exp( a/T + b + c*T + d*T^2 + e*log(T) )

Return values:
e_eq equilibrium water vapor pressure in [Pa]
Parameters:
t a temperature value in [K]
Author:
Mashrab Kuvatov
Date:
2003-12-08

Definition at line 998 of file atm_funcs.cc.

Numeric g_of_lat ( Numeric  latitude  ) 

Calculates the gravitational accelaration for a geocentric latitude.

Returns:
the gravitational constant
Parameters:
lat geocentric latitude
Author:
Axel von Engeln
Date:
2003-07-24

Definition at line 340 of file atm_funcs.cc.

Numeric g_of_z ( Numeric  r_geoid,
Numeric  g0,
Numeric  z 
)

Calculates the gravitational accelaration for a geometrical altitude.

Returns:
the gravitational constant
Parameters:
r_geoid radius of the geoid
g0 the gravitational constant at the geoid surface
z geometrical altitude
Author:
Patrick Eriksson
Date:
2000-12-04

Definition at line 322 of file atm_funcs.cc.

Numeric interpp ( ConstVectorView  p0,
ConstVectorView  x0,
const Numeric  p 
)

Interpolates a vertical profile at one pressure level.

See the vector version.

Return values:
x output: the interpolated values at p
Parameters:
p0 original pressure grid
x0 the profile to be interpolated
p a pressure level
Author:
Patrick Eriksson
Date:
2000-12-04

Definition at line 739 of file atm_funcs.cc.

void interpp ( MatrixView  A,
ConstVectorView  p0,
ConstMatrixView  A0,
ConstVectorView  p 
)

Interpolates a matrix, such as an absorption matrix, at a new set of pressures.

A linear interpolation using log. pressure is applied. In Matlab notation, the following expression is used:

A = interp1(log(p0),A0,log(p),'linear')

Return values:
A output: the interpolated values at p
Parameters:
p0 original pressure grid
A0 the matrix to be interpolated
p new pressure grid
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 705 of file atm_funcs.cc.

void interpp ( VectorView  x,
ConstVectorView  p0,
ConstVectorView  x0,
ConstVectorView  p 
)

Interpolates a vertical profile at a new set of pressures.

A linear interpolation using log. pressure is applied. In Matlab notation, the following expression is used:

p = interp1(log(p0),x,log(p),'linear')

Return values:
x output: the interpolated values at p
Parameters:
p0 original pressure grid
x0 the profile to be interpolated
p new pressure grid
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 658 of file atm_funcs.cc.

void interpp_cloud ( VectorView  x,
ConstVectorView  p0,
ConstVectorView  x0,
ConstVectorView  p 
)

Definition at line 675 of file atm_funcs.cc.

Numeric interpz ( ConstVectorView  p0,
ConstVectorView  z0,
ConstVectorView  x0,
const Numeric  z 
)

Interpolates a vertical profile at a single vertical altitude.

NOTE!! Avoid to use this function, interpolation should mainly be done in pressure, that is, use interpp when possible.

This function uses z2p and interpp to make an interpolation for a vertical altitude.

Used mainly for LOS calculations with refraction.

Return values:
x output: the interpolated values at z
Parameters:
p0 original pressure grid
z0 original vertical altitude grid
x0 the profile to be interpolated
z new vertical altitude grid
Author:
Patrick Eriksson
Date:
2000-10-02

Definition at line 810 of file atm_funcs.cc.

void interpz ( VectorView  x,
ConstVectorView  p0,
ConstVectorView  z0,
ConstVectorView  x0,
ConstVectorView  z 
)

Interpolates a vertical profile at a new set of vertical altitudes.

NOTE!! Avoid to use this function, interpolation should mainly be done in pressure, that is, use interpp when possible.

This function uses z2p and interpp to make an interpolation for vertical altitudes.

Used mainly for LOS calculations with refraction.

Return values:
x output: the interpolated values at z
Parameters:
p0 original pressure grid
z0 original vertical altitude grid
x0 the profile to be interpolated
z new vertical altitude grid
Author:
Patrick Eriksson
Date:
2000-10-02

Definition at line 774 of file atm_funcs.cc.

void invplanck ( VectorView  y,
ConstVectorView  f,
ConstVectorView  za 
)

Converts a vector with radiances to Plack brightness temperatures.

Return values:
y spectrum vector
Parameters:
f frequencies
za zenith angles
Author:
Patrick Eriksson
Date:
2000-09-28

Definition at line 145 of file atm_funcs.cc.

void invrayjean ( VectorView  y,
ConstVectorView  f,
ConstVectorView  za 
)

Converts a vector with radiances to Rayleigh-Jean brightness temperatures.

Return values:
y spectrum vector
Parameters:
f frequencies
za zenith angles
Author:
Patrick Eriksson
Date:
2000-09-28

Definition at line 202 of file atm_funcs.cc.

Numeric n_for_z ( const Numeric  z,
ConstVectorView  p_abs,
ConstVectorView  z_abs,
ConstVectorView  refr_index,
const Numeric  atm_limit 
)

Returns the refractive index for a vertical altitude.

The refractive index is set to 1 if the given altitude is above the atmospheric limit.

Returns:
the refrcative index
Parameters:
z the vertical altitude
p_abs absorption pressure grid
z_abs absorption altitude grid
refr_index refrective index corresponding to p_refr
atm_limit the upper atmospheric limit
Author:
Patrick Eriksson
Date:
2001-02-18

Definition at line 871 of file atm_funcs.cc.

Vector number_density ( ConstVectorView  p,
ConstVectorView  t 
)

Calculates the number density (vector version).

Returns:
number density
Parameters:
p pressure
t temperature
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 291 of file atm_funcs.cc.

Numeric number_density ( Numeric  p,
Numeric  t 
)

Calculates the number density (scalar version).

Returns:
number density
Parameters:
p pressure
t temperature
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 270 of file atm_funcs.cc.

void planck ( VectorView  B,
ConstVectorView  f,
Numeric  t 
)

Calculates the Planck function for a single temperature.

Return values:
B output: the blackbody radiation
Parameters:
f a frequency grid
t a temperature value
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 114 of file atm_funcs.cc.

void planck ( MatrixView  B,
ConstVectorView  f,
ConstVectorView  t 
)

Calculates a blackbody radiation (the Planck function) matrix.

Each row of the returned matrix corresponds to a frequency, while each column corresponds to a temperature.

Return values:
B output: the blackbody radiation
Parameters:
f a frequency grid
t a temperature profile
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 75 of file atm_funcs.cc.

Numeric refr_constant ( const Numeric  r_geoid,
const Numeric  za,
const Numeric  z_plat,
ConstVectorView  p_abs,
ConstVectorView  z_abs,
const Numeric  atm_limit,
ConstVectorView  refr_index 
)

Determines the constant for a refractive LOS.

Calculates (Re+z)*n(z)*sin(theta) at the platform.

All observations geometries are handled. The variables za and z_plat shall be treated as the "zenith angle" and the vertical altitude of the lowest point of the LOS.

Returns:
LOS constant
Parameters:
r_geoid local geoid curvature
za zenith angle
z_plat platform altitude
p_abs absorption pressure grid
z_abs absorption altitude grid
atm_limit the upper atmospheric limit
refr_index refrective index corresponding to p_refr
Author:
Patrick Eriksson
Date:
2001-02-18

Definition at line 908 of file atm_funcs.cc.

void rte ( VectorView  y,
const Index  start_index,
const Index  stop_index,
ConstMatrixView  tr,
ConstMatrixView  s,
ConstVectorView  y_space,
const Index  ground,
ConstVectorView  e_ground,
ConstVectorView  y_ground 
)

Performs the RTE calculations for one zenith angle.

This function allows calculation of emission spectra for single zenith angles in function beside yRteXx.

Return values:
y the spectrum
Parameters:
start_index start index for the integration
stop_index stop index for the integration
Tr transmission matrix
S source function matrix
y_space intensity entering the atmosphre at start of LOS
ground flag/index for ground intersection
e_ground ground emissivity
y_ground ground blackbody radiation
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 433 of file atm_funcs.cc.

void rte_iterate ( VectorView  y,
const Index  start_index,
const Index  stop_index,
ConstMatrixView  tr,
ConstMatrixView  s,
const Index  n_f 
)

Performs a single iteration for RTE calculations (one zenith angle).

The vector Y is not initilised, the obtained values are added to Y. Note that only a single iteration is performed.

This function can be used to calculate emission spectra for parts of the atmosphere.

Return values:
y the spectrum
Parameters:
start_index start index for the integration
stop_index stop index for the integration
Tr transmission matrix
S source function matrix
n_f number of frequencies
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 386 of file atm_funcs.cc.

void z2p ( VectorView  p,
ConstVectorView  z0,
ConstVectorView  p0,
ConstVectorView  z 
)

Converts an altitude vector to pressures.

The log of the pressures are interpolated linearly. In Matlab notation:

p = exp(interp1(z0,log(p0),z,'linear'))

Return values:
p output: the pressures at z
Parameters:
z0 original altitude grid
p0 original pressure grid
z new altitude grid
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 621 of file atm_funcs.cc.

Numeric ztan_geom ( const Numeric  za,
const Numeric  z_plat,
const Numeric  r_geoid 
)

Calculates the geometrical tangent altitude (no refraction).

Returns:
the tangent altitude
Parameters:
za the angle between zenith and the LOS
z_plat the platform altitude
Author:
Patrick Eriksson
Date:
2000-04-08

Definition at line 839 of file atm_funcs.cc.

Numeric ztan_refr ( const Numeric  c,
const Numeric  za,
const Numeric  z_plat,
const Numeric  z_ground,
ConstVectorView  p_abs,
ConstVectorView  z_abs,
ConstVectorView  refr_index,
const Numeric  r_geoid 
)

Calculates the tangent altitude with refraction.

Returns:
the tangent altitude
Parameters:
c LOS constant
za the angle between zenith and the LOS
z_plat the platform altitude
z_ground the ground altitude
p_abs absorption pressure grid
z_abs absorption altitude grid
refr_index refrective index corresponding to p_abs
Author:
Patrick Eriksson
Date:
2000-10-02

Definition at line 940 of file atm_funcs.cc.


Variable Documentation


Generated on Wed Feb 4 08:17:22 2009 for ARTS by  doxygen 1.5.6