Spice Orbits Issues

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
FarGetaNik M
Moderator
Posts: 432
Joined: 05.06.2012
With us: 6 years 2 months
Location: Germany

Spice Orbits Issues

Post #1by FarGetaNik » 25.08.2016, 20:40

So recently I wanted to implement spice orbits in Celestia step by step, since just dropping an ready-to-use addon in my installations seems to mess up the solar system. I'm using the data by John Van Vliet over at Celestial Matters: http://forum.celestialmatters.org/viewforum.php?f=18&sid=91a129f800436cfa0830103e5ae07c96 but adjust the ssc code for my needs. Using spice has some side effects, the orbits rendered seem odd, Celestia just connects th two end of an orbit at time of startup, sometimes in crazy ways, also not always the whole orbit is rendered. Giving Celestia some extra months for orbit renderering as John does it in his addons seems to have no effect. Sometimes it's no big deal, sometimes it pretty much makes it impossible to render the orbit:

Spice-orbits.jpg


But that's only cosmetic concern. Also orbits and labels don't seem to fade out.

The real problems are the timeline breaks. The planets also seem ok. But this doesn't work for all satellites. Some use a custum orbit, it should be possible to use it outside the Spice time frame, right? But the orbit frame is destroyed by the spice timeline (or the spice definition of the planet maybe?), I can't find a frame in which the moons orbit the right way. It is very apparent with Saturn's moons orbiting the ecliptic instead of the ring plane, with Jupiter's they are basically only shifted in phase. What kind of works is using a MeanEquator Frame, like:

Code: Select all

OrbitFrame   { MeanEquator   { Center "Sol/Saturn" Object "Sol/Saturn/Rhea"   } }

But try this with Hyperions precessing rotation (and adjust the code to object Hyperion) and enjoy a moon gone insane! :eek: Also it's spice rotation doesn't work and Hyperion isn't properly rendered anymore. I don't think anyone has a good rotation model for Hyperion, so I've gone back to the default precessing rotation.
Some custom rotations seem ok, but not for the small inner satellites. Here comes my old Nemesis again, how to define a proper BodyFrame to let a tidally locked satellite always face it's planet with its x-axis? :help: With a new elliptical orbit for every moon and timeline segment I'll have to find dozens of rotational offset values via try and error again if I don't find another solution :cry:

Added after 18 minutes 3 seconds:
Also note that I used the "Modify" command instead of "Replace" to avoid overwriting anything unwanted. I hope this makes no difference.

Avatar
Chuft-Captain
Posts: 1769
Joined: 18.12.2005
With us: 12 years 8 months

Post #2by Chuft-Captain » 25.08.2016, 21:42

FarGetaNik wrote:how to define a proper BodyFrame to let a tidally locked satellite always face it's planet with its x-axis?
eg.

Code: Select all

   BodyFrame
   {
      TwoVector
      {
         Center   "Sol/Earth/YourSatellite "
         Primary
         {
         Axis   "x"
         RelativePosition   { Target "Sol/Earth"}
         }
         Secondary
         {
         Axis   "y"
         RelativeVelocity   { Target "Sol/Earth"}
         }
      }
   }   
   FixedRotation   {}   
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Avatar
Topic author
FarGetaNik M
Moderator
Posts: 432
Joined: 05.06.2012
With us: 6 years 2 months
Location: Germany

Post #3by FarGetaNik » 25.08.2016, 22:10

Chuft-Captain, Thanks alot! This was bugging my for years! I've tried out different variations of the the TwoVector Frame, but it always resulted in an unexpected free rotation. It seems the FixedRotation does the trick :wink:

Added after 55 seconds:
Of course this does not show libration, but it's close enough for those regular inner satellites :smile:

Added after 10 hours 49 minutes:
Hm or does it? I'm getting mixed results here :think:

Avatar
John Van Vliet
Posts: 2707
Joined: 28.08.2002
With us: 15 years 11 months

Post #4by John Van Vliet » 26.08.2016, 18:09

spice and celestia do use different body frames
equator and ecliptic

the before and after spice do differ from the spice frame
and i am using the ssb as reference for the planets
then the planet bary for the moons ( except mars )

