A SPICE tutorial

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

A SPICE tutorial

Post #1by John Van Vliet » 22.09.2022, 12:45

Over the next month as i update my SPICE ssc files i will post an in-depth SPICE tutorial
( replacing the Celestialmatters one)

first up will be installing C-SPICE and then the barycenters , then the planets and moons


##########################################

You will need two programs from C-SPICE
"brief" and "ckbrief" , these read the metadata from the two spice kernels the orbit and the rotation kernels

You can get c-spice from here
https://naif.jpl.nasa.gov/pub/naif/toolkit/C/

download the archive for your OS
-- for linux install to /
the same for Apple
for Microsoft extract it to C://

next add the "exe" folder to your SYSTEM $PATH !!!!
use google for your OS on how to do this

for linux i made a text file called "/etc/profile.local" and added it to the existing paths in there

Code: Select all

 
PATH=$PATH:/DATA/SUSE/bin:/DATA/SUSE/lib64:/DATA/SUSE/cspice/exe:/DATA/SUSE/cspice/lib:/DATA/SUSE/cspice/include

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/DATA/SUSE/lib64:/DATA/SUSE/cspice/lib

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/DATA/SUSE/lib64/pkgconfig

export PATH LD_LIBRARY_PATH PKG_CONFIG_PATH


i also included the " $LD_LIBRARY_PATH" for the libs

on apple i think it is a bit simalure
on windows there is a GUI tool someplace in the system settings ( it has been 18 years since i used Microsoft)


.
Last edited by John Van Vliet on 11.10.2022, 20:06, edited 2 times in total.

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #2by John Van Vliet » 23.09.2022, 02:58

next up is the " Barycenter's "

do to changes in the read order of Celestia 1.7.0 for ssc and stc files
place the code for the barycenters at the TOP of your ssc file

i call mine " Solarsystem.SPICE.ssc"

next create a folder in the root Celestia install folder called " SpiceSolarSystem"
then add this to your "celestia.cfg"

-- for example --

Code: Select all

on about line 205
 
  ExtrasDirectories  [ "extras-standard" "extras" "/DATA/SUSE/SpiceSolarSystem/" ]




then in that folder make a folder called "data" , this is where the spice kernels go
them make a new text file called "Solarsystem.SPICE.ssc"

add the barycenters to that text file

Code: Select all

 ReferencePoint "Mercury_bary" "Sol"
  {
  Beginning      "1549 12 31 00:00:00.000 "
  Ending         "2650 01 25 00:00:00.000"
 
  OrbitFrame     { EclipticJ2000 { Center "SSB"}}
  Visible        true
  Clickable      true
 
  SpiceOrbit
  {
    Kernel       "de440.bsp" # https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets
    Target       "1"
    Origin       "0"
    Period        0.25
    BoundingRadius 1e10
    }
   }
 
  ReferencePoint "Venus_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"
     
      OrbitFrame     { EclipticJ2000 { Center "SSB"}}
      Visible        true
      Clickable      true
     
      SpiceOrbit
      {
        Kernel       "de440.bsp"
        Target       "2"
        Origin       "0"
        Period        1
        BoundingRadius 1e10
      }
    }
   
    ReferencePoint "Earth_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"
     
      OrbitFrame     { EclipticJ2000 { Center "SSB"}}
      Visible        true
      Clickable      true
         
      SpiceOrbit
      {
        Kernel       "de440.bsp"
        Target       "3"
        Origin       "0"
        Period        1
        BoundingRadius 1e10
      }     
    }
       
    ReferencePoint "Mars_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"
     
      OrbitFrame     { EclipticJ2000 { Center "SSB"}}
      Visible        true
      Clickable      true
      SpiceOrbit
      {
        Kernel       "de440.bsp"
        Target       "4"
        Origin       "0"
        Period        2
        BoundingRadius 1e10
      }
    }
       
    ReferencePoint "Jupiter_bary" "Sol"
    {   
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"
     
      OrbitFrame { EclipticJ2000 { Center "SSB"}}
      Visible true
      Clickable true
     
      SpiceOrbit
      {
        Kernel "de440.bsp"
        Target "5"
        Origin "0"
        Period  12
        BoundingRadius 1e10
      }     
    }
 
 ReferencePoint "Saturn_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"

      OrbitFrame { EclipticJ2000 { Center "SSB"}}
      Visible true
      Clickable true

      SpiceOrbit
      {
        Kernel "de440.bsp"
        Target "6"
        Origin "0"
        Period  12
        BoundingRadius 1e10
      }
    }

 ReferencePoint "Uranus_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"

      OrbitFrame { EclipticJ2000 { Center "SSB"}}
      Visible true
      Clickable true

      SpiceOrbit
      {
        Kernel "de440.bsp"
        Target "7"
        Origin "0"
        Period  12
        BoundingRadius 1e10
      }
    }

 ReferencePoint "Neptune_bary" "Sol"
    {
      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"

      OrbitFrame { EclipticJ2000 { Center "SSB"}}
      Visible true
      Clickable true

      SpiceOrbit
      {
        Kernel "de440.bsp"
        Target "8"
        Origin "0"
        Period  12
        BoundingRadius 1e10
      }
    }


