astroFunctions

astroFunctions.Earth_RV(JDE)[source]

return Earth (r,v)

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.Jupiter_RV(JDE)[source]

return Jupiter (r,v)

astroFunctions.Mars_RV(JDE)[source]

return Mars (r,v)

astroFunctions.Neptune_RV(JDE)[source]

return Neptune (r,v)

astroFunctions.OE2RV(mu, a, e, i, Omega, w, nu)[source]

OE to (r,v) conversion

astroFunctions.Pluto_RV(JDE)[source]

return Pluto (r,v)

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) with a in L and angles in radians

Zero angular momentum gives i = 0. A zero node vector defaults Omega and omega to zero, and zero eccentricity defaults omega and nu to zero. Legacy quadrant adjustments can express zero as 2*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 is a = 0, e = 1. OE2RV does not reconstruct unit-eccentricity states. All inputs use a common working precision of at least float64.

astroFunctions.Saturn_RV(JDE)[source]

return Saturn (r,v)

astroFunctions.Uranus_RV(JDE)[source]

return Uranus (r,v)

astroFunctions.Venus_RV(JDE)[source]

return Venus (r,v)

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 *_RV helpers 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]

astroFunctions.normalize(v)[source]

normalize a vector

astroFunctions.orbitalPeriod(a, mu)[source]

Return the orbit period

astroFunctions.orbitalSMA(P, mu)[source]

Return the semi-major axis

astroFunctions.rotationMatrix(alpha)[source]

Return the active rotation matrix about the positive z axis for alpha radians.