the difference for the geo and bary at mars is 23 cm. centimeters


the orbits for planets not being closed is the procession and change in time . For something like the Juno spacecraft
it is the change in orbit for jupiter insertion

one of the things i was hopping for on the celestialmatters forum was different approaches, the use of the SSB is not written in stone ( mostly) ,nor the the frame in reference from it .

i was hopping for more than ONE cook in the kitchen and there might be errors i missed .


the one big problem i have had is in the spice rotations for some things
planets and big moons and some asteroids are in the "pck00010.tpc" but this needs the current leapsecond file

and the Saturn spice is a bit out of date and i do need to update it.
i will have to look but i think in the last update i might not have updated the moos pre and post orbits seeing as they had not changed much

-- i did that with the current Pluto the orbits. The change is small in pre and post sipce , so i did not update it to the current values in horizons .

to put things a bit differently
" spice is like getting your head hit with a gold brick with a twist of lime wrapped around it "

AKA a "Pan Galactic Gargle Blaster "

EVERYTHING is in reference to the the branch in the "tree" under it , and so on and so on

this is easily seen in spacecraft
"juno_v08.tf"
-- text file
ftp://naif.jpl.nasa.gov/pub/naif/JUNO/kernels/fk/juno_v08.tf
the frames references


for planets and moons the frames are in "pck00010.tpc"
-- text file
ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00010.tpc

Avatar
Topic author
FarGetaNik M
Moderator
Posts: 432
Joined: 05.06.2012
With us: 6 years 2 months
Location: Germany

Post #5by FarGetaNik » 26.08.2016, 19:04

One little thing I noticed, speeding time up to fast causes fps drop - I assume Celestia is struggling loading the correct data from the huge bsp files?

I've redone the inner solar system and Jupiter since yesterday. I also modified the sun, since it wasn't touched by any file and I need that precicion for spacecraft reffered to sun. It seems to work for NASA crafts, but Rosetta data from Horizons makes it dive deep below Mars' surface :weirdface: Here my STC file (I assume it needs stc for the sun as a star, please correct me if I'm mistaken):

Code: Select all

Modify "Sol"
{
    Timeline
    [
   {   # Before SPICE
      OrbitBarycenter   "Solar System Barycenter"
      CustomOrbit   "vsop87-sun"
      Ending      "1550 01 01"
      UniformRotation
      {
         Period      609.12    # 25.38 days
         Inclination   7.25
         AscendingNode   75.77
         MeridianAngle   23.00   # standard meridian
      }
   }

   {   # Spice
      OrbitBarycenter   "Solar System Barycenter"
      Ending      "2650 01 01"

      SpiceOrbit
      {
         Kernel      "de430.bsp"
         Target      "10"
         Origin      "0"
         Period      12   # Jupiter period
         BoundingRadius   1e10
      }

      UniformRotation
      {
         Period      609.12    # 25.38 days
         Inclination   7.25
         AscendingNode   75.77
         MeridianAngle   23.00   # standard meridian
      }
   }

   {   # After SPICE
      OrbitBarycenter   "Solar System Barycenter"
      CustomOrbit   "vsop87-sun"
      UniformRotation
      {
         Period      609.12    # 25.38 days
         Inclination   7.25
         AscendingNode   75.77
         MeridianAngle   23.00   # standard meridian
      }
   }
    ]
}

John Van Vliet wrote:the use of the SSB is not written in stone ( mostly) ,nor the the frame in reference from it .

So I might as well use the sun as origin ("10" If reading the files correctly)? This is more appropriate (and accurate if my sun definition is wrong) for the inner planets, which are mostly influenced by the sun, not the outer planets.

For Mars, I was able to correct the Rotation of Phobos and Deimos with Chuft-Captains BodyFrame, they also show libration for some reason.
For Jupiter, I sacrificed the spice rotation in order to maintain the costum orbits of the galilean satellites and fix orbit frame for the rest.
I'm still working on Saturn, I might also sacrifice the spice rotation to maintain custom orbits, it's a huge mess right now.

John Van Vliet wrote:spice and celestia do use different body frames

