ARTS 2.5.4 (git: 31ce4f0e)
refraction.cc File Reference

Functions releated to calculation of refractive index. More...

#include "refraction.h"
#include <cmath>
#include "arts_constants.h"
#include "auto_md.h"
#include "matpack_complex.h"
#include "geodetic.h"
#include "interpolation.h"
#include "special_interp.h"
#include "check_input.h"
#include "arts_conversions.h"

Go to the source code of this file.

Functions

void complex_n_water_liebe93 (Matrix &complex_n, const Vector &f_grid, const Numeric &t)
 complex_n_water_liebe93 More...
 
void complex_n_ice_matzler06 (Matrix &complex_n, const Vector &f_grid, const Numeric &t)
 complex_n_ice_matzler06 More...
 
void get_refr_index_1d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r)
 get_refr_index_1d More...
 
void get_refr_index_2d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat)
 get_refr_index_2d More...
 
void get_refr_index_3d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat, const Numeric &lon)
 
void refr_gradients_1d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r)
 refr_gradients_1d More...
 
void refr_gradients_2d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, Numeric &dndlat, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat)
 refr_gradients_2d More...
 
void refr_gradients_3d (Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, Numeric &dndlat, Numeric &dndlon, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat, const Numeric &lon)
 refr_gradients_3d More...
 
void refractive_index_water_and_steam_VisNIR (Numeric &n, const Index &only_valid_range, const Numeric &frequency, const Numeric &temperature, const Numeric &density)
 Refractive index of water and steam for the optical and near infrared
. More...
 

Variables

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 
constexpr Numeric RAD2DEG =Conversion::rad2deg(1)
 
constexpr Numeric TEMP_0_C =Constant::temperature_at_0c
 

Detailed Description

Functions releated to calculation of refractive index.

Author
Patrick Eriksson Patri.nosp@m.ck.E.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2003-01-17

Definition in file refraction.cc.

Function Documentation

◆ complex_n_ice_matzler06()

void complex_n_ice_matzler06 ( Matrix complex_n,
const Vector f_grid,
const Numeric t 
)

complex_n_ice_matzler06

Complex refractive index of water ice according to Matzler 2006 (equivalent to Warren 2008).

The method treats pure water ice (no impurities like salt). Valid from 10 MHz up to 3 THz. Thus, not valid below 10 GHz. Follows the atmlab implementation, including some relaxation of upper temperature limit to 280K.

The output matrix has two columns, where column 0 is real part and column 1 is imaginary part; rows match f_grid.

Parameters
complex_nOut: Complex refractive index.
f_gridAs the WSV with the same name.
tTemperature
Author
Jana Mendrok
Date
2016-03-21

Definition at line 124 of file refraction.cc.

References b, beta, chk_if_in_range(), max, min, ConstVectorView::nelem(), Matrix::resize(), and sqrt().

Referenced by complex_refr_indexIceMatzler06().

◆ complex_n_water_liebe93()

void complex_n_water_liebe93 ( Matrix complex_n,
const Vector f_grid,
const Numeric t 
)

complex_n_water_liebe93

Complex refractive index of liquid water according to Liebe 1993.

The method treats liquid water without salt. Thus, not valid below 10 GHz. Upper frequency limit not known, here set to 1000 GHz. Model parameters taken from Atmlab function epswater93 (by C. Maetzler), which refer to Liebe 1993 without closer specifications.

Temperature must be between 0 and 100 degrees Celsius.

The output matrix has two columns, where column 0 is real part and column 1 is imaginary part. And rows matches f_grid.

Parameters
complex_nOut: Complex refractive index.
f_gridAs the WSV with the same name.
tTemperature
Author
Patrick Eriksson
Date
2003-08-15

Definition at line 74 of file refraction.cc.

References chk_if_in_range(), max, min, ConstVectorView::nelem(), Matrix::resize(), sqrt(), and TEMP_0_C.