now you will need to download the "de440.bsp" spice kernel, this is the barycenters for the planets

https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets

copy or move the de440.bsp file to the new "data" folder"
to READ the data about it run the "brief" program on it
-- brief is a TERMINAL program , there is NO gui
make sure you change directory to the data folder , then run

"brief -c de440.bsp"


Code: Select all


brief -c de440.bsp

### you should get this output ###

BRIEF -- Version 4.0.0, September 8, 2010 -- Toolkit Version N0066
 
 
Summary for: de440.bsp
 
Bodies: MERCURY BARYCENTER (1) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        VENUS BARYCENTER (2) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        EARTH BARYCENTER (3) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        MARS BARYCENTER (4) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        JUPITER BARYCENTER (5) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        SATURN BARYCENTER (6) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        URANUS BARYCENTER (7) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        NEPTUNE BARYCENTER (8) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        PLUTO BARYCENTER (9) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        SUN (10) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        MERCURY (199) w.r.t. MERCURY BARYCENTER (1)
        VENUS (299) w.r.t. VENUS BARYCENTER (2)
        MOON (301) w.r.t. EARTH BARYCENTER (3)
        EARTH (399) w.r.t. EARTH BARYCENTER (3)
        Start of Interval (ET)              End of Interval (ET)
        -----------------------------       -----------------------------
        1549 DEC 31 00:00:00.000            2650 JAN 25 00:00:00.000
 


from the brief output you can get the needed information for the ssc file
for example

Code: Select all

 MERCURY BARYCENTER (1) w.r.t. SOLAR SYSTEM BARYCENTER (0)
 

the w.r.t ( with respect to ) you get the " Origin "0" " entry
and from " 1549 DEC 31 00:00:00.000 2650 JAN 25 00:00:00.000 "
you get the :

Code: Select all

      Beginning      "1549 12 31 00:00:00.000"
      Ending         "2650 01 25 00:00:00.000"

dates


and that is it for the FIRST part , this is only for the barycenters

next will be the planets
Last edited by John Van Vliet on 28.09.2022, 01:41, edited 1 time in total.

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #3by John Van Vliet » 24.09.2022, 02:49

On to the planets

for Mercury , Venus , and the Earth the de440.bsp has the location data
For Mars you need " mar097.bsp " that is located here...

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

these cover the LOCATION only and not the spice ROTATION
for that you will need "pck00010.tpc" the rotation parameters

https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/

and this one "naif0012.tls" this is the leap second file

https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/

and last for the Earth " earth_fixed.tf"

https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/

Place these in the " data " folder


this is a copy of my spice ssc file for the inner planets , place this under the barycenters in the spice ssc file
--- and edit as you need for YOUR textures ---

I use the "timeline" option for before and after the spice location dates
you will notice that for " Phobos " and " Deimos " i am NOT using the vsop87 orbits .
I used the HORIZONS web site to get the orbits for the non spice part of the timeline
for moons you will need to use horizons so that the orbits will match up
https://ssd.jpl.nasa.gov/horizons/app.html#/


