Skip to content

Support several SPK ephemerides at once #6472

Open
@astrojuanlu

Description

The generic SPK files available at ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/, which are the most useful, usually refer to the barycenter of the planetary systems that have satellites, with the sole exception of the Earth.* For example, the README of DE430/431 states:

The offset between the location of the Mars barycenter and the Mars mass center is extremely
small--about 20 cm--so most SPICE users could use the Mars B.C. (4) instead of the Mars mass
center (499). But if you do wish or need to have the location of 499 available in your program,
you must also load a Mars satellite ephemeris such as mar097.bsp.

It would be nice to have the ability to load additional SPK files in case one wants to compute the position of other bodies, for instance those available here:

ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/

or even specific NASA missions:

ftp://naif.jpl.nasa.gov/pub/naif/MSL/kernels/spk/

I'm not sure what to do with the list of bodies given in solar_system.py though, perhaps it's better to leave that to the user.

https://github.com/astropy/astropy/blob/v2.0.1/astropy/coordinates/solar_system.py#L35-L48

P.S.: For some reason I still don't fully understand, some also distinguish between Mercury, Venus and their barycenters, although they have no natural satellites.

In [20]: solar_system_ephemeris.set("file:///tmp/de431_part-2.bsp")
Out[20]: <ScienceState solar_system_ephemeris: 'file:///tmp/de431_part-2.bsp'>

In [21]: print(solar_system_ephemeris.kernel)
File type DAF/SPK and format LTL-IEEE with 14 segments:
1721425.50..8000002.50  Venus Barycenter (2) -> Venus (299)
1721425.50..8000002.50  Mercury Barycenter (1) -> Mercury (199)
1721425.50..8000002.50  Earth Barycenter (3) -> Earth (399)
1721425.50..8000002.50  Earth Barycenter (3) -> Moon (301)
1721425.50..8000002.50  Solar System Barycenter (0) -> Sun (10)
1721425.50..8000002.50  Solar System Barycenter (0) -> Pluto Barycenter (9)
1721425.50..8000002.50  Solar System Barycenter (0) -> Neptune Barycenter (8)
1721425.50..8000002.50  Solar System Barycenter (0) -> Uranus Barycenter (7)
1721425.50..8000002.50  Solar System Barycenter (0) -> Saturn Barycenter (6)
1721425.50..8000002.50  Solar System Barycenter (0) -> Jupiter Barycenter (5)
1721425.50..8000002.50  Solar System Barycenter (0) -> Mars Barycenter (4)
1721425.50..8000002.50  Solar System Barycenter (0) -> Earth Barycenter (3)
1721425.50..8000002.50  Solar System Barycenter (0) -> Venus Barycenter (2)
1721425.50..8000002.50  Solar System Barycenter (0) -> Mercury Barycenter (1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions