mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

Constants and macros available from The SOFA Library.


In general, these constants are provided through boost or mxlib with templatized functions/types.

Note
You should include SOFA via sofa.hpp, rather than the SOFA headers. In particular, this will remove the constant DC which collides with the Eigen library.

Macros

#define DPI   (3.141592653589793238462643)
 Pi (defined in the SOFA library sofam.h).
#define D2PI   (6.283185307179586476925287)
 2Pi (defined in the SOFA library sofam.h)
#define DR2D   (57.29577951308232087679815)
 Radians to degrees (defined in the SOFA library sofam.h).
#define DD2R   (1.745329251994329576923691e-2)
 Degrees to radians (defined in the SOFA library sofam.h).
#define DR2AS   (206264.8062470963551564734)
 Radians to arcseconds (defined in the SOFA library sofam.h).
#define DAS2R   (4.848136811095359935899141e-6)
 Arcseconds to radians (defined in the SOFA library sofam.h).
#define DS2R   (7.272205216643039903848712e-5)
 Seconds of time to radians (defined in the SOFA library sofam.h).
#define TURNAS   (1296000.0)
 Arcseconds in a full circle (defined in the SOFA library sofam.h).
#define DMAS2R   (DAS2R / 1e3)
 Milliarcseconds to radians (defined in the SOFA library sofam.h).
#define DTY   (365.242198781)
 Length of tropical year B1900 (days) (defined in the SOFA library sofam.h).
#define DAYSEC   (86400.0)
 Seconds per day. (defined in the SOFA library sofam.h).
#define DJY   (365.25)
 Days per Julian year (defined in the SOFA library sofam.h).
#define DJC   (36525.0)
 Days per Julian century (defined in the SOFA library sofam.h).
#define DJM   (365250.0)
 Days per Julian millennium (defined in the SOFA library sofam.h).
#define DJ00   (2451545.0)
 Reference epoch (J2000.0), Julian Date (defined in the SOFA library sofam.h).
#define DJM0   (2400000.5)
 Julian Date of Modified Julian Date zero (defined in the SOFA library sofam.h).
#define DJM00   (51544.5)
 Reference epoch (J2000.0), Modified Julian Date (defined in the SOFA library sofam.h).
#define DJM77   (43144.0)
 1977 Jan 1.0 as MJD (defined in the SOFA library sofam.h)
#define TTMTAI   (32.184)
 TT minus TAI (s) (defined in the SOFA library sofam.h).
#define DAU   (149597870e3)
 Astronomical unit (m) (defined in the SOFA library sofam.h).
#define CMPS   299792458.0
 Speed of light (m/s) (defined in the SOFA library sofam.h).
#define AULT   499.004782
 Light time for 1 au (s) (defined in the SOFA library sofam.h).
#define DC   (DAYSEC / AULT)
 Speed of light (AU per day) SEE BELOW.
#define ELG   (6.969290134e-10)
 L_G = 1 - d(TT)/d(TCG) (defined in the SOFA library sofam.h).
#define ELB   (1.550519768e-8)
 L_B = 1 - d(TDB)/d(TCB) (defined in the SOFA library sofam.h).
#define TDB0   (-6.55e-5)
 TDB (s) at TAI 1977/1/1.0 (defined in the SOFA library sofam.h).
#define SRS   1.97412574336e-8
 Schwarzschild radius of the Sun (au).
#define dint(A)
 dint(A) - truncate to nearest whole number towards zero (double) (defined in the SOFA library sofam.h)
#define dnint(A)
 dnint(A) - round to nearest whole number (double) (defined in the SOFA library sofam.h)
#define dsign(A, B)
 dsign(A,B) - magnitude of A with sign of B (double) (defined in the SOFA library sofam.h)
#define gmax(A, B)
 max(A,B) - larger (most +ve) of two numbers (generic) (defined in the SOFA library sofam.h)
#define gmin(A, B)
 min(A,B) - smaller (least +ve) of two numbers (generic) (defined in the SOFA library sofam.h)

Macro Definition Documentation

◆ AULT

#define AULT   499.004782

Light time for 1 au (s) (defined in the SOFA library sofam.h).

Definition at line 75 of file sofa_constants.h.

◆ CMPS

#define CMPS   299792458.0

Speed of light (m/s) (defined in the SOFA library sofam.h).

Definition at line 72 of file sofa_constants.h.

◆ D2PI

#define D2PI   (6.283185307179586476925287)

2Pi (defined in the SOFA library sofam.h)

Definition at line 15 of file sofa_constants.h.

◆ DAS2R

#define DAS2R   (4.848136811095359935899141e-6)

Arcseconds to radians (defined in the SOFA library sofam.h).

Definition at line 27 of file sofa_constants.h.

◆ DAU

#define DAU   (149597870e3)

Astronomical unit (m) (defined in the SOFA library sofam.h).

Definition at line 69 of file sofa_constants.h.

◆ DAYSEC

#define DAYSEC   (86400.0)

Seconds per day. (defined in the SOFA library sofam.h).

Definition at line 42 of file sofa_constants.h.

◆ DC

#define DC   (DAYSEC / AULT)

Speed of light (AU per day) SEE BELOW.