Code: Select all

 Replace "Mercury" "Sol"
 {
   Texture "Mercury.ctx"
   NormalMap "MercuryNormal.ctx"
   Radius 2440
   
   Timeline
   [
   # Before SPICE
   {
     
     BodyFrame { EquatorJ2000 { Center "Sol" } }
     Ending   "1550 02 27 00:00:00.000"  # add 2 months for orbit drawing
     CustomOrbit "vsop87-mercury"
     CustomRotation "iau-mercury"
   }
   # Spice
   {
     OrbitFrame { EclipticJ2000  { Center "Sol/Mercury_bary" }}
     BodyFrame  { EclipticJ2000 { Center "Sol"              }}
     Ending     "2649 10 25 00:00:00.000"  # less 2 month for orbit drawing
   
     
     SpiceOrbit
     {
       Kernel  "de440.bsp"
       Target  "199"
       Origin  "1"
       Period   0.2441  # earth years
       BoundingRadius 1e10
     }
     
     #CustomRotation "iau-mercury"
     SpiceRotation
     {
       Kernel
       [
       "pck00010.tpc"   # https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/
       "naif0012.tls"   # https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/
       ]
       Frame     "IAU_MERCURY" 
     }
     }
     # After SPICE
     {       
       BodyFrame { EquatorJ2000 { Center "Sol" } }
       CustomOrbit "vsop87-mercury"
       CustomRotation "iau-mercury"
     }
   ]
   Albedo            0.06
   }
   
 Replace "Venus" "Sol"
   {
     Texture "Venus.ctx"
   
     NormalMap "VenusNormal.ctx"
     HazeColor [ 0.23 0.18 0.2 ]
     HazeDensity 0.15
     SpecularColor [ 0.13 0.12 0.12 ]
     SpecularPower 2.5
     Radius 6052
     
     Atmosphere {
       Height 60
       Lower [ 0.8 0.7 0.5 ]
       Upper [ 0.6 0.6 0.6 ]
       Sky [ 0.8 0.8 0.5 ]
       Mie              0.001
       MieAsymmetry    -0.2
       Rayleigh   [ 0.00001 0.0 0.0 ]
       Absorption [ 0.00025 0.0003 0.0004 ]
       MieScaleHeight 60.0
       CloudMap "VenusClouds.png"
       CloudHeight 60
       CloudSpeed  90
     }
     
     Timeline
     [
     # Before SPICE
     {
       BodyFrame { EquatorJ2000 { Center "Sol" } }
       Ending   "1550 02 27 00:00:00.000"  # add 2 months for orbit drawing       
       CustomOrbit "vsop87-venus"
       CustomRotation "iau-venus"
     }
     # SPICE
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Venus_bary" }}
       BodyFrame  { EclipticJ2000 { Center "Sol"            }}     
       Ending     "2649 10 25 00:00:00.000"  # less 2 month for orbit
       
       SpiceOrbit
       {
         Kernel  "de440.bsp"
         Target  "299"
         Origin  "2"
    Period   0.615
         BoundingRadius 1e10
       }   
       #CustomRotation "iau-venus"

       SpiceRotation
        {
       Kernel    [ "pck00010.tpc"  "naif0012.tls"  ]
       Frame     "IAU_VENUS"
       }
     }   
     # After SPICE
     {
       BodyFrame { EquatorJ2000 { Center "Sol" } }     
       CustomOrbit "vsop87-venus"
       CustomRotation "iau-venus"
     }   
    ]     
   }
   
   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 2.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 10 25 00:00:00.000"  # less 2 month for orbit
       SpiceOrbit
       {
         Kernel "de440.bsp"
         Target "399"
         Origin "3"
         Period 1
         BoundingRadius 1e10
       }     
       SpiceRotation
       {

          Kernel       
          [
          "pck00010.tpc"
          "naif0012.tls"
          "earth_fixed.tf" # https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/
          ]
          Frame                 "EARTH_FIXED"
       }     
     }   
     # After Spice
     {
       BodyFrame { EquatorJ2000 { Center "Sol" } }     
       CustomOrbit "vsop87-earth"
       CustomRotation "iau-earth"
     }   
    ]       
   }
     
 Replace "Moon" "Sol/Earth"
   {
     Texture "MoonLRO-WAC.png"
     NormalMap "MoonNormalLRO_WAC.png"
     SpecularColor [ 0.16 0.16 0.17 ]
     SpecularPower 0.5
     Oblateness 0.002
     Radius 1737.4
     Timeline
     [
     # Before SPICE
     {     
       OrbitFrame { EquatorJ2000 { Center "Sol/Earth"}}
       BodyFrame  { EquatorJ2000 { Center "Sol/Earth"}}
       Ending   "1550 02 27 00:00:00.000"  # add 2 month for orbit drawing       
       CustomOrbit "moon"     
       CustomRotation "iau-moon"     
     }   
     # SPICE
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Earth_bary"}}
       BodyFrame  { EclipticJ2000 { Center "Sol/Earth"     }}     
       Ending     "2649 10 25 00:00:00.000"  # less 2 month for orbit
       
       SpiceOrbit
       {
         Kernel "de440.bsp"
         Target "301"
         Origin "3" 
         Period         27.321661       
         BoundingRadius 1e10
       }
       
       SpiceRotation
       {
         Kernel     
         [
         "pck00010.tpc"
         "naif0012.tls"
         
         ]
       
          Frame     "IAU_MOON"       
       }
     }   
     # After SPICE
     {
       OrbitFrame { EquatorJ2000 { Center "Sol/Earth"}}
       BodyFrame  { EquatorJ2000 { Center "Sol/Earth"}}
       CustomOrbit "moon"
       CustomRotation "iau-moon"     
     }
         ]       
         LunarLambert 1.0       
         Albedo           0.12       
   }
   
   ##############
   # Easter Egg #
   ##############
   Location "TMA-1" "Sol/Earth/Moon"
   {
     LongLat [ -10.52 -43.00 -1.5 ]
     Size 2.00
     Importance  5.0
     Type "AA"
   }


  ########################




 Replace "Mars" "Sol"
   {
     Texture "Mars.ctx"
     NormalMap "MarsNormal.ctx"
     #Color   [ 0.6 0.6 0.6 ]
     HazeColor [ 0.55 0.35 0.25 ]
     HazeDensity 0.25
     SpecularColor [ 0.2 0.19 0.19 ]
     SpecularPower 2.0
     Radius 3396 # equatorial
     Oblateness 0.0069
     
     Atmosphere {
       Height 30
       Lower [ 0.7 0.5 0.5 ]
       Upper [ 0.6 0.2 0.2 ]
       Sky [ 0.73 0.65 0.55 ]
       Sunset [ 0.6 0.6 0.7 ]
       # Slightly bluish sunset, as seen in true color pictures
       # from Pathfinder
       
       Mie 0.00015
       MieAsymmetry -0.25
       Rayleigh [ 0.00015 0.00011 0.00010 ]
       Absorption [ 0.000055 0.00030 0.00025 ]
       MieScaleHeight 30
     }
     
     Timeline
     [
     # Before Spice
     {
       CustomOrbit "vsop87-mars"
       Ending   "1900 02 04 00:00:00.000"  # add 2 month for orbit drawing
       BodyFrame { EquatorJ2000 { Center "Sol"} }
       CustomRotation "iau-mars"
     }
     # spice
     {
       OrbitFrame { EclipticJ2000  { Center "Sol/Mars_bary" }}
       BodyFrame  { EclipticJ2000 { Center "Sol"           }}
       Ending     "2099 10 03 00:00:00.000"  # less 2 month for orbit
       SpiceOrbit
       {
         Kernel "mar097.bsp"   # https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/
         Target "499"
         Origin "4"
         Period  1.88
         BoundingRadius 1e10
       }
       
       SpiceRotation
       {
         Kernel    [ "pck00010.tpc" "naif0012.tls" ]
         Frame       "IAU_MARS"       
       }
     }
     # After Spice
     {     
       CustomOrbit "vsop87-mars"
       BodyFrame { EquatorJ2000 { Center "Sol"} }
       CustomRotation "iau-mars"
     }
    ]
   }
   
 Replace "Phobos" "Sol/Mars"
   {     
     Mesh "Phobos.low.bin.cmod"
     Radius 13.0 # maximum semi-axis
     
     Timeline
     [
     # Before
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars" }}
       BodyFrame  { EquatorJ2000  {Center "Sol/Mars"  }}
       Ending    "1900 02 04 00:00:41.184 " # add 1 month for drawing orbit
       
       EllipticalOrbit
       {
         Epoch        2415054.500000000              # 1900 02 04
         Eccentricity       1.518804109399017E-02    # well Ecc.
         AscendingNode      8.267052630309641E+01    # Deg.
         SemiMajorAxis      9.377997102713629E+03    # Km.
         ArgOfPericenter    3.043078653748888E+02    # Deg.
         MeanAnomaly        5.332299997217411E+01    # Deg.
         Inclination        2.565060806884143E+01    # Deg.
         Period             3.191284128449522E-01    # days
       }
       
        CustomRotation  "iau-phobos"
         
     }
     # spice
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars_bary" }}
       BodyFrame  { EclipticJ2000  { Center "Sol/Mars"      }}
       Ending    "2099 12 01 00:01:07.183"  # minus 1 month for drawing orbit
       SpiceOrbit
       {
         Kernel "mar097.bsp"
         Target "401"
         Origin "4"   
         Period  0.32
         BoundingRadius 1e10
       }
       
       SpiceRotation
       {
         Kernel            [ "pck00010.tpc"   "naif0012.tls" ]
         Frame               "IAU_PHOBOS"
       }
     }
     # After Spice
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars" }}
       BodyFrame  { EquatorJ2000  { Center "Sol/Mars" }}
       
       EllipticalOrbit
       {
         Epoch        2488038.500000000              # 2099 12 01
         Eccentricity       1.483144293957042E-02    # well Ecc.
         AscendingNode      8.481820920977968E+01    # Deg.
         SemiMajorAxis      9.378104613638820E+03    # Km.
         ArgOfPericenter    2.643248684702730E+01    # Deg.
         MeanAnomaly        1.350187386377397E+02    # Deg.
         Inclination        2.718705574501926E+01    # Deg.
         Period             3.191339006728237E-01    # days
       }
       
       # CustomRotation "iau-phobos"
     }
         ]
         
         Albedo         0.08
         
   }
   
  Replace "Deimos" "Sol/Mars"
   {
     Mesh "Deimos.low.bin.cmod"
     Radius 7.9
     MeshCenter [ 0.00 -0.10 0.10 ] 
     Timeline
     [
     # Before
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars" }}
       BodyFrame  { EquatorJ2000  { Center "Sol/Mars" }}
       Ending    "1900 02 04 00:00:41.184 " # add 1 month for drawing orbit
       
       EllipticalOrbit
       {
         Epoch        2415054.500000000              # 1900 02 04
         Eccentricity       2.727785842374572E-04    # well Ecc.
         AscendingNode      8.014712529094811E+01    # Deg.
         SemiMajorAxis      2.345843352277748E+04    # Km.
         ArgOfPericenter    2.794768893629913E+02    # Deg.
         MeanAnomaly        4.108445654415713E+01    # Deg.
         Inclination        2.706516193051360E+01    # Deg.
         Period             1.262550755300245E+00    #  days
       }
       
       
       CustomRotation "iau-deimos"
     }
     # spice
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars_bary" }}
       BodyFrame  { EclipticJ2000  { Center "Sol/Mars"      }}
       Ending    "2099 12 01 00:01:07.183"  # minus 1 month for drawing orbit
       SpiceOrbit
       {
         Kernel "mar097.bsp"
         Target "402"
         Origin "4"   
         Period   1.2624408
         BoundingRadius 1e10
       }
       
       
       #CustomRotation "iau-deimos"
       SpiceRotation
       {
         Kernel           [ "pck00010.tpc"   "naif0012.tls" ]
         Frame               "IAU_DEIMOS"
       }
     }
     # After Spice
     {
       OrbitFrame { EclipticJ2000 { Center "Sol/Mars" }}
       BodyFrame  { EquatorJ2000  { Center "Sol/Mars" }}
       
       EllipticalOrbit
       {
         Epoch        2488038.500000000              # 2099 12 01
         Eccentricity       2.637095563057808E-04    # well Ecc.
         AscendingNode      8.643314126921305E+01    # Deg.
         SemiMajorAxis      2.345856966798129E+04    # Km.
         ArgOfPericenter    1.469448698896884E+02    # Deg.
         MeanAnomaly        1.026702715681343E+02    # Deg.
         Inclination        2.641083361232704E+01    # Deg.
         Period             1.262561746474004E+00    # days
       }     
       CustomRotation "iau-deimos"
     }
    ]       
         Albedo   0.08
   }
 


