I thought about and discarded the idea of using the object's name as the identifier in the ephemeris file. Using a separate field from the object's name gives us the flexibility to use a script specific name rather than being constrained by the identifier in the SPK file -- or other ephemeris source, if we add support for other types of precalculated ephemerides.
Another alternative is to associate the file with the SpacePoint, rather than with the propagator. We'd still need the identifier in this case, though. One other wrinkle -- if I'm reading the SPICE specs correctly, we also need to be able to identify a second ephem source for the location of the reference body (typically the Earth) for the SPICE based propagations at least, unless we can guarantee that that body is already in the SPICE file. (I'm deriving this from statements I'm reading that say that SPICE files give the location of one body with respect to another, so they need to be able to find both bodies in a SPICE compatible format at the desired epoch.) I'll call this second reference the SSEphem in the scripting below. If we take the "file on SpacePoint" approach, the scripting would be something like this:
- Code: Select all
Create Spacecraft Clementine
Clementine.EphemID = -40 % Clementine's NAIF ID
Clementine.Ephemeris = DSPSE.SPK
Clementine.SSEphem = SolarBodies.SPK
Create Asteroid Geographos
Geographos.EphemID = 2006513 % No clue about the real NAIF ID for Geographos...
Geographos.Ephemeris = DSPSE.SPK
Geographos.SSEphem = SolarBodies.SPK
Create Propagator prop
prop.type = SPICE
prop.StepSize = 300 % seconds
Create Variable i
For i = 0 : 2000
Propagate prop(Clementine, Geographos)
EndFor
I think I prefer associating the file with the propagator, though, like this:
- Code: Select all
Create Spacecraft Clementine
Clementine.EphemID = -40 % Clementine's NAIF ID
Create Asteroid Geographos
Geographos.EphemID = 2006513 % No clue about the real NAIF ID for Geographos...
Create Propagator prop
prop.type = SPICE
prop.StepSize = 300 % seconds
prop.Ephemeris = DSPSE.SPK
prop.SSEphem = SolarBodies.SPK
Create Variable i
For i = 0 : 2000
Propagate prop(Clementine, Geographos)
EndFor
One downside to this approach: if we set the ephem sources on the propagator, that forces a different propagator when propagating multiple spacecraft where they are all in different ephemeris files. For SPICE, though, there are tools to merge the SPK files together.