ARTS 2.5.0 (git: 9ee3ac6c)
Conversion Namespace Reference

Namespace containing several practical unit conversions, physical and mathematical. More...

Functions

template<class T >
constexpr auto deg2rad (T x) -> decltype(x *one_degree_in_radians)
 Converts degrees to radians. More...
 
template<class T >
constexpr auto rad2deg (T x) -> decltype(x/one_degree_in_radians)
 Converts radians to degrees. More...
 
template<class T >
auto cosd (T x) -> decltype(std::cos(deg2rad(x)))
 Returns the cosine of the deg2rad of the input. More...
 
template<class T >
auto sind (T x) -> decltype(std::sin(deg2rad(x)))
 Returns the sine of the deg2rad of the input. More...
 
template<class T >
auto tand (T x) -> decltype(std::tan(deg2rad(x)))
 Returns the tangent of the deg2rad of the input. More...
 
template<class T >
auto acosd (T x) -> decltype(rad2deg(std::acos(x)))
 Returns rad2deg of the arc-cosine of the input. More...
 
template<class T >
auto asind (T x) -> decltype(rad2deg(std::asin(x)))
 Returns rad2deg of the arc-sine of the input. More...
 
template<class T >
auto atand (T x) -> decltype(rad2deg(std::atan(x)))
 Returns rad2deg of the arc-tangent of the input. More...
 
template<class T1 , class T2 >
auto atan2d (T1 y, T2 x) -> decltype(rad2deg(std::atan2(y, x)))
 Returns rad2deg of the arc-tangent of inputs #T1/#T2
More...
 
template<class T >
constexpr auto kaycm2freq (T x) -> decltype(x *(100 *c))
 Conversion from Kayser wavenumber to Hz. More...
 
template<class T >
constexpr auto freq2kaycm (T x) -> decltype(x/(100 *c))
 Conversion from Hz to Kayser wavenumber. More...
 
template<class T >
constexpr auto angcm2freq (T x) -> decltype(kaycm2freq(inv_two_pi))
 Conversion from Angular wavenumber to Hz. More...
 
template<class T >
constexpr auto freq2angcm (T x) -> decltype(x/kaycm2freq(inv_two_pi))
 Conversion from Hz to Angular wavenumber. More...
 
template<class T >
constexpr auto angfreq2freq (T x) -> decltype(x *inv_two_pi)
 Conversion from Angular Hz to Hz. More...
 
template<class T >
constexpr auto freq2angfreq (T x) -> decltype(x *two_pi)
 Conversion from Hz to Angular Hz. More...
 
template<class T >
constexpr auto wavelen2freq (T x) -> decltype(c/x)
 Conversion from wavelength to Hz. More...
 
template<class T >
constexpr auto freq2wavelen (T x) -> decltype(c/x)
 Conversion from Hz to wavelength. More...
 
