ARTS 2.5.11 (git: 725533f0)
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)
 

Functions

constexpr Numeric longitude_clamp (const Numeric lon)
 Clamps the longitude in the range [-180, 180)
 
std::pair< Matrix, Matrix > schmidt (const Numeric theta, const Index nmax) ARTS_NOEXCEPT
 Returns the Schmidt normalized Lagrange polynominal and its derivative.
 
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.
 
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.
 
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.
 

Typedef Documentation

◆ MatrixOfSphericalField

Holds a SphericalField for multiple dimensions (radius times longitudes)

Definition at line 25 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 20 of file legendre.cc.

References longitude_clamp().

Referenced by longitude_clamp(), schmidt_fieldcalc(), 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 45 of file legendre.cc.

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

Referenced by schmidt_fieldcalc(), and 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 104 of file legendre.cc.

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

Referenced by IGRF::compute_impl().

◆ 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 156 of file legendre.cc.

References ARTS_ASSERT, Conversion::cosd(), Legendre::SphericalField::E, longitude_clamp(), 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 231 of file legendre.cc.

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