padre_craft.orbit.orbit#

Functions

get_ephemeris_file([download_if_missing])

Get the path to the ephemeris file.

get_latest_tle()

Get the latest TLE in CSV format.

get_celestrak_url([format])

Returns the url for the PADRE orbit information from celestrak

Classes

PadreOrbit([tle_filename])

A class to load and calculate the orbit of the PADRE spacecraft.

class padre_craft.orbit.orbit.PadreOrbit(tle_filename=None)[source]#

A class to load and calculate the orbit of the PADRE spacecraft.

Parameters:

tle_filename (Path, str, or None) – Can parse CSV or standard TLE files. If given none, will download todays TLE from Celestrack

Raises:

ValueError – If does not recognize the TLE file or cannot download one if not given.

Examples

>>> from padre_craft.orbit import PadreOrbit
>>> from astropy.time import Time
>>> import astropy.units as u
>>> from padre_craft import _test_files_directory
>>> tle_filename = _test_files_directory / "20251219_padre_tle.csv"
>>> padre_orbit = PadreOrbit(tle_filename)
>>> padre_orbit.calculate(tstart=Time("2025-12-19T01:00"), tend=Time("2025-12-19T01:06"), dt=1 * u.min)
>>> padre_orbit.in_sun
array([ True,  True,  True,  True,  True,  True])
>>> padre_orbit.in_particles
array([False, False, False,  True,  True,  True])
>>> padre_orbit.good_flag
array([ True,  True,  True, False, False, False])
calculate(tstart: Time, tend: Time, dt=<Quantity 5. s>)[source]#

Calculates the position of PADRE in its orbit and associated parameters.

RaisesValueError

If start or end times are beyond 2 weeks from TLE epoch

plot_geolocation()[source]#
plot_state()[source]#

Plot the orbit state as a function of time.

padre_craft.orbit.orbit.get_celestrak_url(format='csv') str[source]#

Returns the url for the PADRE orbit information from celestrak

Raises:

ValueError – If format is not one recognized by Celestrak [JSON, CSV, TLE]

Returns:

url (str) – The url to download the celestrak orbit information

padre_craft.orbit.orbit.get_ephemeris_file(download_if_missing: bool = True) Path[source]#

Get the path to the ephemeris file. If it does not exist, download it from JPL and put it into the data directory

padre_craft.orbit.orbit.get_latest_tle() Path[source]#

Get the latest TLE in CSV format. If it does not exist, download it from Celestrak and put it into the data directory.

Returns:

tle_path – Path to the tle file