template<class T >
constexpr auto atm2pa (T x) -> decltype(x *101 '325.0)
 Conversion from Atm to Pa. More...
 
template<class T >
constexpr auto pa2atm (T x) -> decltype(x/101 '325.0)
 Conversion from Pa to Atm. More...
 
template<class T >
constexpr auto torr2pa (T x) -> decltype(x *atm2pa(1.0/760.0))
 Conversion from Torr to Pa. More...
 
template<class T >
constexpr auto pa2torr (T x) -> decltype(x/atm2pa(1.0/760.0))
 Conversion from Pa to Torr. More...
 
template<class T >
constexpr auto mhz_per_torr2hz_per_pa (T x) -> decltype(x *pa2torr(1e6))
 Conversion from MHz/Torr to Hz/Pa. More...
 
template<class T >
constexpr auto celsius2kelvin (T x) -> decltype(x+273.15)
 Conversion from C to K. More...
 
template<class T >
constexpr auto kelvin2celsius (T x) -> decltype(x - 273.15)
 Conversion from K to C. More...
 
template<class T >
constexpr auto kaycm_per_cmsquared2hz_per_msquared (T x) -> decltype(x *kaycm2freq(1e-4))
 Conversion from cm-1 per molecule per cm^2 to Hz per molecule per m^2. More...
 
template<class T >
constexpr auto hz_per_msquared2kaycm_per_cmsquared (T x) -> decltype(x *freq2kaycm(1e4))
 Conversion from Hz per molecule per m^2 to cm-1 per molecule per cm^2. More...
 
template<class T >
constexpr auto kaycm_per_atm2hz_per_pa (T x) -> decltype(x *kaycm2freq(pa2atm(1)))
 Conversion from cm-1 per atmosphere to Hz per Pascal. More...
 
template<class T >
constexpr auto hz_per_pa2kaycm_per_atm (T x) -> decltype(x *freq2kaycm(atm2pa(1)))
 Conversion from Hz per Pascal to cm-1 per atmosphere. More...
 
template<class T >
constexpr auto kaycm2joule (T x) -> decltype(x *kaycm2freq(h))
 Conversion from cm-1 to Joule. More...
 
template<class T >
constexpr auto hz2joule (T x) -> decltype(x *h)
 Conversion from MHz to Joule. More...
 
template<class T >
constexpr auto mhz2joule (T x) -> decltype(hz2joule(x) *1e6)
 Conversion from MHz to Joule. More...
 
template<class T >
constexpr auto kelvin2joule (T x) -> decltype(x *k)
 Conversion from Kelvin to Joule. More...
 
template<class T >
constexpr auto joule2hz (T x) -> decltype(x/h)
 Conversion from Hz to Joule. More...
 
template<class T >
constexpr auto joule2kaycm (T x) -> decltype(x/kaycm2freq(h))
 Conversion from Joule to cm-1. More...
 
template<class T >
constexpr auto angstrom2meter (T x) -> decltype(x *1e-10)
 Conversion from Å to meter. More...
 
template<class T >
constexpr auto meter2angstrom (T x) -> decltype(x *1e10)
 Conversion from meter to Å More...
 

Detailed Description

Namespace containing several practical unit conversions, physical and mathematical.

Function Documentation

◆ acosd()

template<class T >
auto Conversion::acosd ( x) -> decltype(rad2deg(std::acos(x)))

Returns rad2deg of the arc-cosine of the input.

Definition at line 358 of file constants.h.

References rad2deg().

◆ angcm2freq()

template<class T >
constexpr auto Conversion::angcm2freq ( x) -> decltype(kaycm2freq(inv_two_pi))
constexpr

Conversion from Angular wavenumber to Hz.

Definition at line 394 of file constants.h.

◆ angfreq2freq()

template<class T >
constexpr auto Conversion::angfreq2freq ( x) -> decltype(x * inv_two_pi)
constexpr

Conversion from Angular Hz to Hz.

Definition at line 406 of file constants.h.

◆ angstrom2meter()

template<class T >
constexpr auto Conversion::angstrom2meter ( x) -> decltype(x * 1e-10)
constexpr

Conversion from Å to meter.

Definition at line 532 of file constants.h.

◆ asind()

template<class T >
auto Conversion::asind ( x) -> decltype(rad2deg(std::asin(x)))

Returns rad2deg of the arc-sine of the input.

Definition at line 364 of file constants.h.

References rad2deg().

◆ atan2d()

template<class T1 , class T2 >
auto Conversion::atan2d ( T1  y,
T2  x 
) -> decltype(rad2deg(std::atan2(y, x)))

Returns rad2deg of the arc-tangent of inputs #T1/#T2

Definition at line 376 of file constants.h.

References rad2deg().

◆ atand()

template<class T >
auto Conversion::atand ( x) -> decltype(rad2deg(std::atan(x)))

Returns rad2deg of the arc-tangent of the input.

Definition at line 370 of file constants.h.

References rad2deg().

◆ atm2pa()

template<class T >
constexpr auto Conversion::atm2pa ( x) -> decltype(x * 101'325.0)
constexpr

Conversion from Atm to Pa.

Definition at line 430 of file constants.h.

Referenced by hz_per_pa2kaycm_per_atm(), pa2torr(), test_hitran2017(), and torr2pa().

◆ celsius2kelvin()

template<class T >
constexpr auto Conversion::celsius2kelvin ( x) -> decltype(x + 273.15)
constexpr

Conversion from C to K.

Definition at line 460 of file constants.h.

◆ cosd()

template<class T >
auto Conversion::cosd ( x) -> decltype(std::cos(deg2rad(x)))

Returns the cosine of the deg2rad of the input.

Definition at line 340 of file constants.h.

References deg2rad().

Referenced by test18(), test19(), test20(), test21(), test23(), and test28().

◆ deg2rad()

template<class T >
constexpr auto Conversion::deg2rad ( x) -> decltype(x * one_degree_in_radians)
constexpr

Converts degrees to radians.

Definition at line 328 of file constants.h.

Referenced by cosd(), propmat_clearskyAddOnTheFlyLineMixingWithZeeman(), sind(), tand(), and zeeman_on_the_fly().

◆ freq2angcm()

template<class T >
constexpr auto Conversion::freq2angcm ( x) -> decltype(x / kaycm2freq(inv_two_pi))
constexpr

Conversion from Hz to Angular wavenumber.

Definition at line 400 of file constants.h.

◆ freq2angfreq()

template<class T >
constexpr auto Conversion::freq2angfreq ( x) -> decltype(x * two_pi)
constexpr

Conversion from Hz to Angular Hz.

Definition at line 412 of file constants.h.

◆ freq2kaycm()

template<class T >
constexpr auto Conversion::freq2kaycm ( x) -> decltype(x / (100 * c))
constexpr

Conversion from Hz to Kayser wavenumber.

Definition at line 388 of file constants.h.

Referenced by hz_per_msquared2kaycm_per_cmsquared(), hz_per_pa2kaycm_per_atm(), lm_hitran_2017::read(), and LineShape::si2cgs().

◆ freq2wavelen()

template<class T >
constexpr auto Conversion::freq2wavelen ( x) -> decltype(c / x)
constexpr

Conversion from Hz to wavelength.

Definition at line 424 of file constants.h.

◆ hz2joule()

template<class T >
constexpr auto Conversion::hz2joule ( x) -> decltype(x * h)
constexpr

Conversion from MHz to Joule.

Definition at line 502 of file constants.h.

Referenced by mhz2joule().

◆ hz_per_msquared2kaycm_per_cmsquared()

template<class T >
constexpr auto Conversion::hz_per_msquared2kaycm_per_cmsquared ( x) -> decltype(x * freq2kaycm(1e4))
constexpr

Conversion from Hz per molecule per m^2 to cm-1 per molecule per cm^2.

Definition at line 478 of file constants.h.

References freq2kaycm().

Referenced by lm_hitran_2017::read().

◆ hz_per_pa2kaycm_per_atm()

template<class T >
constexpr auto Conversion::hz_per_pa2kaycm_per_atm ( x) -> decltype(x * freq2kaycm(atm2pa(1)))
constexpr

Conversion from Hz per Pascal to cm-1 per atmosphere.

Definition at line 490 of file constants.h.

References atm2pa(), and freq2kaycm().

◆ joule2hz()

template<class T >
constexpr auto Conversion::joule2hz ( x) -> decltype(x / h)
constexpr

Conversion from Hz to Joule.

Definition at line 520 of file constants.h.

◆ joule2kaycm()

template<class T >
constexpr auto Conversion::joule2kaycm ( x) -> decltype(x / kaycm2freq(h))
constexpr

Conversion from Joule to cm-1.

Definition at line 526 of file constants.h.

◆ kaycm2freq()

template<class T >
constexpr auto Conversion::kaycm2freq ( x) -> decltype(x * (100 * c))
constexpr

Conversion from Kayser wavenumber to Hz.

Definition at line 382 of file constants.h.

Referenced by lm_hitran_2017::calcw(), kaycm_per_atm2hz_per_pa(), and test_hitran2017().

◆ kaycm2joule()

template<class T >
constexpr auto Conversion::kaycm2joule ( x) -> decltype(x * kaycm2freq(h))
constexpr

Conversion from cm-1 to Joule.

Definition at line 496 of file constants.h.

Referenced by Absorption::LineMixing::LinearRovibErrorCorrectedSudden::erot_selection().

◆ kaycm_per_atm2hz_per_pa()

template<class T >
constexpr auto Conversion::kaycm_per_atm2hz_per_pa ( x) -> decltype(x * kaycm2freq(pa2atm(1)))
constexpr

Conversion from cm-1 per atmosphere to Hz per Pascal.

Definition at line 484 of file constants.h.

References kaycm2freq(), and pa2atm().

Referenced by ecs_dataAddRodrigues1997(), and lm_hitran_2017::read().

◆ kaycm_per_cmsquared2hz_per_msquared()

template<class T >
constexpr auto Conversion::kaycm_per_cmsquared2hz_per_msquared ( x) -> decltype(x * kaycm2freq(1e-4))
constexpr

Conversion from cm-1 per molecule per cm^2 to Hz per molecule per m^2.

Definition at line 472 of file constants.h.

Referenced by test_hitran2017().

◆ kelvin2celsius()

template<class T >
constexpr auto Conversion::kelvin2celsius ( x) -> decltype(x - 273.15)
constexpr

Conversion from K to C.

Definition at line 466 of file constants.h.

◆ kelvin2joule()

template<class T >
constexpr auto Conversion::kelvin2joule ( x) -> decltype(x * k)
constexpr

◆ meter2angstrom()

template<class T >
constexpr auto Conversion::meter2angstrom ( x) -> decltype(x * 1e10)
constexpr

Conversion from meter to Å

Definition at line 538 of file constants.h.

◆ mhz2joule()

template<class T >
constexpr auto Conversion::mhz2joule ( x) -> decltype(hz2joule(x) * 1e6)
constexpr

Conversion from MHz to Joule.

Definition at line 508 of file constants.h.

References hz2joule().

Referenced by Absorption::LineMixing::Makarov2020etal::erot().

◆ mhz_per_torr2hz_per_pa()

template<class T >
constexpr auto Conversion::mhz_per_torr2hz_per_pa ( x) -> decltype(x * pa2torr(1e6))
constexpr

Conversion from MHz/Torr to Hz/Pa.

Definition at line 454 of file constants.h.

References pa2torr().

◆ pa2atm()

template<class T >
constexpr auto Conversion::pa2atm ( x) -> decltype(x / 101'325.0)
constexpr

Conversion from Pa to Atm.

Definition at line 436 of file constants.h.

Referenced by kaycm_per_atm2hz_per_pa().

◆ pa2torr()

template<class T >
constexpr auto Conversion::pa2torr ( x) -> decltype(x / atm2pa(1.0 / 760.0))
constexpr

Conversion from Pa to Torr.

Definition at line 448 of file constants.h.

References atm2pa().

Referenced by mhz_per_torr2hz_per_pa().

◆ rad2deg()

template<class T >
constexpr auto Conversion::rad2deg ( x) -> decltype(x / one_degree_in_radians)
constexpr

Converts radians to degrees.

Definition at line 334 of file constants.h.

Referenced by acosd(), asind(), atan2d(), and atand().

◆ sind()

template<class T >
auto Conversion::sind ( x) -> decltype(std::sin(deg2rad(x)))

Returns the sine of the deg2rad of the input.

Definition at line 346 of file constants.h.

References deg2rad().

Referenced by test18(), test19(), test20(), test21(), test23(), and test28().

◆ tand()

template<class T >
auto Conversion::tand ( x) -> decltype(std::tan(deg2rad(x)))

Returns the tangent of the deg2rad of the input.

Definition at line 352 of file constants.h.

References deg2rad().

◆ torr2pa()

template<class T >
constexpr auto Conversion::torr2pa ( x) -> decltype(x * atm2pa(1.0 / 760.0))
constexpr

Conversion from Torr to Pa.

Definition at line 442 of file constants.h.

References atm2pa().

Referenced by main().

◆ wavelen2freq()

template<class T >
constexpr auto Conversion::wavelen2freq ( x) -> decltype(c / x)
constexpr

Conversion from wavelength to Hz.

Definition at line 418 of file constants.h.