Referenced by complex_refr_indexWaterLiebe93(), and ze_cfac().

◆ get_refr_index_1d()

void get_refr_index_1d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r 
)

get_refr_index_1d

Extracts the refractive index for 1D cases.

The function interpolates the atmospheric pressure and fields, and calls refr_index_air_agenda to determine the refractive index for the given point.

The atmosphere is given by its 1D view. That is, the latitude and longitude dimensions are removed from the atmospheric fields. For example, the temperature is given as a vector (the vertical profile).

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
Author
Patrick Eriksson
Date
2003-01-16

Definition at line 187 of file refraction.cc.

References gridpos(), interp(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ns, refr_index_air_agendaExecute(), and Vector::resize().

Referenced by ppath_step_refr_1d(), ppath_stepRefractionBasic(), raytrace_1d_linear_basic(), refr_gradients_1d(), and VectorZtanToZaRefr1D().

◆ get_refr_index_2d()

void get_refr_index_2d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r,
const Numeric lat 
)

get_refr_index_2d

Extracts the refractive index for 2D cases.

The function interpolates the atmospheric pressure and fields, and calls refr_index_air_agenda to determine the refractive index for the given point.

The atmosphere is given by its 2D view. That is, the longitude dimension is removed from the atmospheric fields. For example, the temperature is given as a matrix.

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
lat_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
latThe latitude of the position of interest.
Author
Patrick Eriksson
Date
2003-01-14

Definition at line 267 of file refraction.cc.

References gridpos(), interp(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ConstVectorView::nelem(), ns, refell2d(), refr_index_air_agendaExecute(), Vector::resize(), Matrix::resize(), and z_at_lat_2d().

Referenced by ppath_stepRefractionBasic(), raytrace_2d_linear_basic(), and refr_gradients_2d().

◆ get_refr_index_3d()

void get_refr_index_3d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r,
const Numeric lat,
const Numeric lon 
)

get_refr_index_3d

Extracts the refractive index for 3D cases.

The function interpolates the atmospheric pressure and fields, and calls refr_index_air_agenda to determine the refractive index for the given point.

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
lat_gridAs the WSV with the same name.
lon_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
latThe latitude of the position of interest.
lonThe longitude of the position of interest.
Author
Patrick Eriksson
Date
2003-01-17

Definition at line 360 of file refraction.cc.

References gridpos(), interp(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ConstVectorView::nelem(), ns, refell2d(), refr_index_air_agendaExecute(), Vector::resize(), Matrix::resize(), and z_at_latlon().

Referenced by ppath_stepRefractionBasic(), raytrace_3d_linear_basic(), and refr_gradients_3d().

◆ refr_gradients_1d()

void refr_gradients_1d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
Numeric dndr,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r 
)

refr_gradients_1d

Determines the refractive index, and its gradients, for the given position.

The gradients are calculated in pure numerical way. That is, the refractive index is calculated for slightly shifted radius or latitude and the difference to the refractive index at the given point determines the gradient.

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
dndrOutput: Radial gradient of refractive index.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
latThe latitude of the position of interest.
Author
Patrick Eriksson
Date
2003-01-14

Definition at line 457 of file refraction.cc.

References get_refr_index_1d().

Referenced by raytrace_1d_linear_basic().

◆ refr_gradients_2d()

void refr_gradients_2d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
Numeric dndr,
Numeric dndlat,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r,
const Numeric lat 
)

refr_gradients_2d

Determines the refractive index, and its gradients, for the given position.

The gradients are calculated in pure numerical way. That is, the refractive index is calculated for slightly shifted radius or latitude and the difference to the refractive index at the given point determines the gradient.

The latitude gradient is scaled with the radius to obtain the same unit ([1/m]) for both gradients. That is, the returned value is the change of the refractive index for a movement of 1m in the latitude direction.

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
dndrOutput: Radial gradient of refractive index.
dndlatOutput: Latitude gradient of refractive index.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
lat_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
latThe latitude of the position of interest.
Author
Patrick Eriksson
Date
2003-01-14

