New orbit type

The place to discuss creating, porting and modifying Celestia's source code.
Guest

New orbit type

Post #1by Guest » 15.03.2002, 17:30

chris,
do you think it would be possible to add a new orbit type, well not really an orbit, more like a trajectory description that could be used to display probes like pioneer and voyager. what i am thinking is a descriptive file format which describes the orbital elements including time. there would be one descriptive file for each probe that would allow that craft to travel its actual journey. as long as you can provide the support for this file format then forum users can do the work of creating and posting them in much the same way as they do the spaceship models. this would allow probes like magellan and cassini to be added to celestia although you would always need to set your date to the right time to see them. basically they would only exist in real time and location. it would also mean that you could fly out and visit pioneer 10 still making it's way out of the solar system. it would also work well with the new phase-lock mode as you could ride along with the probes through all their complicated orbits and gravity assist manouvers. you could also follow apollo missions to the moon. hmmmm better stop ... getting carried away now

ron

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

SPICE

Post #2by hank » 15.03.2002, 18:03

Funny thing. I was just about to post the following information from a NASA website (http://pds.jpl.nasa.gov/new-naif.htm):
-----
Navigation and Ancillary Information Facility (NAIF)

The Navigation and Ancillary Information Facility (NAIF) Node of the Planetary Data System (PDS) is responsible for the design, implementation and operation of the SPICE information system. SPICE is a means for providing scientists with ancillary observation geometry data and events, and related tools, useful in the planning and interpretation of science instrument observations returned from planetary spacecraft.

The SPICE acronym comes from:
S - Spacecraft
P - Planet
I - Instrument
C - "C-matrix"
E - Events

SPICE data files, called kernels, exist for spacecraft trajectory (S), planet, satellite, comet and asteroid ephemerides and associated physical and cartographic constants (P), instrument information, including mounting alignment and other relevant geometric information (I), orientation of spacecraft structures upon which science instruments are mounted (C); and spacecraft and ground data system events, both planned and unplanned (E).

The PDS NAIF node provides SPICE users a portable ANSI FORTRAN 77 or ANSI C toolkit that contains subroutines for retrieving data from each of the SPICE kernels, plus a wide assortment of geometry, math, and utility modules useful in computing instrument observation geometry parameters derived from those kernel data. Examples of the computations available with SPICE are range, optic axis intercept latitude and longitude, and phase, incidence, and emission angles. The SPICE Toolkit also includes utility and demonstration programs, and is accompanied by extensive user-focused documentation.

In some cases NAIF participates in the original generation of SPICE files for an active flight project. In other cases NAIF does not have this assignment and consequently may not have access to the mission operations SPICE data.

For all planetary missions the NAIF node of the PDS is responsible for archiving and distributing SPICE kernel files once they have been delivered by the project. NAIF also assembles and distributes generic planet, satellite, comet, and asteroid ephemeris files in SPICE format - these are used for a wide assortment of mission evaluation, observation planning and data analysis tasks. These generic ephemeris files are based on products provided by JPL's Solar System Dynamics Group.

While NASA's planetary missions were the original focus of SPICE development, today the system is being used, or considered for use, on flight projects in other disciplines (astrophysics, space physics and Earth science) and in other countries.

SPICE products are freely available to U.S. scientists and engineers participating in the flight projects and other activities of NASA. Non-U.S. scientists and engineers (except those in countries subject to U.S. State Department restrictions) are similarly invited to utilize SPICE components that have been published for general consumption.

Potential users are advised that programming and science/math skills at a college level are generally needed to utilize SPICE products. Users should have a computer with 50 Mbytes of available disk space (can be reduced after installation), at least 16 Mbytes of available RAM, and a compiler or 4th generation language that can link to either FORTRAN or C routines. (Resource requirements may vary from platform to platform, and depending on the user's application.) Internet ftp capability is usually needed to obtain the necessary SPICE components.

-----

Sounds like NASA provides not only the data files, but C routines to simplify their use. This could add some real "spice" to Celestia...

- Hank

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

New orbit type

Post #3by chris » 15.03.2002, 18:16

Anonymous wrote:chris,
do you think it would be possible to add a new orbit type, well not really an orbit, more like a trajectory description that could be used to display probes like pioneer and voyager. what i am thinking is a descriptive file format which describes the orbital elements including time. there would be one descriptive file for each probe that would allow that craft to travel its actual journey. as long as you can provide the support for this file format then forum users can do the work of creating and posting them in much the same way as they do the spaceship models. this would allow probes like magellan and cassini to be added to celestia although you would always need to set your date to the right time to see them. basically they would only exist in real time and location. it would also mean that you could fly out and visit pioneer 10 still making it's way out of the solar system. it would also work well with the new phase-lock mode as you could ride along with the probes through all their complicated orbits and gravity assist manouvers. you could also follow apollo missions to the moon. hmmmm better stop ... getting carried away now

ron

I just got this working in Celestia a couple days ago . . . I have the trajectories for Voyager 1 and 2, and I can follow them through the solar system, from Earth, to Jupiter, Saturn and beyond. It still needs some more work (better interpolation and a more compact file format), but you will definitely be able to follow at least the Voyager missions in Celestia 1.2.4.

--Chris

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

More on SPICE

Post #4by hank » 15.03.2002, 20:32

I did some further investigation of NASA's SPICE system and it's very exciting.

I'm not sure if it will be possible to integrate SPICE directly into Celestia, the main question being performance. If the SPICE code is fast enough to support Celestia's real-time needs, it should plug right in. (For example, once you've opened the SPICE files, there's one subroutine call to get the location of a specified object at a specified time). If it's not fast enough, we would have to extract the SPICE data offline into a Celestia-friendly format, but the SPICE C libraries should make writing a program to do that fairly easy, if it's necessary.

There appear to be SPICE data files available for lots of NASA (and non-NASA) spacecraft, including upcoming missions. Also, there's SPICE data for various solar system objects, including some asteroids and smaller moons of the outer planets.

The SPICE files generally are limited to specific time periods, so Celestia would need to support time-segmented path definitions. And I'm sure there are other technical challenges that would need to be overcome. Still, it looks very promising.

- Hank

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

More SPICE

Post #5by hank » 15.03.2002, 21:56

Another useful NASA site:

http://ssd.jpl.nasa.gov/horizons.html

-------

The JPL HORIZONS On-Line Solar System Data and Ephemeris Computation Service provides access to key solar system data and flexible production of highly accurate ephemerides for solar system objects (71000+ asteroids and comets, 91 natural satellites, 9 planets, the Sun). HORIZONS is provided by the Solar System Dynamics Group of the Jet Propulsion Laboratory.

Horizons is capable of generating SPK files for comets and asteroids.

An SPK file is a binary file which may be smoothly interpolated to retrieve an object's position and velocity at any instant within the file time-span. Such files may be used as input to visualization and mission design programs, allowing them to quickly retrieve accurate target body observation and data analysis ephemerides without having to repeatedly integrate equations of motion. An SPK file could be considered a "recording" of the integrator.

SPK stands for "Spacecraft and Planet Kernel". It is a file element of the SPICE system devised and maintained by the NAIF (Navigational and Ancillary Information Facility) team at JPL. SPK files may hold ephemerides for any kind of spacecraft, vehicle or solar system body, but the SPK files produced by Horizons are only for comets and asteroids.

Horizons allows a maximum of 20 small-bodies per SPK file. To construct an SPK for a comet or asteroid, Horizons integrates the object's trajectory over a user-specified time span greater than 32 days, but less than 25 years. The position components, at discrete steps, over some interval, are fit to a series of Chebyshev polynomials. When a users' application program reads the SPK file, the appropriate polynomials are accessed and interpolated to retrieve the requested state.

SPK files are capable of storing trajectory data with a fidelity greater than 1 millimeter (more accurately than should ever be required). In practice, it is the Chebyshev fit that determines how closely the SPK interpolation matches the integrator. The typical trade-off is that higher fidelity SPK files are obtained by fitting higher degree polynomials to smaller time intervals. The cost for increased accuracy is larger file size.

Choosing the best way to represent a trajectory in a file is complicated by the wide range of small-body orbits and anomalies such as close-approaches to major planets. Horizons seeks to strike a rough balance between file size and file fidelity, valuing fidelity more than file size.

---------

Obviously a very useful data source for a future SPICE-enabled version of Celestia...

- Hank

ron
Posts: 18
Joined: 25.02.2002
With us: 22 years 8 months
Location: Perth, Australia

Post #6by ron » 16.03.2002, 15:42

chris,

that is great that news that you are adding trajectory support. a few questions though.
1. are you coding specifically for the voyager probes or is the file format suitable for any probes.
2. how complicated and acurate is the file format, is it within the scope of users to modify for other probes.
3. does the file format store spacecraft orientation.

generally speaking how difficult is it to describe the path of a probe like voyager. is it ever going to be possible to describe the path of a spaceprobe like magellan which enters into a long preceeding polar orbit. this would look great in fast time as would probes which go on extended exploration of the jupiter and saturn moon systems.

there have been hundreds of missions and spacecraft when you include all the space capable nations. ideally i would like to see a mission browser (similiar to the existing solar system and star browser) which listed all the missions installed on your PC. when selected it would effectively change the date and time to the mission start date and time and execute a goto (usually to earth of course) so you can pick up the probe at it's missions begining.

the spice system mentioned by hank sounds very interesting but perhaps over complicated for celestia. Aslo i bet there will be no spice data for older probes like pioneer and voyager. perhaps a system that can use spice data when it is availible and a simpler celestia format when not would work .

ron

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

SPICE

Post #7by hank » 16.03.2002, 16:39

Ron said: "i bet there will be no spice data for older probes like pioneer and voyager".

Actually, there appears to be at least some SPICE trajectory data available for Voyagers 1 and 2, Pioneers 10 and 11 (also Pioneers 6 and 8), Mariners 9 and 10, and Vikings 1 and 2 (both orbiters and landers), among others.

- Hank

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #8by chris » 16.03.2002, 19:35

I've been reading the SPICE PDF . . . This looks like an incredible resource. Have you found the actual code and data files?

I'm not sure if we want to use the actual NASA code . . . I'd like to stick strictly to using GPL'd code. My feeling is that, at least for position information, all we need to do is read Chebyshev coefficients for the current time window and evaluate the polynomials. At least, that's how the JPL ephemeris files work . . .

--Chris

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

SPICE

Post #9by hank » 16.03.2002, 20:49

Yes, I found the code. It's at:

ftp://naif.jpl.nasa.gov/pub/naif/toolkit/C

I downloaded the MacPPC_C version and got it at least sort of working without too much trouble on MacOS X.

I also downloaded the SPK file for the Voyager 2 Jupiter encounter (about 900K). Here's what it contains, as reported by their "brief" tool:

Code: Select all

 Bodies: VOYAGER 2 (-32)         PLUTO BARYCENTER (9)    GANYMEDE (503)
        MERCURY BARYCENTER (1)  SUN (10)                CALLISTO (504)
        VENUS BARYCENTER (2)    MERCURY (199)           AMALTHEA (505)
        EARTH BARYCENTER (3)    VENUS (299)             THEBE (514)
        MARS BARYCENTER (4)     MOON (301)              ADRASTEA (515)
        JUPITER BARYCENTER (5)  EARTH (399)             METIS (516)
        SATURN BARYCENTER (6)   MARS (499)              JUPITER (599)
        URANUS BARYCENTER (7)   IO (501)
        NEPTUNE BARYCENTER (8)  EUROPA (502)
        Start of Interval (ET)              End of Interval (ET)
        --------------------------------    --------------------------------
        1979 JUN 08 00:00:50.184            1979 AUG 29 00:00:50.182


- Hank

Guest

Post #10by Guest » 17.03.2002, 05:09

Since SPICE seemed to be more or less working on my Mac, I went ahead and wrote a small program to animate the Voyager 2 Jupiter encounter using the SPK file. Very crude graphics, just dots projected on the ecliptic plane viewed from directly above Jupiter; but very cool to see the Galilean moons whirling around and Voyager 2 whizzing by.

Chris, I'd urge you to consider using the SPICE C library directly, at least initially. You can replace it later if necessary, but why rewrite a lot of code if you don't have to?

I'm not sure whether the license will be a problem; it could be that the SPICE license is LESS restrictive than the GPL, like the license for MIT's X Window System. It ought to be, since we (taxpayers) paid for it!

- Hank

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #11by chris » 18.03.2002, 18:03

Anonymous wrote:Chris, I'd urge you to consider using the SPICE C library directly, at least initially. You can replace it later if necessary, but why rewrite a lot of code if you don't have to?

I'm not sure whether the license will be a problem; it could be that the SPICE license is LESS restrictive than the GPL, like the license for MIT's X Window System. It ought to be, since we (taxpayers) paid for it!

I'm keenly aware of how easy it is to sink a lot of time into rewriting already working code. However, there are some compelling reasons to do so . . . First of all, most UNIX users build from source, and it would be a shame to force them to download the entire SPICE package in order be able track spacecraft trajectories. Second, it seems (and this may be very naive) that the amount of code required to compute spacecraft position is small. After skimming the tutorials, it appears that positions are computed from either Keplerian elements, Chebyshev polynomials, or Lagrange interpolation.

Also, I'd like to see if it's possible to create more compact files for spacecraft trajectories--it'd be nice to have the entire Cassini mission fit into a megabyte (probably not at full precision, but maybe 'good enough')

Anyhow, I'll be doing further investigation today . . .

--Chris

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

SPICE Code and Data for Celestia

Post #12by hank » 18.03.2002, 19:13

Chris,

I appreciate the advantages of code and data customized for Celestia's needs. It just seemed like it might be too much work. Hopefully I'm wrong about that. It's your call, of course.

As to what is "good enough" for Celestia, high-precision probably isn't too necessary during interplanetary cruise, but during close flybys I'd want to have sufficient accuracy for authentic views. That means not only spacecraft but also target bodies in reasonably correct locations, and also reasonably correct rotational positions for the target body so the right part of the surface is visible. Also, you'd probably need more precision for a NEAR flyby of asteroid Eros than for Galileo at Ganymede...

I'm glad you mentioned Cassini; the top of my wish list for Celestia is to be able to watch the view from the Cassini spacecraft in real-time as it arrives at Saturn in 2004...

- Hank


Return to “Development”