Object Timeline proposal

Discussion forum for Celestia developers; topics may only be started by members of the developers group, but anyone can post replies.
Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 3 months
Location: Seattle, Washington, USA

Re: Object Timeline proposal

Post #41by chris » 26.03.2008, 18:31

So I reworked your Galileo SSC file somewhat, and it seems to be working nicely. Here's what I've got:

Code: Select all

ReferencePoint "Jupiter_bary" "Sol"
{
    Beginning "1899 07 30 00:00"
    Ending    "2053 10 08 00:00"

    OrbitFrame { EclipticJ2000 { Center "SSB"}}

    SpiceOrbit
    {
        Kernel "de421.bsp"
        Target "5"
        Origin "0" 
        BoundingRadius 1e10
    }
}


# I thought putting in beginning statements might help, but that just made
# Celestia ignore what I put in the Timeline array.Modify "Jupiter" "Sol"

Modify "Jupiter" "Sol"
{
    Timeline
    [
    # Before Galileo
   {
        Ending "1972 01 02 00:00"

        CustomOrbit "vsop87-jupiter"

        BodyFrame { EquatorJ2000 { Center "Sol" } }
        CustomRotation "iau-jupiter"
    }
    # JUP256
    {
        Ending    "2000 01 02 00:00"

        OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter_bary"}}

        SpiceOrbit
        {
            Kernel "jup256.bsp"
            Target "599"
            Origin "5" 

            BoundingRadius 1e10
        }

        BodyFrame { EquatorJ2000 { Center "Sol" } }
        CustomRotation "iau-jupiter"
    }
       
    # JUP230
    {
        Ending    "2049 12 31 00:00"

        OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter_bary"}}

        SpiceOrbit
        {
            Kernel "jup230.bsp"
            Target "599"
            Origin "5" 

            BoundingRadius 1e10
        }

        BodyFrame { EquatorJ2000 { Center "Sol" } }
        CustomRotation "iau-jupiter"
    }
       
    # After Galileo
    {
        CustomOrbit "vsop87-jupiter"

        BodyFrame { EquatorJ2000 { Center "Sol" } }
        CustomRotation "iau-jupiter"
    }

    ]

}


I think that the bug was in the definition of JupSSBary: I was getting an error from SPICE saying that there wasn't enough information to compute the position of the solar system barycenter relative to the Sun. Celestia needs to be a bit smarter about automatically figuring out coverage windows from SPICE kernels. The good news is that JupSSBary is unnecessary: the position of the solar system barycenter is built in to Celestia. In fact, it's the origin of Celestia's coordinate system. Thus, the first change I made was to remove JupSSBary and make "SSB" ("Solar System Barycenter" would work too) the center of the orbit frame of Jupiter_bary.

The second change I made was to simplify Jupiter_bary. In Celestia, the ReferencePoint object is typically used to represent a barycenter--it's in almost all respects identical to an invisible planet. I imagine that you made the barycenter a planet and assigned it a radius so that you could check its location.

The last change I made was to change the BodyFrame and rotation models for Jupiter. In Celestia, the orientation of an object is the product of its rotation model and the orientation of its body frame. I've used the same body frame and rotation model for each phase of the timeline. The SVN revision of Celestia that you're using supports custom rotation models. The IAU rotation models for most of the major planets and moons in the solar system have been implemented, and they all give orientations in the J2000 Earth equatorial frame. Thus, I assigned each phase the rotation model "iau-jupiter" and the BodyFrame EquatorJ2000.

Hope this is helpful. If you don't mind, I'd like to use this code as an example in the documentation for Celestia timelines.

--Chris

volcanopele
Posts: 103
Joined: 05.02.2007
With us: 17 years 3 months

Re: Object Timeline proposal

Post #42by volcanopele » 26.03.2008, 20:37

I can't use BBCode in this part of the forum so I've posted my SSC file at http://pirlwww.lpl.arizona.edu/~perry/C ... alileo.ssc

Basically, Jupiter is fixed. Thank you for that. I tried applying similar changes to the Modify statements for the moons included in my ssc file, but the moons still freeze in their orbits when the spice kernel orbits kick in (and unfreeze when they are reverted in 2049).

I should have it posted in 10-15 minutes or so, but all the files used in this plugin will be up as http://pirlwww.lpl.arizona.edu/~perry/C ... rSpice.zip (BEWARE: 163 MB) if you need to look at the spice kernel files.

I really appreciate you going over this. I want to make are version of this for Jupiter and Saturn available for all.

volcanopele
Posts: 103
Joined: 05.02.2007
With us: 17 years 3 months

Re: Object Timeline proposal

Post #43by volcanopele » 26.03.2008, 22:12

I've updated the ssc to implement the IAU customrotation for the Galileans. They seem to rotate correctly, but they do not orbit correctly (or more accurately, at all)

Here are some screenshots illustrating the issues I am having. The first image should show the orbit of Jupiter in red and the moons in green. The second images are from above the Sun and show Jupiter's orbit in red (or it should) and other planets in blue.

March 26, 1949
http://pirlwww.lpl.arizona.edu/~perry/C ... 261949.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

