Page 1 of 2
SPICE rotation models
Posted: 08.04.2008, 23:47
by chris
As of revision 4247 Celestia supports SPICE rotation models. These work very much like SPICE orbits, except that they of course affect the orientation rather rather than the position of Celestia objects. Any SPICE frame can be used to orient a Celestia object. I expect that this will be most useful for spacecraft, though there is high precision orientation data available for the Earth, Moon, and--apparently--the asteroid Eros.
Here's how they work:
Code: Select all
SpiceRotation
{
Kernel <string|string array> # optional
Frame <string>
BaseFrame <string> # optional (defaults to ecliptic)
Period <number> # optional (units are hours)
Beginning <number> # optional
Ending <number> # optional
}
The Kernel property specifies one or more SPICE kernel files that must be loaded in order for the frame to be defined over the required range. Any already loaded kernels will be used if they contain information relevant for defining the frame. Frame and base name are strings that give SPICE names for the frames. The orientation of the SpiceRotation is the orientation of the frame relative to the base frame. If no base frame is specified, the default is eclipj2000.
Beginning and Ending specify the valid time range of the SPICE rotation. If the Beginning and Ending are omitted, the rotation model is assumed to be valid at any time. It is an error to specify Beginning without Ending, and vice versa.
Period specifies the principal rotation period; it defaults to 0 indicating that the rotation is aperiodic. It is not essential to provide the rotation period; it is only used by Celestia for displaying object information such as sidereal day length.
Using a SPICE frame rotation for a planet or natural satellite is easier. With spacecraft, the task is complicated by the difficulty of finding all the necessary kernels.
Here's a sample that uses a SPICE text kernel for the rotation of the Earth:
Code: Select all
SpiceRotation
{
Kernel "pck00008.tpc"
Frame "IAU_EARTH"
BaseFrame "eclipj2000"
Period 23.9344694
}
To use SPICE to get the orientation of Cassini, we need multiple SPICE files:
Code: Select all
SpiceRotation
{
Kernel [
"cas_v39.tf"
"cas00112.tsc"
"08082_08087ra.bc"
]
Frame "CASSINI_SC_COORD"
BaseFrame "J2000"
}
In this example, the text frame (tf) kernel defines the frame, the tsc file is a spacecraft clock kernel, and 08082_08087ra.bc contains the orientation of the Cassini spacecraft between the 82nd and 87th days of 2008.
--Chris
Re: SPICE rotation models
Posted: 21.04.2008, 20:48
by revent
Just to make sure I understand this clearly, since there's some confusion between the 'types' of Spice kernels and their filenames..
.bsp files are SPK kernels, what we're used to for ephemerides
your 'tpc' file is a text PCK kernel, for 'target' parameters and orientation
your 'tf' file is a text FK kernel, to define the reference frame
your 'tsc' file is a text SCLK kernel, for the spacecraft clock
and your 'bc' file is a CK kernel, for spacecraft orientation
That look right?
Re: SPICE rotation models
Posted: 25.01.2009, 00:25
by volcanopele
I finally broke down and decided to incorporate Spice kernel files to show the orientation of Cassini in Celestia. However, I am not finding success.
Here is the code I used for spice kernel orientation:
Code: Select all
SpiceRotation
{
Kernel
[
"cas_v40.tf"
"cas00130.tsc"
"08152_08183pf_live_update_doy182.bc"
"08183_08224pi_lud_doy209.bc"
"08224_08257pg_psiv2.bc"
"08257_08292pe_psiv2.bc"
"08292_08331ph_fsiv_S45_lud3.bc"
"08331_09009pg_fsiv.bc"
"09009_09048pi_psiv2.bc"
"09048_09085pf_psiv2.bc"
"09085_09125pc_port3.bc"
"09125_09164pc_port2.bc"
"09164_09204pa_port1_waypt.bc"
]
Frame "CASSINI_SC_COORD"
BaseFrame "J2000"
Beginning "2008 07 01 02:00"
Ending "2009 07 22 02:00"
}
However, the second two images show the problem. First, Cassini fails to display unless I select to show its body frames. Second, its orientation doesn't actually change. This issue also shows up when I limit the above to a single c-kernel file:
Code: Select all
SpiceRotation
{
Kernel
[
"cas_v40.tf"
"cas00130.tsc"
"09009_09048pi_psiv2.bc"
]
Frame "CASSINI_SC_COORD"
BaseFrame "J2000"
Beginning "2009 01 10 00:00"
Ending "2009 02 17 00:00"
}
When I use my normal orientation input:
Code: Select all
Orientation [ 90 0 1 0 ]
FixedRotation { }
BodyFrame { EquatorJ2000 { Center "Sol/Saturn" } }
Cassini shows up just fine (as seen in the first image), though obviously the orientation isn't accurate.
Any thoughts on how I can fix this?
Re: SPICE rotation models
Posted: 25.01.2009, 02:52
by volcanopele
A quick way to test this (and one that provides the same results as what I have above) is to try:
Code: Select all
ReferencePoint "Saturn_bary" "Sol"
{
Beginning "1899 07 30 00:00"
Ending "2053 10 08 00:00"
OrbitFrame { EclipticJ2000 { Center "SSB"}}
SpiceOrbit
{
Kernel "de421.bsp"
Target "6"
Origin "0"
BoundingRadius 1e10
}
}
Modify "Cassini" "Sol"
{
Beginning "2008 03 23 00:00"
Ending "2008 03 27 00:00"
OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary"}}
SpiceOrbit
{
Kernel "080605R_SCPSE_08078_08126.bsp"
Target "-82"
Origin "6"
Period 15
BoundingRadius 1e10
}
SpiceRotation
{
Kernel [
"cas_v39.tf"
"cas00112.tsc"
"08082_08087ra.bc"
]
Frame "CASSINI_SC_COORD"
BaseFrame "J2000"
}
}
de421:
ftp://naif.jpl.nasa.gov/pub/naif/generi ... /de421.bsp080605R_SCPSE_08078_08126.bsp:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... _08126.bspcas_v39.tf:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... cas_v39.tfcas00112.tsc:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... s00112.tsc08082_08087ra.bc:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... 08087ra.bcI am using SVN 4604 from
http://www.celestialmatters.org/?q=node/132
Re: SPICE rotation models
Posted: 25.01.2009, 17:42
by chris
I have been able to get SPICE rotation models working with Cassini. My guess is that some necessary kernels are still missing. I'll try out your example and see whether something is missing. You may want to check Celestia's console log (press the ~ (tilde) key) to see if there are any SPICE error messages appearing.
--Chris
Re: SPICE rotation models
Posted: 25.01.2009, 18:46
by volcanopele
I get several copies of the following error when I got to Cassini on March 25, 2008 at 18:41 UTC:
The following, needed to convert between the uniform time scales, could not be found in the kernel pool: DELTET/DELTA_T_A, DELTET/K, DELTET/EB, DELTET/M.
Any other possible errors flyby before I can see them. All five error messages are the same.
Re: SPICE rotation models
Posted: 25.01.2009, 19:04
by t00fri
volcanopele wrote:I get several copies of the following error when I got to Cassini on March 25, 2008 at 18:41 UTC:
The following, needed to convert between the uniform time scales, could not be found in the kernel pool: DELTET/DELTA_T_A, DELTET/K, DELTET/EB, DELTET/M.
Any other possible errors flyby before I can see them. All five error messages are the same.
and why don't you redirect the errors into a file??
like
> celestia > log
Fridger
Re: SPICE rotation models
Posted: 25.01.2009, 20:28
by volcanopele
I hadn't thought of that.
Regardless, Chris and I worked through this issue via IM. The leap second kernel file was needed so those variables could be defined. In addition, the base frame also needed to be changed to eclipJ2000 and model orientation adjusted:
Code: Select all
Modify "Cassini" "Sol"
{
Beginning "2008 03 23 00:00"
Ending "2008 03 27 00:00"
OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary"}}
SpiceOrbit
{
Kernel "080605R_SCPSE_08078_08126.bsp"
Target "-82"
Origin "6"
Period 15
BoundingRadius 1e10
}
Orientation [180 1 0 0 ]
SpiceRotation
{
Kernel [
"cas_v39.tf"
"cas00112.tsc"
"08082_08087ra.bc"
"naif0009.tls"
]
Frame "CASSINI_SC_COORD"
BaseFrame "eclipJ2000"
}
}
Re: SPICE rotation models
Posted: 27.01.2009, 14:59
by symaski62
Re: SPICE rotation models
Posted: 27.01.2009, 17:13
by volcanopele
What settings did you use to make that video? I tried doing that for the T50 flyby, and while the video came out looking alright on my computer, the Youtube uploaded version came out way too dark:
http://www.youtube.com/watch?v=eD4L1-5VibM
Re: SPICE rotation models
Posted: 01.02.2009, 00:10
by symaski62
14 jan 2008 <= mercury
Code: Select all
ReferencePoint "mercury_1" "Sol"
{
Beginning "1899 07 30 00:00"
Ending "2053 10 08 00:00"
OrbitFrame { EclipticJ2000 { Center "SSB"}}
SpiceOrbit
{
Kernel "de421.bsp"
Target "1"
Origin "0"
BoundingRadius 1e10
}
}
Modify "messenger" "Sol"
{
Mesh "messenger2.3ds"
Radius 0.011
OrbitFrame { EclipticJ2000 { Center "Sol/mercury_1"}}
SpiceOrbit
{
Kernel "msgr_20040803_20120401_od051.bsp"
Target "-236"
Origin "1"
Period 15
BoundingRadius 1e10
}
Orientation [180 0 1 0 ]
SpiceRotation
{
Kernel [
"msgr_v090.tf"
"messenger_478.tsc"
"msgr_0801_v01.bc"
"naif0008.tls"
]
Frame "MSGR_SPACECRAFT"
BaseFrame "eclipJ2000"
}
}
ftp://naif.jpl.nasa.gov/pub/naif/MESSEN ... _od051.bspftp://naif.jpl.nasa.gov/pub/naif/pds/da ... gr_v090.tfftp://naif.jpl.nasa.gov/pub/naif/pds/da ... er_478.tscftp://naif.jpl.nasa.gov/pub/naif/pds/da ... 801_v01.bchttp://www.celestiamotherlode.net/creat ... senger.zip 3D
sorry Orientation [180 0 1 0 ] ???? & 01/14/2008
@@+++
Re: SPICE rotation models
Posted: 05.02.2009, 18:41
by volcanopele
On a similar vein, I would like to use SPICE kernels for the rotation of some of the small Saturnian satellites. Here is what I have at the moment:
Code: Select all
ReferencePoint "Saturn_bary" "Sol"
{
Beginning "1899 07 30 00:00"
Ending "2053 10 08 00:00"
OrbitFrame { EclipticJ2000 { Center "SSB"}}
SpiceOrbit
{
Kernel "de421.bsp"
Target "6"
Origin "0"
Period 10833
BoundingRadius 1e10
}
}
Replace "Polydeuces" "Sol/Saturn"
{
Class "moon"
Texture "asteroid.jpg"
# Mesh "polydeuces.cms"
# Radius 1.3
SemiAxes [ 1.5 1.2 1.0 ]
Timeline
[
# Before Cassini
{
EllipticalOrbit
{
Epoch 2453006.5 # 2004 Jan 2 00:00UT
Period 2.73690
SemiMajorAxis 377390
Eccentricity 0.0182
Inclination 0.1705
AscendingNode 262
LongOfPericenter 103.22
MeanLongitude 67.61
}
Ending "1950 01 01 00:01"
UniformRotation
{
Period 65.68596
Inclination 0
# MeridianAngle 245.12
MeridianAngle 298.72
Epoch 2451545.0
}
}
# SAT299
{
OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary"}}
Ending "2050 01 01 00:00"
SpiceOrbit
{
Kernel "sat299.bsp"
Target "634"
Origin "6"
Period 2.73690
Beginning "1950 01 01 00:01"
Ending "2050 01 01 00:00"
BoundingRadius 1e10
}
UniformRotation
{
Period 65.68596
Inclination 0
# MeridianAngle 245.12
MeridianAngle 298.72
Epoch 2451545.0
}
# SpiceRotation
# {
# Kernel
# [
# cas_rocks_v15.tf
# cpck_rock_02Feb2009.tpc
# ]
#
# Frame "IAU_POLYDEUCES"
# BaseFrame "eclipJ2000"
# Period 65.68596
# }
}
# After Cassini
{
EllipticalOrbit
{
Epoch 2453006.5 # 2004 Jan 2 00:00UT
Period 2.73690
SemiMajorAxis 377390
Eccentricity 0.0182
Inclination 0.1705
AscendingNode 262
LongOfPericenter 103.22
MeanLongitude 67.61
}
UniformRotation
{
Period 65.68596
Inclination 0
# MeridianAngle 245.12
MeridianAngle 298.72
Epoch 2451545.0
}
}
]
Albedo 1
}
cas_rocks_v15.tf:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... cks_v15.tfcpck_rock_02Feb2009.tpc:
ftp://naif.jpl.nasa.gov/pub/naif/CASSIN ... eb2009.tpcsat299.bsp:
ftp://naif.jpl.nasa.gov/pub/naif/generi ... sat299.bspde421.bsp:
ftp://naif.jpl.nasa.gov/pub/naif/generi ... /de421.bspThe spice rotation portion is commented out, so the code as it stands should work. It works in my version of Celestia. When I use the spice rotation and comment out (or remove) the uniform rotation part, my code is ignored and the version in numberedmoons.ssc is used instead (a quick way to check this is to view the model used, if you see an irregular body, the code is being ignored, if you see a smooth, egg-shaped object, then the code is being used.) I tried this with using only the .tpc file as well as with both the frame kernel (.tf) and the planetary constants kernel (.tpc)
Re: SPICE rotation models
Posted: 05.02.2009, 20:15
by selden
volcanopele,
Quotes are missing around the kernel file names.
Using Celestia v1.6 r4637 under Windows with your SSC file and the SPICE kernel files you list, when I turn on Celestia's "console log" (type a tilde (~) to toggle it), and use the up-arrow key to go up to its top, I discovered an error message:
Code: Select all
Loading solar system catalog extras/sat299/sat299.ssc
Loaded SPK file extras/sat299/data/de421.bsp
Error in .ssc file (line 83) bad object definition
line 83 is the line containing the [ starting the rotation's Kernel block:
Code: Select all
SpiceRotation
{
Kernel
[ #<--- line 83
cas_rocks_v15.tf # quotes (") are missing here
cpck_rock_02Feb2009.tpc # quotes (") are missing here
]
Frame "IAU_POLYDEUCES"
BaseFrame "eclipJ2000"
Period 65.68596
}
}
When I add the quotes, the error message goes away and I see an oval body.
I don't know if it's actually rotating correctly, though.
Re: SPICE rotation models
Posted: 05.02.2009, 20:26
by volcanopele
Thanks, that allows the code to load. The rotation model isn't correct, but at least it works...
Re: SPICE rotation models
Posted: 05.02.2009, 20:54
by chris
volcanopele wrote:Thanks, that allows the code to load. The rotation model isn't correct, but at least it works...
You need to set the body frame for the satellites... For backward compatibility with existing add-ons, the default body frame of an object is the equatorial frame of whatever it orbits. For each moon, add this line:
The BaseFrame in the spice rotation needs to match whatever the BodyFrame of the object is. I'm working on documenting some of these new 1.6.0 things in the Celestia Wikibook.
A couple things to note:
- In 1.6.0, it's not necessary to specify the center for a BodyFrame.
- The default BaseFrame for a SpiceRotation is eclipJ2000; you can remove the BaseFrame from your moon definitions unless you want to leave it there for clarity.
--Chris
Re: SPICE rotation models
Posted: 05.02.2009, 21:14
by volcanopele
Thanks, that seems to resolve the issue.
Re: SPICE rotation models
Posted: 05.02.2009, 21:44
by volcanopele
Okay, everything seems to work fine with a code similar to this:
Code: Select all
Replace "Atlas" "Sol/Saturn"
{
Class "moon"
Texture "asteroid.jpg"
# Mesh "atlas.cms"
# Radius 15.1
SemiAxes [ 20.9 18.1 8.9 ]
Timeline
[
# Before Cassini
{
EllipticalOrbit
{
Epoch 2453177.5 # 2004 Jun 21 00:00UT
Period 0.60169
SemiMajorAxis 137665
Eccentricity 0.0012
Inclination 0.009
AscendingNode 241.0
LongOfPericenter 42.3
MeanLongitude 331.432
}
Ending "1950 01 01 00:01"
BodyFrame { EclipticJ2000 { } }
SpiceRotation
{
Kernel "cpck_rock_02Feb2009_merged.tpc"
Frame "IAU_ATLAS"
BaseFrame "eclipJ2000"
Period 14.4406749192
}
}
# SAT299
{
OrbitFrame { EclipticJ2000 { Center "Sol/Saturn_bary"}}
Ending "2050 01 01 00:00"
SpiceOrbit
{
Kernel "sat299.bsp"
Target "615"
Origin "6"
Period 0.60169
Beginning "1950 01 01 00:01"
Ending "2050 01 01 00:00"
BoundingRadius 1e10
}
BodyFrame { EclipticJ2000 { } }
SpiceRotation
{
Kernel "cpck_rock_02Feb2009_merged.tpc"
Frame "IAU_ATLAS"
BaseFrame "eclipJ2000"
Period 14.4406749192
}
}
# After Cassini
{
EllipticalOrbit
{
Epoch 2453177.5 # 2004 Jun 21 00:00UT
Period 0.60169
SemiMajorAxis 137665
Eccentricity 0.0012
Inclination 0.009
AscendingNode 241.0
LongOfPericenter 42.3
MeanLongitude 331.432
}
BodyFrame { EclipticJ2000 { } }
SpiceRotation
{
Kernel "cpck_rock_02Feb2009_merged.tpc"
Frame "IAU_ATLAS"
BaseFrame "eclipJ2000"
Period 14.4406749192
}
}
]
Albedo 0.4
}
Now the problem (or is it?) is that the rotation rates may be off in the IAU definition. Not sure at the moment. maybe Atlas does rotate slightly non-synchronously (enough to cause a shift of 1 degree per year).
Re: SPICE rotation models
Posted: 05.02.2009, 22:55
by chris
volcanopele wrote:Now the problem (or is it?) is that the rotation rates may be off in the IAU definition. Not sure at the moment. maybe Atlas does rotate slightly non-synchronously (enough to cause a shift of 1 degree per year).
The IAU rotations may well be inadequate... Is SPICE using the same values as specified here?
http://astrogeology.usgs.gov/Projects/W ... able2.htmlIf so, note that the only deviation from a strictly uniform rotation is a very slow precession of the rotation pole which matches that of Saturn. This keeps the moon's rotation pole perpendicular to Saturn's equatorial plane, but orbital precession unaccounted for. If there is any orbital precession in the SPICE ephemeris, the moon will rotate non-synchronously. I suspect that the IAU rotations of the minor Saturnian satellites have not been updated to account for new knowledge about their orbits.
--Chris
Re: SPICE rotation models
Posted: 05.02.2009, 23:16
by volcanopele
Pole Positions are the same as on the USGS site. Rotation degs/day differ for some of the moons, particularly Atlas and Pan.
Re: SPICE rotation models
Posted: 05.02.2009, 23:24
by chris
volcanopele wrote:Pole Positions are the same as on the USGS site. Rotation degs/day differ for some of the moons, particularly Atlas and Pan.
Can you provide a link to the text kernel that you're using for the IAU rotations?
--Chris