And that is the inner solar system

things get a bit more complex for Jupiter with all it's moons , that will be the next post


.
Last edited by John Van Vliet on 11.10.2022, 22:18, edited 1 time in total.

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #4by John Van Vliet » 25.09.2022, 01:40

On to Jupiter with all of it moons and minor moons

I have done all of the " heavy lifting " in creating a ssc file
the major moons have a timeline for before and after SPICE
the minor moons do not

---- WARNING ----
for the below ssc file of Jupiter you WILL need to remove the Jupiter section from the "celestia/data/numberedmoons.ssc
this is do to name changes over the years


here is a zip for the Jupiter section of your SolarSystem.SPICE.ssc file

-- just copy/past the data in the zip into your SolarSystem.SPICE.ssc file

https://drive.google.com/file/d/1yrln3yrTgTZUNaxxwSX--OyzDKe-nZcV/view?usp=sharing



On to the needed spice kernels you will need to download
there are two for Jupiter
jup365.bsp
jup344.bsp
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/

jup365 is the major moons and jup344 is the minormoons

for instance if you run " brief " on jup365.bsp you will get this

Code: Select all

(isis) john@localhost:/DATA/SUSE/SpiceSolarSystem/data> brief -c jup365.bsp
 
BRIEF -- Version 4.0.0, September 8, 2010 -- Toolkit Version N0066
 
 
Summary for: jup365.bsp
 
