CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
astro::earth::refraction Namespace Reference

Namespaces

namespace  detail

Classes

struct  Params
 Atmospheric conditions for refraction calculations. More...

Enumerations

enum class  Model : uint8_t { BENNETT , SAEMUNDSSON }
 Atmospheric refraction model selector. More...

Functions

auto bennett (const toolbox::AngleDeg &apparent_alt) -> toolbox::AngleDeg
 Bennett's formula for atmospheric refraction from apparent altitude.
auto saemundsson (const toolbox::AngleDeg &true_alt) -> toolbox::AngleDeg
 Saemundsson's formula for atmospheric refraction from true (geometric) altitude.
auto at_horizon (const Params &params={}) -> toolbox::AngleDeg
 Compute the refraction at the apparent horizon (apparent altitude = 0°).

Variables

constexpr double NATIVE_TEMPERATURE_C
 Native temperature for the refraction models, in degrees Celsius.
constexpr double NATIVE_PRESSURE_HPA
 Native pressure for the refraction models, in hectopascals.
constexpr double NATIVE_TEMPERATURE_K
 The 283 K numerator in the T/P correction factor, derived from 10°C = 273 + 10 K.
constexpr double SAEMUNDSSON_HORIZON_TOL_DEG
 Iteration tolerance for Saemundsson's horizon refraction, in degrees.
constexpr std::size_t SAEMUNDSSON_HORIZON_MAX_ITER
 Maximum number of iterations for Saemundsson's horizon solve.

Enumeration Type Documentation

◆ Model

enum class astro::earth::refraction::Model : uint8_t
strong

Atmospheric refraction model selector.

Enumerator
BENNETT 
SAEMUNDSSON 

Function Documentation

◆ at_horizon()

auto astro::earth::refraction::at_horizon ( const Params & params = {}) ->toolbox::AngleDeg
inlinenodiscard

Compute the refraction at the apparent horizon (apparent altitude = 0°).

Parameters
paramsThe atmospheric conditions. Defaults to 15°C/1013.25 hPa/Bennett.
Returns
The horizon refraction, positive in degrees.
Note
For Bennett the apparent altitude is already 0°, so the formula can be evaluated directly. For Saemundsson the input is the true altitude, which at the apparent horizon equals −R; this function iterates R = apply_tp_correction(saemundsson(−R), params) to convergence.

◆ bennett()

auto astro::earth::refraction::bennett ( const toolbox::AngleDeg & apparent_alt) ->toolbox::AngleDeg
inlinenodiscard

Bennett's formula for atmospheric refraction from apparent altitude.

Parameters
apparent_altThe apparent altitude of the body (what an observer sees), in degrees.
Returns
The refraction angle in degrees (the formula yields a negligible negative value at exactly 90°).
Note
Meeus (16.3) gives the result in arcminutes for 10°C/1010 hPa. The returned value is the native (10°C/1010 hPa) refraction; at_horizon(Params) computes the T/P-corrected horizon refraction. The formula is valid for apparent altitudes in [0°, 90°] and becomes numerically unstable below about −2°.
See also
Jean Meeus, "Astronomical Algorithms", Second Edition, Chapter 16, Formula (16.3).

◆ saemundsson()

auto astro::earth::refraction::saemundsson ( const toolbox::AngleDeg & true_alt) ->toolbox::AngleDeg
inlinenodiscard

Saemundsson's formula for atmospheric refraction from true (geometric) altitude.

Parameters
true_altThe true geometric altitude of the body, in degrees.
Returns
The refraction angle in degrees (the formula yields a negligible negative value at exactly 90°).
Note
Meeus (16.4) gives the result in arcminutes for 10°C/1010 hPa. The returned value is the native (10°C/1010 hPa) refraction; at_horizon(Params) computes the T/P-corrected horizon refraction. The input is the geometric altitude (before refraction), opposite to Bennett. The formula is valid for true altitudes in [0°, 90°] and becomes numerically unstable below about −2°.
See also
Jean Meeus, "Astronomical Algorithms", Second Edition, Chapter 16, Formula (16.4).

Variable Documentation

◆ NATIVE_PRESSURE_HPA

double astro::earth::refraction::NATIVE_PRESSURE_HPA
inlineconstexpr

Native pressure for the refraction models, in hectopascals.

Note
Both Bennett (Meeus 16.3) and Saemundsson (Meeus 16.4) are tabulated for 10°C/1010 hPa.

◆ NATIVE_TEMPERATURE_C

double astro::earth::refraction::NATIVE_TEMPERATURE_C
inlineconstexpr

Native temperature for the refraction models, in degrees Celsius.

Note
Both Bennett (Meeus 16.3) and Saemundsson (Meeus 16.4) are tabulated for 10°C/1010 hPa.

◆ NATIVE_TEMPERATURE_K

double astro::earth::refraction::NATIVE_TEMPERATURE_K
inlineconstexpr

The 283 K numerator in the T/P correction factor, derived from 10°C = 273 + 10 K.

Note
The correction scales refraction by (P/1010) * (283/(273+T_c)).

◆ SAEMUNDSSON_HORIZON_MAX_ITER

std::size_t astro::earth::refraction::SAEMUNDSSON_HORIZON_MAX_ITER
inlineconstexpr

Maximum number of iterations for Saemundsson's horizon solve.

◆ SAEMUNDSSON_HORIZON_TOL_DEG

double astro::earth::refraction::SAEMUNDSSON_HORIZON_TOL_DEG
inlineconstexpr

Iteration tolerance for Saemundsson's horizon refraction, in degrees.