Though defined in the SOFA library sofam.h, this is undefined by sofa.hpp to avoid a collision with Eigen. You can use mx::astro::constants::c instead.

Definition at line 81 of file sofa_constants.h.

◆ DD2R

#define DD2R   (1.745329251994329576923691e-2)

Degrees to radians (defined in the SOFA library sofam.h).

Definition at line 21 of file sofa_constants.h.

◆ dint

#define dint ( A)
Value:
((A)<0.0?ceil(A):floor(A))

dint(A) - truncate to nearest whole number towards zero (double) (defined in the SOFA library sofam.h)

Definition at line 98 of file sofa_constants.h.

◆ DJ00

#define DJ00   (2451545.0)

Reference epoch (J2000.0), Julian Date (defined in the SOFA library sofam.h).

Definition at line 54 of file sofa_constants.h.

◆ DJC

#define DJC   (36525.0)

Days per Julian century (defined in the SOFA library sofam.h).

Definition at line 48 of file sofa_constants.h.

◆ DJM

#define DJM   (365250.0)

Days per Julian millennium (defined in the SOFA library sofam.h).

Definition at line 51 of file sofa_constants.h.

◆ DJM0

#define DJM0   (2400000.5)

Julian Date of Modified Julian Date zero (defined in the SOFA library sofam.h).

Definition at line 57 of file sofa_constants.h.

Referenced by mx::sys::ISO8601DateTimeStrMJD().

◆ DJM00

#define DJM00   (51544.5)

Reference epoch (J2000.0), Modified Julian Date (defined in the SOFA library sofam.h).

Definition at line 60 of file sofa_constants.h.

◆ DJM77

#define DJM77   (43144.0)

1977 Jan 1.0 as MJD (defined in the SOFA library sofam.h)

Definition at line 63 of file sofa_constants.h.

◆ DJY

#define DJY   (365.25)

Days per Julian year (defined in the SOFA library sofam.h).

Definition at line 45 of file sofa_constants.h.

◆ DMAS2R

#define DMAS2R   (DAS2R / 1e3)

Milliarcseconds to radians (defined in the SOFA library sofam.h).

Definition at line 36 of file sofa_constants.h.

◆ dnint

#define dnint ( A)
Value:
((A)<0.0?ceil((A)-0.5):floor((A)+0.5))

dnint(A) - round to nearest whole number (double) (defined in the SOFA library sofam.h)

Definition at line 101 of file sofa_constants.h.

◆ DPI

#define DPI   (3.141592653589793238462643)

Pi (defined in the SOFA library sofam.h).

Definition at line 12 of file sofa_constants.h.

◆ DR2AS

#define DR2AS   (206264.8062470963551564734)

Radians to arcseconds (defined in the SOFA library sofam.h).

Definition at line 24 of file sofa_constants.h.

◆ DR2D

#define DR2D   (57.29577951308232087679815)

Radians to degrees (defined in the SOFA library sofam.h).

Definition at line 18 of file sofa_constants.h.

◆ DS2R

#define DS2R   (7.272205216643039903848712e-5)

Seconds of time to radians (defined in the SOFA library sofam.h).

Definition at line 30 of file sofa_constants.h.

◆ dsign

#define dsign ( A,
B )
Value:
((B)<0.0?-fabs(A):fabs(A))

dsign(A,B) - magnitude of A with sign of B (double) (defined in the SOFA library sofam.h)

Definition at line 104 of file sofa_constants.h.

◆ DTY

#define DTY   (365.242198781)

Length of tropical year B1900 (days) (defined in the SOFA library sofam.h).

Definition at line 39 of file sofa_constants.h.

◆ ELB

#define ELB   (1.550519768e-8)

L_B = 1 - d(TDB)/d(TCB) (defined in the SOFA library sofam.h).

Definition at line 87 of file sofa_constants.h.

◆ ELG

#define ELG   (6.969290134e-10)

L_G = 1 - d(TT)/d(TCG) (defined in the SOFA library sofam.h).

Definition at line 84 of file sofa_constants.h.

◆ gmax

#define gmax ( A,
B )
Value:
(((A)>(B))?(A):(B))

max(A,B) - larger (most +ve) of two numbers (generic) (defined in the SOFA library sofam.h)

Definition at line 107 of file sofa_constants.h.

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid().

◆ gmin

#define gmin ( A,
B )
Value:
(((A)<(B))?(A):(B))

min(A,B) - smaller (least +ve) of two numbers (generic) (defined in the SOFA library sofam.h)

Definition at line 110 of file sofa_constants.h.

◆ SRS

#define SRS   1.97412574336e-8

Schwarzschild radius of the Sun (au).

= 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 (defined in the SOFA library sofam.h)

Definition at line 95 of file sofa_constants.h.

◆ TDB0

#define TDB0   (-6.55e-5)

TDB (s) at TAI 1977/1/1.0 (defined in the SOFA library sofam.h).

Definition at line 90 of file sofa_constants.h.

◆ TTMTAI

#define TTMTAI   (32.184)

TT minus TAI (s) (defined in the SOFA library sofam.h).

Definition at line 66 of file sofa_constants.h.

◆ TURNAS

#define TURNAS   (1296000.0)

Arcseconds in a full circle (defined in the SOFA library sofam.h).

Definition at line 33 of file sofa_constants.h.