ARTS  1.0.222
Functions
atm_funcs.h File Reference

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

#include "matpackI.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. More...
 
void planck (VectorView B, ConstVectorView f, const Numeric t)
 Calculates the Planck function for a single temperature. More...
 
void invplanck (VectorView y, ConstVectorView f, ConstVectorView za)
 Converts a vector with radiances to Plack brightness temperatures. More...
 
void invrayjean (VectorView y, ConstVectorView f, ConstVectorView za)
 Converts a vector with radiances to Rayleigh-Jean brightness temperatures. More...
 
Numeric number_density (const Numeric p, const Numeric t)
 Calculates the number density (scalar version). More...
 
Vector number_density (ConstVectorView p, ConstVectorView t)
 Calculates the number density (vector version). More...
 
Numeric g_of_z (const Numeric r_geoid, const Numeric g0, const Numeric z)
 Calculates the gravitational accelaration for a geometrical altitude. More...
 
Numeric g_of_lat (const Numeric latitude)
 Calculates the gravitational accelaration for a geocentric latitude. More...
 
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). More...
 
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. More...
 
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). More...
 
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. More...
 
void z2p (VectorView p, ConstVectorView z0, ConstVectorView p0, ConstVectorView z)
 Converts an altitude vector to pressures. More...
 
void interpp (VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
 Interpolates a vertical profile at a new set of pressures. More...
 
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. More...
 
Numeric interpp (ConstVectorView p0, ConstVectorView x0, const Numeric p)
 Interpolates a vertical profile at one pressure level. More...
 
void interpz (VectorView x, ConstVectorView p0, ConstVectorView z0, ConstVectorView x0, ConstVectorView z)
 Interpolates a vertical profile at a new set of vertical altitudes. More...
 
Numeric interpz (ConstVectorView p0, ConstVectorView z0, ConstVectorView x0, const Numeric z)
 Interpolates a vertical profile at a single vertical altitude. More...
 
Numeric ztan_geom (const Numeric za, const Numeric z_plat, const Numeric r_geoid)
 Calculates the geometrical tangent altitude (no refraction). More...
 
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. More...
 
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. More...
 
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. More...
 
void e_eq_water (VectorView e_eq, ConstVectorView t)
 Calculates the equilibrium water vapor pressure over liquid water. More...
 
void e_eq_ice (VectorView e_eq, ConstVectorView t)
 Calculates the equilibrium water vapor pressure over ice. More...
 

Detailed Description

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

Author
Patrick Eriksson
Date
2000-09-18

Definition in file atm_funcs.h.

Function Documentation

◆ bl()

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
ythe spectrum
Parameters
start_indexstart index for the integration
stop_indexstop index for the integration
Trtransmission matrix
groundflag/index for ground intersection
e_groundground emissivity
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 560 of file atm_funcs.cc.

◆ bl_iterate()

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
ythe spectrum
Parameters
start_indexstart index for the integration
stop_indexstop index for the integration
Trtransmission matrix
Ssource function matrix
n_fnumber of frequencies
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 518 of file atm_funcs.cc.

◆ e_eq_ice()

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_eqequilibrium water vapor pressure in [Pa]
Parameters
ta temperature value in [K]
Author
Mashrab Kuvatov
Date
2003-12-08

Definition at line 1038 of file atm_funcs.cc.

◆ e_eq_water()

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_eqequilibrium water vapor pressure in [Pa]
Parameters
ta temperature value in [K]
Author
Mashrab Kuvatov
Date
2003-12-08

Definition at line 998 of file atm_funcs.cc.

◆ g_of_lat()

Numeric g_of_lat ( Numeric  latitude)

Calculates the gravitational accelaration for a geocentric latitude.

Returns
the gravitational constant
Parameters
latgeocentric latitude
Author
Axel von Engeln
Date
2003-07-24

Definition at line 340 of file atm_funcs.cc.

◆ g_of_z()

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_geoidradius of the geoid
g0the gravitational constant at the geoid surface
zgeometrical altitude
Author
Patrick Eriksson
Date
2000-12-04

Definition at line 322 of file atm_funcs.cc.

◆ interpp() [1/3]

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

Interpolates a vertical profile at one pressure level.

See the vector version.

Return values
xoutput: the interpolated values at p
Parameters
p0original pressure grid
x0the profile to be interpolated
pa pressure level
Author
Patrick Eriksson
Date
2000-12-04

Definition at line 739 of file atm_funcs.cc.

◆ interpp() [2/3]

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
Aoutput: the interpolated values at p
Parameters
p0original pressure grid
A0the matrix to be interpolated
pnew pressure grid
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 705 of file atm_funcs.cc.

◆ interpp() [3/3]

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
xoutput: the interpolated values at p
Parameters
p0original pressure grid
x0the profile to be interpolated
pnew pressure grid
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 658 of file atm_funcs.cc.

◆ interpp_cloud()

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

Definition at line 675 of file atm_funcs.cc.

◆ interpz() [1/2]

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
xoutput: the interpolated values at z
Parameters
p0original pressure grid
z0original vertical altitude grid
x0the profile to be interpolated
znew vertical altitude grid
Author
Patrick Eriksson
Date
2000-10-02

Definition at line 810 of file atm_funcs.cc.

◆ interpz() [2/2]

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
xoutput: the interpolated values at z
Parameters
p0original pressure grid
z0original vertical altitude grid
x0the profile to be interpolated
znew vertical altitude grid
Author
Patrick Eriksson
Date
2000-10-02

Definition at line 774 of file atm_funcs.cc.

◆ invplanck()

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

Converts a vector with radiances to Plack brightness temperatures.

Return values
yspectrum vector
Parameters
ffrequencies
zazenith angles
Author
Patrick Eriksson
Date
2000-09-28

Definition at line 145 of file atm_funcs.cc.

◆ invrayjean()

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

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

Return values
yspectrum vector
Parameters
ffrequencies
zazenith angles
Author
Patrick Eriksson
Date
2000-09-28

Definition at line 202 of file atm_funcs.cc.

◆ n_for_z()

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
zthe vertical altitude
p_absabsorption pressure grid
z_absabsorption altitude grid
refr_indexrefrective index corresponding to p_refr
atm_limitthe upper atmospheric limit
Author
Patrick Eriksson
Date
2001-02-18

Definition at line 871 of file atm_funcs.cc.

◆ number_density() [1/2]

Numeric number_density ( Numeric  p,
Numeric  t 
)

Calculates the number density (scalar version).

Returns
number density
Parameters
ppressure
ttemperature
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 270 of file atm_funcs.cc.

◆ number_density() [2/2]

Vector number_density ( ConstVectorView  p,
ConstVectorView  t 
)

Calculates the number density (vector version).

Returns
number density
Parameters
ppressure
ttemperature
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 291 of file atm_funcs.cc.

◆ planck() [1/2]

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
Boutput: the blackbody radiation
Parameters
fa frequency grid
ta temperature profile
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 75 of file atm_funcs.cc.

◆ planck() [2/2]

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

Calculates the Planck function for a single temperature.

Return values
Boutput: the blackbody radiation
Parameters
fa frequency grid
ta temperature value
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 114 of file atm_funcs.cc.

◆ refr_constant()

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_geoidlocal geoid curvature
zazenith angle
z_platplatform altitude
p_absabsorption pressure grid
z_absabsorption altitude grid
atm_limitthe upper atmospheric limit
refr_indexrefrective index corresponding to p_refr
Author
Patrick Eriksson
Date
2001-02-18

Definition at line 908 of file atm_funcs.cc.

◆ rte()

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
ythe spectrum
Parameters
start_indexstart index for the integration
stop_indexstop index for the integration
Trtransmission matrix
Ssource function matrix
y_spaceintensity entering the atmosphre at start of LOS
groundflag/index for ground intersection
e_groundground emissivity
y_groundground blackbody radiation
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 433 of file atm_funcs.cc.

◆ rte_iterate()

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
ythe spectrum
Parameters
start_indexstart index for the integration
stop_indexstop index for the integration
Trtransmission matrix
Ssource function matrix
n_fnumber of frequencies
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 386 of file atm_funcs.cc.

◆ z2p()

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
poutput: the pressures at z
Parameters
z0original altitude grid
p0original pressure grid
znew altitude grid
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 621 of file atm_funcs.cc.

◆ ztan_geom()

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
zathe angle between zenith and the LOS
z_platthe platform altitude
Author
Patrick Eriksson
Date
2000-04-08

Definition at line 839 of file atm_funcs.cc.

◆ ztan_refr()

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
cLOS constant
zathe angle between zenith and the LOS
z_platthe platform altitude
z_groundthe ground altitude
p_absabsorption pressure grid
z_absabsorption altitude grid
refr_indexrefrective index corresponding to p_abs
Author
Patrick Eriksson
Date
2000-10-02

Definition at line 940 of file atm_funcs.cc.