Bodies: EARTH BARYCENTER (3) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        JUPITER BARYCENTER (5) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        SUN (10) w.r.t. SOLAR SYSTEM BARYCENTER (0)
        EARTH (399) w.r.t. EARTH BARYCENTER (3)
        IO (501) w.r.t. JUPITER BARYCENTER (5)
        EUROPA (502) w.r.t. JUPITER BARYCENTER (5)
        GANYMEDE (503) w.r.t. JUPITER BARYCENTER (5)
        CALLISTO (504) w.r.t. JUPITER BARYCENTER (5)
        AMALTHEA (505) w.r.t. JUPITER BARYCENTER (5)
        THEBE (514) w.r.t. JUPITER BARYCENTER (5)
        ADRASTEA (515) w.r.t. JUPITER BARYCENTER (5)
        METIS (516) w.r.t. JUPITER BARYCENTER (5)
        JUPITER (599) w.r.t. JUPITER BARYCENTER (5)
        Start of Interval (ET)              End of Interval (ET)
        -----------------------------       -----------------------------
        1600 JAN 10 00:00:00.000            2200 JAN 10 00:00:00.000
 
(isis) john@localhost:/DATA/SUSE/SpiceSolarSystem/data>

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #5by John Van Vliet » 28.09.2022, 01:36

