astroFunctions
- astroFunctions.GregorianDate(JDE)[source]
Return the proleptic Gregorian calendar date containing a Julian date.
- Parameters:
JDE – Julian date in days within Gregorian years 1 through 9999
- Returns:
NumPy integer array
[year, month, day]
- astroFunctions.JulianDate(GDE)[source]
Convert a proleptic Gregorian calendar date to a Julian date.
- Parameters:
GDE –
[year, month, day]with integer year (1 through 9999) and month (1 through 12). The day may be a scalar or an array, with its fractional part measured from midnight.- Returns:
Julian date in days, as a scalar or an array matching the shape of the input days. Integer Julian dates denote noon.
- astroFunctions.RV2OE(mu, r_IJK, v_IJK)[source]
Convert an inertial Cartesian state to classical orbital elements.
- Parameters:
mu – positive gravitational parameter (L^3/s^2)
r_IJK – nonzero inertial position vector (L)
v_IJK – inertial velocity vector (L/s)
- Returns:
tuple
(a, e, i, Omega, omega, nu)withain L and angles in radians
Zero angular momentum gives
i = 0. A zero node vector defaultsOmegaandomegato zero, and zero eccentricity defaultsomegaandnuto zero. Legacy quadrant adjustments can express zero as2*pi. These placeholders can discard orientation information for singular orbits. Outside the radial case, the node and eccentricity tests use exact zeros.Motion is radial when the transverse speed is at most eight machine epsilons of the working precision times the total speed. Radial states have unit eccentricity and
nu = pi. Their semimajor axis is positive below escape speed and negative above it. For any state whose specific orbital energy is zero to roundoff, the parabolic convention isa = 0,e = 1.OE2RVdoes not reconstruct unit-eccentricity states. All inputs use a common working precision of at leastfloat64.
- astroFunctions.computeCOE(L, a, e, i, Omega, Pi)[source]
Convert mean planetary elements using the fifth-order equation of center.
- Parameters:
L – mean longitude in degrees
a – semimajor axis in astronomical units
e – dimensionless eccentricity
i – inclination in degrees
Omega – longitude of the ascending node in degrees
Pi – longitude of perihelion in degrees
- Returns:
tuple
(a, e, i, Omega, omega, nu)in the input reference frame, with semimajor axis in km and angles in radians. The last two angles are the argument of perihelion and the approximate true anomaly.
- astroFunctions.ephemeridesMeeus(JDE, celestialBody)[source]
Approximate heliocentric orbital elements in the mean ecliptic and equinox of J2000.0.
The planetary
*_RVhelpers use these elements to return positions in km and velocities in km/s.- Parameters:
JDE – Julian Ephemeris Day (TT), with J2000.0 at 2451545.0 days
celestialBody – uppercase planet name (VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE, or PLUTO)
- Returns:
tuple
(a, e, i, Omega, omega, nu)with semimajor axis in km, dimensionless eccentricity and angles in radians
- astroFunctions.exactGregorianDate(JD)[source]
Format the proleptic Gregorian date and time to whole seconds.
Fractional seconds are discarded. To recover a whole second that rounded down in a binary floating-point Julian date, the conversion allows a tolerance of half the spacing at the working precision (at least binary64). Decimal and rational inputs are treated as exact.
- Parameters:
JD – Julian date in days within Gregorian years 1 through 9999
- Returns:
String
[year, month, day, hour:minute:second]