I was guessing that this is the reason. It's too bad planets and moons use different timeframes for Spice, otherwise this problem wouldn't occur.

Avatar
Topic author
FarGetaNik M
Moderator
Posts: 432
Joined: 05.06.2012
With us: 6 years 2 months
Location: Germany

Post #6by FarGetaNik » 27.08.2016, 13:15

John Van Vliet wrote:the orbits for planets not being closed is the procession and change in time

I noticed I can adjust how the orbit is drawn by changing the spice period - values slightly smaller than the actual period result in a closed orbit with smaller artifacts. Still no idea why segments of spice orbits tend to fade out depending on distance and perspective, as seen in my screenshot.

Avatar
John Van Vliet
Posts: 2707
Joined: 28.08.2002
With us: 15 years 11 months

Post #7by John Van Vliet » 27.08.2016, 16:41

in that screenshot you have the orbit periods too short

this is the Earth part of one of the ssc's i use

Code: Select all

 Replace "Earth" "Sol"
   {
     Texture "Earth.ctx"
     NightTexture "EarthNight.ctx"
     NormalMap "EarthNormal.ctx"
     SpecularTexture "EarthSpec.png"
     SpecularColor [ 0.2 0.2 0.25 ]
     SpecularPower 18.0
     Oblateness 0.0034
     Radius 6378.140
     
     Atmosphere {
       Height 60
       Lower [ 0.43 0.52 0.65 ]
       Upper [ 0.26 0.47 0.84 ]
       Sky [ 0.20 0.4 0.8 ]
       Sunset [ 1.0 0.6 0.2 ]
       
       CloudHeight 20
       CloudSpeed 0
       CloudMap "EarthClouds.ctx"
       #CloudShadowDepth 15.0
       Mie 0.001
       MieAsymmetry -0.25
       Rayleigh [ 0.001 0.0025 0.006 ]
       MieScaleHeight 12
     }
     
     Timeline
     [
     # Before SPICE
     {
       BodyFrame { EquatorJ2000 { Center "Sol" } }
       Ending   "1550 02 27 00:00:00.000"  # add 2 month for orbit drawing   
       CustomOrbit "vsop87-earth"
       CustomRotation "iau-earth"
     }
     # SPICE
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Earth_bary"}}
       BodyFrame { EclipticJ2000 { Center "Sol" } }
       Ending    "2649 11 25 00:00:00.000"  # less 2 month for orbit
       SpiceOrbit
       {
         Kernel "de432.bsp"
         Target "399"
         Origin "3"
         Period 1
         BoundingRadius 1e10
       }     
       SpiceRotation
       {

          Kernel         [ "pck00010.tpc" "naif0011.tls" "earth_000101_160715_160424.bpc" "earth_fixed.tf"  ]
         # Frame               "IAU_EARTH"
          Frame                 "EARTH_FIXED"
       }     
     }   
     # After Spice
     {
       BodyFrame { EquatorJ2000 { Center "Sol" } }     
       CustomOrbit "vsop87-earth"
       CustomRotation "iau-earth"
     }   
    ]       
   }


for planets the " Period " is in earth YEARS , so for earth it is 1

Mercury is 0.2441
Venus is 0.615
Mars is 1.88

Avatar
Topic author
FarGetaNik M
Moderator
Posts: 432
Joined: 05.06.2012
With us: 6 years 2 months
Location: Germany

Post #8by FarGetaNik » 28.08.2016, 09:45

John Van Vliet wrote:in that screenshot you have the orbit periods too short

No that's not the case. In fact some were to long, thus the weird artifacts (like an orbit segment of Venus intersecting Mercury's orbit) I adjusted the peroids to these values, wich give me good orbit rendering:

Code: Select all

Mercury 0.24
Venus 0.61
Earth 1
Mars 1.86
Jupiter 11.86
Saturn 29.457

Here are 2 screenshot demontrating the problem: When zooming in, the orbits fade out from certain perspectives. It's very apparent for the inner planets. Jupiter, Saturn and all the satellites I've done so far are ok, some show this behavior as well, but not that dramatic.

spice-far.jpg
spice-close.jpg


Return to “Celestia Users”

Who is online

Users browsing this forum: 7 guests