On to the ringed giant Saturn with a tone of moons
Saturn.png


you will need to download a few spice kernels for this one
from :
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/
you will need these 5 for the Orbits
sat441.bsp , sat450.bsp , sat415.bsp , sat368-named_only.bsp , sat393_daphnis.bsp


for the rotation kernels , you already have pck00010.tpc , and naif0012.tls
BUT
you will also need a kernel from the Cassini archive
https://naif.jpl.nasa.gov/pub/naif/pds/data/co-s_ ... ice-6-v1.0/cosp_1000/data/pck/
" cpck_rock_21Jan2011_merged.tpc "

this one is for the minor moons and is the rotational data

WARNING
As you did with Jupiter you will also need to edit the /celestia/data/numberedmoons.ssc
and REMOVE the Saturn section !


The Saturn section for your " SolarSystem.SPICE.ssc is way too long to post in "code" tags so i put a text file for it on my G-drive

https://drive.google.com/file/d/1XbCVuGsK5QnAER75RJ3ET9og6sJkSQar/view?usp=sharing

just copy/past it into your SolarSystem.SPICE.ssc
this will add Saturn

for the major and minor moons a used a "Timeline" for the orbits and got the orbital data from HORIZONS
for the numbered moons i did not use a " Timeline"

As with the other sections you will need to edit the texture names to the ones YOU are using

