ARTS 2.5.9 (git: 825fa5f2)
Legendre Namespace Reference

Classes

struct  ColatitudeConversion
 Converts latitude to co-latitude with a small distance from the poles and flags if this was activated. More...
 
struct  SphericalField
 Stores the up (U), south (S), east (E) values of a field relative to the sphere. More...
 

Typedefs

using MatrixOfSphericalField = Grid< SphericalField, 2 >
 Holds a SphericalField for multiple dimensions (radius times longitudes) More...
 

Functions

constexpr Numeric longitude_clamp (const Numeric lon)
 Clamps the longitude in the range [-180, 180) More...
 
std::pair< Matrix, Matrixschmidt (const Numeric theta, const Index nmax) ARTS_NOEXCEPT
 Returns the Schmidt normalized Lagrange polynominal and its derivative. More...
 
SphericalField schmidt_fieldcalc (const Matrix &g, const Matrix &h, const Numeric r0, const Numeric r, const Numeric lat, const Numeric lon) ARTS_NOEXCEPT
 Computes the spherical field. More...
 
MatrixOfSphericalField schmidt_fieldcalc (const Matrix &g, const Matrix &h, const Numeric r0, const Vector &r, const Numeric lat, const Vector &lon) ARTS_NOEXCEPT
 Computes the spherical field for many radius and longitudes. More...
 
std::array< Numeric, 3 > to_geodetic (const std::array< Numeric, 3 > xyz, const std::array< Numeric, 2 > ell) noexcept
 Computes the altitude, latitude and longitude in relation to the ellopsiod using non-iterative method. More...
 

Typedef Documentation

◆ MatrixOfSphericalField

Holds a SphericalField for multiple dimensions (radius times longitudes)

Definition at line 68 of file legendre.h.

Function Documentation

◆ longitude_clamp()

constexpr Numeric Legendre::longitude_clamp ( const Numeric  lon)
constexpr

Clamps the longitude in the range [-180, 180)

Definition at line 1998 of file legendre.cc.

References longitude_clamp().

Referenced by longitude_clamp(), and schmidt_fieldcalc().

◆ schmidt()

std::pair< Matrix, Matrix > Legendre::schmidt ( const Numeric  theta,
const Index  nmax 
)

Returns the Schmidt normalized Lagrange polynominal and its derivative.

The derivative is undefined if theta is 0 or pi, so the function cannot be called with these values

This function is taken from the implementation by Isabela de Oliveira Martins at https://github.com/de-oliveira/IsabelaFunctions/blob/master/IsabelaFunctions/fieldmodel.py (2021-05-06). It implements the calculations step-by-step, updating both main and derivative based on previous values.

Parameters
[in]thetaColatitude in radians
[in]nmaxMax number of n
Returns
The pair of (nmax+1) x (nmax+1) matrices, order: main and derivative

Definition at line 2023 of file legendre.cc.

References ARTS_ASSERT, N, Constant::pi, Math::pow2(), and sqrt().

Referenced by schmidt_fieldcalc().

◆ schmidt_fieldcalc() [1/2]

SphericalField Legendre::schmidt_fieldcalc ( const Matrix g,
const Matrix h,
const Numeric  r0,
const Numeric  r,
const Numeric  lat,
const Numeric  lon 
)

Computes the spherical field.

If latitude is beyond a limit, the longitude is set to zero and the latitude at the limit away from the pole is used. For these position, the absolute of the horizontal component is kept around in the south-facing component and the east-facing component is set to zero

The latitude limit is defined in the ColatitudeConversion struct.

The longitude is constrained to the range [-180, 180) to have consistent behavior at the daytime border.

This function is taken from the implementation by Isabela de Oliveira Martins at https://github.com/de-oliveira/IsabelaFunctions/blob/master/IsabelaFunctions/fieldmodel.py (2021-05-06).

Parameters
[in]gA N x N matrix of g-coefficients
[in]hA N x N matrix of h-coefficients
[in]r0The reference radius (spherical)
[in]rThe actual radius (spherical)
[in]latThe latitude (spherical)
[in]lonThe longitude (spherical)
Returns
A spherical field

Definition at line 2082 of file legendre.cc.

References ARTS_ASSERT, Conversion::cosd(), Legendre::SphericalField::E, longitude_clamp(), N, Legendre::SphericalField::S, schmidt(), Conversion::sind(), Legendre::SphericalField::total_horizontal(), and Legendre::SphericalField::U.

Referenced by IGRF::compute_impl(), and main().

◆ schmidt_fieldcalc() [2/2]

MatrixOfSphericalField Legendre::schmidt_fieldcalc ( const Matrix g,
const Matrix h,
const Numeric  r0,
const Vector r,
const Numeric  lat,
const Vector lon 
)

Computes the spherical field for many radius and longitudes.

See purely Numeric implementation for more information.

Parameters
[in]gA N x N matrix of g-coefficients
[in]hA N x N matrix of h-coefficients
[in]r0The reference radius (spherical)
[in]rThe actual radius (spherical)
[in]latThe latitude (spherical)
[in]lonThe longitude (spherical)
Returns
A spherical field

Definition at line 2134 of file legendre.cc.

References ARTS_ASSERT, Conversion::cosd(), Legendre::SphericalField::E, longitude_clamp(), N, Legendre::SphericalField::S, schmidt(), Conversion::sind(), Legendre::SphericalField::total_horizontal(), and Legendre::SphericalField::U.

◆ to_geodetic()

std::array< Numeric, 3 > Legendre::to_geodetic ( const std::array< Numeric, 3 >  xyz,
const std::array< Numeric, 2 >  ell 
)
noexcept

Computes the altitude, latitude and longitude in relation to the ellopsiod using non-iterative method.

Definition at line 2203 of file legendre.cc.

References a, Conversion::atan2d(), b, c, Math::pow2(), Math::pow3(), Math::pow4(), and sqrt().