Definition at line 534 of file refraction.cc.

References DEG2RAD, Constant::e, and get_refr_index_2d().

Referenced by raytrace_2d_linear_basic().

◆ refr_gradients_3d()

void refr_gradients_3d ( Workspace ws,
Numeric refr_index_air,
Numeric refr_index_air_group,
Numeric dndr,
Numeric dndlat,
Numeric dndlon,
const Agenda refr_index_air_agenda,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid,
ConstVectorView  refellipsoid,
ConstTensor3View  z_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  f_grid,
const Numeric r,
const Numeric lat,
const Numeric lon 
)

refr_gradients_3d

Determines the refractive index, and its gradients, for the given position.

The gradients are calculated in pure numerical way. That is, the refractive index is calculated for slightly shifted radius, latitude or longitude and the difference to the refractive index at the given point determines the gradient.

The latitude and longitude gradients are scaled with the (effective) radius to obtain the same unit ([1/m]) for all gradients. That is, the returned values are the change of the refractive index for a movement of 1m in the latitude or longitude direction.

Parameters
wsCurrent Workspace
refr_index_airOutput: As the WSV with the same name.
refr_index_air_groupOutput: As the WSV with the same name.
dndrOutput: Radial gradient of refractive index.
dndlatOutput: Latitude gradient of refractive index.
dndlonOutput: Longitude gradient of refractive index.
refr_index_air_agendaAs the WSV with the same name.
p_gridAs the WSV with the same name.
lat_gridAs the WSV with the same name.
lon_gridAs the WSV with the same name.
refellipsoidAs the WSV with the same name.
z_fieldAs the WSV with the same name.
t_fieldAs the WSV with the same name.
vmr_fieldAs the WSV with the same name.
f_gridAs the WSV with the same name.
rThe radius of the position of interest.
latThe latitude of the position of interest.
lonThe longitude of the position of interest.
Author
Patrick Eriksson
Date
2003-01-17

Definition at line 640 of file refraction.cc.

References DEG2RAD, Constant::e, and get_refr_index_3d().

Referenced by raytrace_3d_linear_basic().

◆ refractive_index_water_and_steam_VisNIR()

void refractive_index_water_and_steam_VisNIR ( Numeric n,
const Index only_valid_range,
const Numeric frequency,
const Numeric temperature,
const Numeric density 
)

Refractive index of water and steam for the optical and near infrared
.

From: Revised formulation for the Refractive Index of Water and Steam as a Function of Wavelength, Temperature and Density
Journal of Physical and Chemical Reference Data 27, 761 (1998); https://doi.org/10.1063/1.556029 27, 761
see also http://www.iapws.org/release.html

Parameters
[out]

refractive index

Parameters
[in]only_valid_rangeflag if true refractive index is calculated only within range of validity. If false no check is made, so you at your own risk.
[in]frequencyfrequency
[in]temperaturetemperature
[in]densitydensity of water or steam

Definition at line 738 of file refraction.cc.

References a, a1, a2, ARTS_USER_ERROR_IF, Constant::e, Conversion::freq2wavelen(), real(), sqrt(), and Conversion::wavelen2freq().

Referenced by complex_refr_indexWaterVisibleNIRHarvey98().

Variable Documentation

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 45 of file refraction.cc.

Referenced by refr_gradients_2d(), and refr_gradients_3d().

◆ RAD2DEG

constexpr Numeric RAD2DEG =Conversion::rad2deg(1)
inlineconstexpr

Definition at line 46 of file refraction.cc.

◆ TEMP_0_C

constexpr Numeric TEMP_0_C =Constant::temperature_at_0c
inlineconstexpr

Definition at line 47 of file refraction.cc.

Referenced by complex_n_water_liebe93().