.

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #6by John Van Vliet » 11.10.2022, 20:02

On to Uranus
Uranus.png

Uranus1.png


you will need to download 3 spice kernels for this one
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/
ura111l.bsp ura115.bsp and ura116.bsp

these are for all of the Moons

i have done all the work in adding the horizons orbital data in the timelines i used
all you need to do is add the below data to your " SolarSystem.SPICE.ssc"

and as before EDIT the map names to the ones YOU ARE USING


here is a link to a zip of the text file of the uranus data
https://drive.google.com/file/d/1IlXptGy2ojLniHw2W_PZ6s-sHtMTZfZo/view?usp=sharing

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #7by John Van Vliet » 20.10.2022, 04:09

Here is Neptune
Neptune.png

Neptune1.png



you will need to download 3 SPICE kernels

https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/
nep095.bsp , nep097.bsp , nep101.bsp

and here is the data to add to your SolarSystem.SPICE.ssc

https://drive.google.com/file/d/1lsfxUAONEZBs6H3jH2ST0x6HBSvUjAUQ/view?usp=sharing

as before EDIT to use YOUR TEXTURES , most are using the default "asteroid.jpg "

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #8by John Van Vliet » 23.10.2022, 01:54

And here is Pluto - Charon and it's 4 moons

copy the "PlutoCharon.SPICE.ssc" file to your SolarSystem.SPICE folder

https://drive.google.com/file/d/152N2C5TdccMiBpMU5maG5Cnzgj4xHYhA/view?usp=sharing

then download "plu058.bsp"
https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/plu058.bsp
this has all the orbital information for the pluto system

you might also want my cmod's and textures for them
they are here :
https://drive.google.com/file/d/1OqOEF4gSeJrW2z6QECSRQSHkxUru51-9/view?usp=sharing

Hydra.png

Kerberos.png

Nix.png

Styx.png


just copy the 2 folders to the SolarSystem.SPICE folder





.
Last edited by John Van Vliet on 27.10.2022, 03:45, edited 2 times in total.

Avatar
Limax7
Posts: 98
Joined: 23.01.2010
Age: 45
With us: 14 years 9 months
Location: Poland, Bialystok

Post #9by Limax7 » 23.10.2022, 16:19

Thanks John for this adds. I download nessesary files and use Spice for planets and satellites.

I have question, when to use Modify and when Replace in this SSC files. What is better?

Thanks, Adam
Adam Hurcewicz
Bialystok, Poland

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #10by John Van Vliet » 24.10.2022, 13:58

The " modify" option is for rather small edits , and the replace is for more MAJOR edits

i think i used the " replace" option all the time

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #11by John Van Vliet » 27.10.2022, 03:46

Next up is spacecraft
i picked an easy one for the first one " JamesWebSpaceTeliscope "

https://drive.google.com/file/d/1Bb12Vl40oNcF6oj-RJoZkFX8fPHxk_rp/view?usp=sharing

the above zip has everything needed the spice kernel and the cmod mesh

or

you can read further and make your own ssc file

the spice kernel is on the ESA site
https://repos.cosmos.esa.int/socci/projects/SPICE ... /repos/jwst/browse/kernels/spk

i am using " jwst_horizons_20211225_20240221_v01.bsp " ( included in the above zip )

running "brief" on this kernel will give you the needed info

Code: Select all

BRIEF -- Version 4.0.0, September 8, 2010 -- Toolkit Version N0066
 
 
Summary for: jwst_horizons_20211225_20240221_v01.bsp
 
Body: JAMES WEBB SPACE TELESCOPE (-170) w.r.t. SUN (10)
      Start of Interval (ET)              End of Interval (ET)
      -----------------------------       -----------------------------
      2021 DEC 25 12:49:09.184            2024 FEB 21 23:49:09.184
 


you have the beginning and ending dates, the origin ( 10 ) and the spacecraft number( -170 )
this translates into parts for the ssc