March 26, 1973 (after Jupiter Spice orbit implemented, before Galileans and Amalthea, note that Jupiter's orbit disappears)
http://pirlwww.lpl.arizona.edu/~perry/C ... 261973.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

March 26, 1996 (after Galileans Spice orbits implemented, note that Galileans and Jupiter's orbits are no longer visible, other moons still use what's in Solarsys.ssc and are visible; Galileans frozen in their orbit around Jupiter; Jupiter continues to orbit the sun)
http://pirlwww.lpl.arizona.edu/~perry/C ... 261996.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

March 26, 1999 (after Galileans and Amalthea Spice orbits implemented, note that Galileans, Jupiter, and Amalthea's orbits are no longer visible, other moons still use what's in Solarsys.ssc and are visible; Galileans and Amalthea frozen in their orbit around Jupiter; Jupiter continues to orbit the sun)
http://pirlwww.lpl.arizona.edu/~perry/C ... 261999.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

March 26, 2008 (Galileans, Amalthea, and Jupiter now use Jup230.bsp, Galileans and Amalthea orbit still not shown and are still frozen in the same place; Jupiter's orbit still not shown, but still orbiting Sun)
http://pirlwww.lpl.arizona.edu/~perry/C ... 262008.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

March 26, 2053 (Now back to using VSOP, all orbits show up correctly, all moons unfrozen)
http://pirlwww.lpl.arizona.edu/~perry/C ... 262053.jpg
http://pirlwww.lpl.arizona.edu/~perry/C ... _orbit.jpg

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

Re: Object Timeline proposal

Post #44by chris » 26.03.2008, 22:45

I'm downloading the zip file now. I suspect that the missing orbits are a result of Jupiter being positioned relative to the SSB instead of the Sun. Those are treated as two different stars in Celestia; objects with orbits around two different stars have triggered other bugs in Celestia.

--Chris

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

Re: Object Timeline proposal

Post #45by chris » 26.03.2008, 23:34

I figured out what's happening. I was able to fix the problem by explicitly specifying a Beginning and Ending for the SPICE orbits. Note that this (some confusingly, I'll agree) has a slightly different meaning than Beginning/Ending for the timeline phase.

The ephemeris for Io appears in two SPICE kernels: jup230.bsp and galileo_traj.bsp According to the SPICE utility brief, the coverage in galileo_traj.bsp includes two different intervals:
1995 SEP 02 to 1995 NOV 20
1995 NOV 21 to 2003 SEP 30
The kernel jup230.bsp adds another interval:
2000 JAN 01 to 2050 JAN 01

SPICE maintains a single, global pool of kernels. The coverage from different SPK files gets combined (and where there's overlap, the most recently loaded kernel has priority.) The coverage for Io after loading both kernels is:
1995 SEP 02 to 1995 NOV 20
1995 NOV 21 to 2050 JAN 01

It's the gap of one day that's causing problems. A Celestia trajectory is only valid over a single continuous interval. When you don't specify an explicit Beginning/Ending for a SpiceOrbit, Celestia uses the coverage information from the kernel pool to determine what that interval is. And when there's more than one coverage interval for an object, the first range is selected--Sep-Nov 1995--making the SpiceOrbit useless outside that range. Now, Celestia should really be smarter and use the timeline phase begin and end times as a hint (a very good one :) ) for picking the coverage interval. But until I fix that, you can do one of two things:
- Fix the gap in the galileo_traj.bsp file, or
- Specify Beginning and Ending for all your SpiceOrbits.

This worked for me for the third phase of the Io timeline:

Code: Select all

    {
   OrbitFrame { EclipticJ2000 { Center "Sol/Jupiter_bary"}}
   BodyFrame { EquatorJ2000 { Center "Sol/Jupiter" } }
   Ending    "2049 12 31 00:00"

   SpiceOrbit
   {
      Kernel "jup230.bsp"
             Target "501"
                  Origin "5" 
      Period         1.769138
      Beginning "2000 01 02 00:00"
      Ending    "2049 12 31 00:00"

      BoundingRadius 1e10
   }
   }


--Chris

volcanopele
Posts: 103
Joined: 05.02.2007
With us: 17 years 3 months

Re: Object Timeline proposal

Post #46by volcanopele » 27.03.2008, 00:25

Woohoo! That works perfectly! I can now actually finish my Jupiter System/Galileo plugin and my Saturn System/Cassini plugin.

BTW, I think I know why Jupiter's orbit does not show up. According to the ssc, Jupiter is a "satellite" of the Jupiter system barycenter. So all its orbits would be tiny circles within Jupiter.

EDIT: Simulated the I24 encounter on Oct. 11, 1999. C/A distance was spot on (maybe an error of 1km, but that could be an error in my source for the C/A distance). C/A point was about 50 km to the south of what I was expecting from http://pirlwww.lpl.arizona.edu/missions ... ories.html , but again that could be an error in the source. Very happy with the result!

I will try to post a link to the completed plugin for Jupiter/Galileo tonight on the plugins forum.

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

Re: Object Timeline proposal

Post #47by chris » 27.03.2008, 00:48

volcanopele wrote:Woohoo! That works perfectly! I can now actually finish my Jupiter System/Galileo plugin and my Saturn System/Cassini plugin.

Cool! I'm very much looking forward to the Cassini and Galileo add-ons. Will you include the extended Cassini mission?

volcanopele wrote:BTW, I think I know why Jupiter's orbit does not show up. According to the ssc, Jupiter is a "satellite" of the Jupiter system barycenter. So all its orbits would be tiny circles within Jupiter.

Good one--that's got to be the reason the orbits aren't showing up. That's something I need to address Celestia. It's a problem with Pluto that many have complained about: because Pluto has an orbit defined relative to the Pluto-Charon barycenter, its orbit is just a tiny circle. I think that a decent workaround is to show the orbit of a barycenter when one of the child objects is a planet. Of course, you could set up your add-on such that the Jupiter system barycenter orbits Jupiter. It's slightly unintuitive, but it would work.

--Chris

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 48
With us: 17 years 4 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Object Timeline proposal

Post #48by CAP-Team » 16.04.2008, 09:44

I have a question.
If I use a timeline definition for an object when it is first initialized (for example Jupiter), and when adding spacecraft with spice kernels to celestia which also extend the period covered with kernels for that object, will the modify command modify the timeline to extend the period covered or will it replace the entire timeline with just the coverage which was added with the addon?
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build

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

Re: Object Timeline proposal

Post #49by chris » 16.04.2008, 15:09

CAP-Team wrote:I have a question.
If I use a timeline definition for an object when it is first initialized (for example Jupiter), and when adding spacecraft with spice kernels to celestia which also extend the period covered with kernels for that object, will the modify command modify the timeline to extend the period covered or will it replace the entire timeline with just the coverage which was added with the addon?

This is a good question.

The answer is that the new timeline completely replaces the old one. I'd like to encourage add-on creators to define the entire timeline within a single object definition. I think this will prevent more of the surprises that can already occur when the description of an object is spread across multiple files with Modify definitions. Also, there is a lot of behavior that would have to be precisely specified when merging timelines. For example, what happens when the timeline that you want to merge isn't contiguous with the existing timeline? And what about those cases when you do want to replace the existing timeline?

--Chris

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 48
With us: 17 years 4 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Object Timeline proposal

Post #50by CAP-Team » 19.04.2008, 23:08

Can anyone tell me what's wrong with this .ssc :

Code: Select all

"Cassini" "Sol"
{
  Class            "spacecraft"
  Mesh             "cassini.cmod"
  Radius                   0.011

  Beginning        "2004 07 17 12:00"
  Ending           "2004 12 01 12:00"

  Timeline
  [
    {
      Beginning         "2004 07 17 12:00"
      Ending            "2004 09 03 12:00"

      OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary" }}
      BodyFrame { EquatorJ2000 { Center "Sol/Saturn_bary" }}

      Orientation       [ 90 0 1 0 ]
      FixedRotation { }

      SpiceOrbit {
        Kernel          "041219R_SCPSE_04199_04247.bsp"
        Target          "-82"
        Origin          "6"
        Beginning       "2004 07 17 12:00:00.000"
        Ending          "2004 09 03 12:00:00.000"
        BoundingRadius  1e10
      }
    }

    {
      Beginning         "2004 09 03 12:00"
      Ending            "2004 12 01 12:00"

      OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary" }}
      BodyFrame { EquatorJ2000 { Center "Sol/Saturn_bary" }}

      Orientation       [ 90 0 1 0 ]
      FixedRotation { }

      SpiceOrbit {
        Kernel          "050105RB_SCPSE_04247_04336.bsp"
        Target          "-82"
        Origin          "6"
        Beginning       "2004 09 03 12:00:00.000"
        Ending          "2004 12 01 12:00:00.000"
        BoundingRadius  1e10
      }
    }
  ]
}


Using just the first part of the time line works fine, but adding a second part makes the object unselectable, hence there is an error.

I use SVR 4280. I checked and double checked all values, I don't understand why this isn't working..
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build

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

Re: Object Timeline proposal

Post #51by chris » 19.04.2008, 23:23

CAP-Team wrote:Can anyone tell me what's wrong with this .ssc :

Using just the first part of the time line works fine, but adding a second part makes the object unselectable, hence there is an error.

I use SVR 4280. I checked and double checked all values, I don't understand why this isn't working..

You can only specify a beginning for the first phase of a timeline. For all others, it is implicitly the ending of the previous phase.

--Chris

CAP-Team
Posts: 194
Joined: 27.12.2006
Age: 48
With us: 17 years 4 months
Location: Vriezenveen, the Netherlands
Contact:

Re: Object Timeline proposal

Post #52by CAP-Team » 20.04.2008, 09:44

Great, it's working now. :D
Windows 7 Ultimate x64, Intel Core i7 2600K 3.4 Ghz, 4 GB RAM, 120 GB SSD + 1 TB hdd, nVidia GTX460 1 GB, Celestia 1.6.0.xxxx
Download my latest SVN Build


Return to “Ideas & News”