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

Namespaces

namespace  algo1
namespace  algo2
namespace  algo3
namespace  algo4
namespace  algo5

Enumerations

enum class  Model : uint8_t {
  ALGO1 , ALGO2 , ALGO3 , ALGO4 ,
  ALGO5
}
 A selectable ΔT algorithm. More...

Functions

constexpr auto compute (const Model model, const double year) -> double
 Evaluate a selected ΔT model at a decimal Gregorian year.
constexpr auto compute (const double year) noexcept -> double
 Compute ΔT for a decimal Gregorian year using the default model.
constexpr auto compute (const Model model, const calendar::Datetime &dt) -> double
 Evaluate a selected ΔT model at a valid calendar datetime.
constexpr auto compute (const calendar::Datetime &dt) -> double
 Evaluate Algo 5 at a valid calendar datetime.
constexpr auto ut1_to_tt (const Model model, const calendar::Datetime &ut1_dt) -> calendar::Datetime
 Convert UT1 to TT with one ΔT evaluation at the UT1 datetime.
constexpr auto ut1_to_tt (const calendar::Datetime &ut1_dt) -> calendar::Datetime
 Convert a calendar::Datetime in UT1 to a new calendar::Datetime in TT.
constexpr auto tt_to_ut1 (const Model model, const calendar::Datetime &tt_dt) -> calendar::Datetime
 Convert TT to modelled UT1 with one ΔT evaluation at the TT datetime.
constexpr auto tt_to_ut1 (const calendar::Datetime &tt_dt) -> calendar::Datetime
 Convert a calendar::Datetime in TT to a new calendar::Datetime in UT1.

Variables

constexpr Model DEFAULT_MODEL
 Default for operations with a selectable ΔT model; fixed-Algo5 shortcuts stay fixed.
constexpr double ALGO1_START_JDE_TT
constexpr double ALGO3_END_JDE_TT
constexpr double ALGO4_END_JDE_TT

Detailed Description

This file computes ΔT (TT − UT1) and converts between the UT1 and TT time scales. The time scales (UT1, UTC, TT) and ΔT = TT − UT1 are defined in the Time Scales section of docs/DESIGN.md.

Enumeration Type Documentation

◆ Model

enum class astro::delta_t::Model : uint8_t
strong

A selectable ΔT algorithm.

Enumerator
ALGO1 
ALGO2 
ALGO3 
ALGO4 
ALGO5 

Function Documentation

◆ compute() [1/4]

auto astro::delta_t::compute ( const calendar::Datetime & dt) ->double
nodiscardconstexpr

Evaluate Algo 5 at a valid calendar datetime.

Returns
TT minus UT1, in seconds.
Exceptions
std::invalid_argumentIf the datetime is invalid.
Note
The TT/UT1 distinction in the datetime argument is ignored.

◆ compute() [2/4]

auto astro::delta_t::compute ( const double year) ->double
nodiscardconstexprnoexcept

Compute ΔT for a decimal Gregorian year using the default model.

Parameters
yearThe year, of double type. The year has fractional part, indicating the time elapsed in the year.
Returns
ΔT in seconds.

Algo5 is used for all finite years, with continuous joins and no upper year bound.

Example
compute(2005.99999999....) returns ΔT for the last moment of year 2005.
Example
compute(1984.0) returns ΔT for the first moment of year 1984.
Example
compute(2015.5) returns ΔT for the middle moment of year 2015 (roughly June 30/July 1).

◆ compute() [3/4]

auto astro::delta_t::compute ( const Model model,
const calendar::Datetime & dt )->double
nodiscardconstexpr

Evaluate a selected ΔT model at a valid calendar datetime.

Returns
TT minus UT1, in seconds; the sub-day fraction participates in the decimal year.
Exceptions
std::invalid_argumentIf the datetime or model is invalid, or the year leaves the model's domain.
Note
The TT/UT1 distinction in the datetime argument is ignored.

◆ compute() [4/4]

auto astro::delta_t::compute ( const Model model,
const double year )->double
nodiscardconstexpr

Evaluate a selected ΔT model at a decimal Gregorian year.

Returns
TT minus UT1, in seconds.
Exceptions
std::invalid_argumentIf the model is unknown or the year leaves its domain.
Note
Non-finite propagation and year limits depend on the selected model.

◆ tt_to_ut1() [1/2]

auto astro::delta_t::tt_to_ut1 ( const calendar::Datetime & tt_dt) ->calendar::Datetime
nodiscardconstexpr

Convert a calendar::Datetime in TT to a new calendar::Datetime in UT1.

Parameters
tt_dtThe datetime in TT.
Returns
The datetime in UT1.
Exceptions
std::invalid_argumentIf the datetime is invalid or the shift leaves the representable years.

◆ tt_to_ut1() [2/2]

auto astro::delta_t::tt_to_ut1 ( const Model model,
const calendar::Datetime & tt_dt )->calendar::Datetime
nodiscardconstexpr

Convert TT to modelled UT1 with one ΔT evaluation at the TT datetime.

Parameters
modelThe ΔT model.
tt_dtThe datetime in TT.
Returns
The datetime in UT1; this is a single shift, not an iterative inverse.
Exceptions
std::invalid_argumentIf the datetime or model is invalid, the shift leaves the representable years, or the datetime leaves the model's domain.

◆ ut1_to_tt() [1/2]

auto astro::delta_t::ut1_to_tt ( const calendar::Datetime & ut1_dt) ->calendar::Datetime
nodiscardconstexpr

Convert a calendar::Datetime in UT1 to a new calendar::Datetime in TT.

Parameters
ut1_dtThe datetime in UT1.
Returns
The datetime in TT.
Exceptions
std::invalid_argumentIf the datetime is invalid or the shift leaves the representable years.

◆ ut1_to_tt() [2/2]

auto astro::delta_t::ut1_to_tt ( const Model model,
const calendar::Datetime & ut1_dt )->calendar::Datetime
nodiscardconstexpr

Convert UT1 to TT with one ΔT evaluation at the UT1 datetime.

Parameters
modelThe ΔT model.
ut1_dtThe datetime in UT1.
Returns
The datetime in TT.
Exceptions
std::invalid_argumentIf the datetime or model is invalid, the shift leaves the representable years, or the datetime leaves the model's domain.

Variable Documentation

◆ ALGO1_START_JDE_TT

double astro::delta_t::ALGO1_START_JDE_TT
inlineconstexpr

◆ ALGO3_END_JDE_TT

double astro::delta_t::ALGO3_END_JDE_TT
inlineconstexpr

◆ ALGO4_END_JDE_TT

double astro::delta_t::ALGO4_END_JDE_TT
inlineconstexpr

◆ DEFAULT_MODEL

Model astro::delta_t::DEFAULT_MODEL
inlineconstexpr

Default for operations with a selectable ΔT model; fixed-Algo5 shortcuts stay fixed.