Code: Select all


"JWST" "Sol"
{
Class "spacecraft"
Mesh "JWST.bin.cmod" # https://nasa3d.arc.nasa.gov/detail/jwst-2
Radius 0.007

    Orientation [ 0 1 0 0 ]


{
    OrbitFrame { EclipticJ2000 { Center "Sol"}}
    Starting  "2021 12 25 12:49:09.184"
    Ending    "2024 01 21 23:49:09.184"


    SpiceOrbit
    {
    Kernel
    [

    "jwst_horizons_20211225_20240221_v01.bsp"   # https://repos.cosmos.esa.int/socci/projects/SPICE_KERNELS/repos/jwst/browse/kernels/spk
   
    ]

    Target "-170"
    Origin "10"
    Period 10
    BoundingRadius 1e10
    }

   
   
    BodyFrame
 {   TwoVector
  {   Center   "Sol/JWST"
        Primary     {   Axis "y"   RelativePosition { Target "Sol" } }
        Secondary{   Axis "x"   RelativeVelocity { Target "Sol" } }
  }
 }
}

}


now there are NO rotation *.bc kernels with this one so it is rather strait forward
Last edited by John Van Vliet on 30.10.2022, 00:16, edited 1 time in total.

Avatar
EarthMoon
Posts: 200
Joined: 02.07.2022
With us: 2 years 4 months
Location: Germany

Modify, not Replace

Post #12by EarthMoon » 27.10.2022, 07:20

As Limax7 said,
it's better to use the "Modify" option:
  1. The file size is lower (with "Replace" you must enter ALL parameters again (like Texture, Mesh, Class, ...), with "Modify" you must just enter just the parameters that should be updated/modified)
  2. More performance: The add-on user must not update all properties to point to his textures, meshes, ...

An example for Mercury with "Modify" instead of "Replace":

Code: Select all

Modify "Mercury" "Sol" # uses the "Modify" statement and adds "Timeline []" as a new property
{
   Timeline
   [
      # Before SPICE
      {
         BodyFrame { EquatorJ2000 { Center "Sol" } }
         Ending   "1550 02 27 00:00:00.000"  # add 2 month for orbit drawing   
         CustomOrbit "vsop87-mercury"
         CustomRotation "iau-mercury"
      }
      # SPICE
      {
         OrbitFrame { EclipticJ2000 { Center "Sol"}}
         BodyFrame { EclipticJ2000 { Center "Sol" }}
         Ending    "2649 10 25 00:00:00.000"  # less 2 month for orbit
         SpiceOrbit
         {
            Kernel "de440.bsp"
            Target "1" # = Mercury bary, but Mercury bary = Mercury's center of mass because there are no moons
            Origin "10"
            Period 1
            BoundingRadius 1000 # Mercurys' orbital semi-major axis around Mercury Bary is 0
         }
         SpiceRotation
         {
            Kernel
            [
               "pck00010.tpc"
               "naif0012.tls"
            ]
            Frame                 "IAU_MERCURY"
         }
      }
      # After SPICE
      {
         BodyFrame { EquatorJ2000 { Center "Sol" } }
         CustomOrbit "vsop87-mercury"
         CustomRotation "iau-mercury"
      }
   ]
}


The code above modifies "Sol/Mercury" to have a "Timeline [...]" in Celestia's database,
with "Replace" Celestia must overwrite ALL data about "Sol/Mercury" that already has been loaded with "data/solarsys.ssc"; the overwrite may require more RAM (for users with low-end PC/RAM) and time while Celestia loads.
Crew: "We are orbiting a black hole."
Control Center: "Do not fly too close to the black hole!"
Crew: "OH OOPS..."

Celestia versions:
1.6.3, 1.7.0 sRGB, 1.6.1 ED (plain)

Current projects:
Celestial (a Celestia-like program written in Python)

Avatar
Topic author
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

Post #13by John Van Vliet » 30.10.2022, 00:26

Just posted an EASY spice spacecraft
the JWST

up next is something VERY VERY complex
the Juno Mission

this one will use the ROTATIONAL *.bc kernels as well as the *.bsp orbital kernels
-- my install has 109 kernel files in the data folder --


Return to “Celestia Users”