MRO SPICE orbit not displayed

General discussion about Celestia that doesn't fit into other forums.
mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #21by mcaplinger » 28.11.2006, 06:07

selden wrote:Did you specify the correct reference plane?

I forgot it, so Celestia assumed Mars Equatorial, which is wrong. Presumably it should be Ecliptic.

Spice files are usually (always?) in EME2000. It looks more or less right if I say

OrbitFrame {
EquatorJ2000 { Center "Sol/Mars" }
}

However, when I try tracking MGS from MRO, it runs for a few minutes of time and then pops several Mpc away. Any idea what's happening here?

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

Post #22by chris » 28.11.2006, 08:21

mcaplinger wrote:
selden wrote:Did you specify the correct reference plane?

I forgot it, so Celestia assumed Mars Equatorial, which is wrong. Presumably it should be Ecliptic.
Spice files are usually (always?) in EME2000. It looks more or less right if I say

OrbitFrame {
EquatorJ2000 { Center "Sol/Mars" }
}

However, when I try tracking MGS from MRO, it runs for a few minutes of time and then pops several Mpc away. Any idea what's happening here?


I don't know what would be causing that . . . If you post your ssc file, I'll try and figure out what's going on.

Regarding reference frames for SPICE trajectories, I believe that it's defineable in the spk file, but EME2000 is typical. However, the SPICE functions to get a body's state vector at a particular time accept the name of a reference frame as a parameters. Celestia is always using "eclipj2000" right now, so you should match this by setting orbit frame to EclipticJ2000 in Celestia. I could provide a new property for SPICE trajectories that allows you to specify the name of a reference frame other than eclipj2000. It might be slightly more efficient, but I don't know if the additional flexibility would be otherwise useful . . . would it?

--Chris

mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #23by mcaplinger » 28.11.2006, 15:17

chris wrote:I don't know what would be causing that . . . If you post your ssc file, I'll try and figure out what's going on.

I'm using this:

"spice_mgs" "Sol/Mars" {
Radius 0.01
Color [ 1 1 0]

Beginning "2006 11 02 00:00"
Ending "2006 12 01 00:00:00"

OrbitFrame {
EquatorJ2000 { Center "Sol/Mars" }
}
SpiceOrbit
{
Kernel "spk_m_061102-061201_mro-img_061117.bsp"
Target "-94" # MGS
Origin "4" # MARS BARYCENTER

BoundingRadius 1e32

Beginning "2006 11 12 00:00:00"
Ending "2006 12 01 00:00:00"

}
}

and

"spice_mro" "Sol/Mars" {
Radius 0.01
Color [ 1 1 0]

Beginning "2006 10 12 07:35:01"
Ending "2006 12 05 16:14:59"

OrbitFrame {
EquatorJ2000 { Center "Sol/Mars" }
}
SpiceOrbit
{
Kernel "spk_psp_rec00990_00986_01684_p-v1.bsp"
Target "-74" # MARS RECON ORBITER
Origin "4" # MARS BARYCENTER

BoundingRadius 1e32

Beginning "2006 10 12 07:35:01"
Ending "2006 12 05 16:14:59"

}
}

where I faked the begin and end times for the MGS file, being too lazy to read it out of the label. Maybe that's my problem, though I would expect it to not matter unless I set time outside that range.

Regarding reference frames for SPICE trajectories, I believe that it's defineable in the spk file, but EME2000 is typical. However, the SPICE functions to get a body's state vector at a particular time accept the name of a reference frame as a parameters. Celestia is always using "eclipj2000" right now, so you should match this by setting orbit frame to EclipticJ2000 in Celestia. I could provide a new property for SPICE trajectories that allows you to specify the name of a reference frame other than eclipj2000. It might be slightly more efficient, but I don't know if the additional flexibility would be otherwise useful . . . would it?

--Chris

Oh, OK. I always call SPICE stuff with "J2000" (which gets EME2000) as the reference frame. I don't see the extra flexibility as being useful, and it'd be nice if the SPICE files just worked without the need for an explicit reference callout.

This is a great resource; with a bit more work I might not have to use STK any more!

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

Post #24by chris » 28.11.2006, 16:41

mcaplinger wrote:
chris wrote:I don't know what would be causing that . . . If you post your ssc file, I'll try and figure out what's going on.

I'm using this:
OrbitFrame {
EquatorJ2000 { Center "Sol/Mars" }
}

You should change it to:

Code: Select all

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


. . . because of how Celestia calls SPICE. Celestia has always used the J2000 ecliptic as its internal coordinate system. It's the default frame for Sun-orbiting objects. Unfortunately, the default frame for objects that orbit planets (or other non-stellar bodies) is the equatorial frame of the object orbited--Mars in your case. If this wasn't the case, then you could just omit the OrbitFrame entirely. But, maintaining backward compatibility
with existing ssc files requires that I not change the default.

If you haven't discovered it already, this page on the Celestia WikiBook might be useful (though most of the relevant info for you may already have been covered in this thread):
http://en.wikibooks.org/wiki/Celestia/Reference_Frames
I will try and add a page on SPICE orbits tonight.

where I faked the begin and end times for the MGS file, being too lazy to read it out of the label. Maybe that's my problem, though I would expect it to not matter unless I set time outside that range.

Is the position of Mars defined over the whole time range? I guess I'll give this a try myself . . .

Oh, OK. I always call SPICE stuff with "J2000" (which gets EME2000) as the reference frame. I don't see the extra flexibility as being useful, and it'd be nice if the SPICE files just worked without the need for an explicit reference callout.

I agree, but as I mentioned above, we're somewhat constrained by backward compatibility right now.

This is a great resource; with a bit more work I might not have to use STK any more!


Thanks--that's great to hear!

--Chris

mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #25by mcaplinger » 28.11.2006, 19:54

chris wrote:
selden wrote:Well, there seem to be some problems with how Celestia displays spice orbits, but it isn't with the MRO itself.

It's a result of Celestia seriously undersampling the orbit. I need to figure out how to make Celestia choose the number of points to use to draw an orbit. Making a nice rendering of a low planetary orbit over a long timespan requires a *lot* of points.

I'm not sure what the code is doing here, but I would think the "right" thing to do would be to sample the orbit only for an orbital period centered on the current time. Of course, updating that would be a pain. You could also compute the keplerian osculating elements for the current time and use those to draw the orbit (it'd probably be close enough) if that'd be faster.

mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #26by mcaplinger » 29.11.2006, 04:36

OK, I changed the orbit frame to EclipticJ2000 and it appears to work fine. (The orbit display looks better if you explicitly define Period.) However, as I simulate along in sync orbit of MRO tracking MGS, at about 11/20/2006 16:00, it appears to go nuts and ends up 5543.1 Mpc (2630858023250000000 km) away from MRO. Not sure what's going on here.

Malenfant
Posts: 1412
Joined: 24.08.2005
With us: 19 years 3 months

Post #27by Malenfant » 29.11.2006, 04:52

mcaplinger wrote:OK, I changed the orbit frame to EclipticJ2000 and it appears to work fine. (The orbit display looks better if you explicitly define Period.) However, as I simulate along in sync orbit of MRO tracking MGS, at about 11/20/2006 16:00, it appears to go nuts and ends up 5543.1 Mpc (2630858023250000000 km) away from MRO. Not sure what's going on here.


Well I guess that explains what happened to MGS, it clearly fell through a wormhole and ended up on the other side of the univese ;)
My Celestia page: Spica system, planetary magnitudes script, updated demo.cel, Quad system

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

Post #28by chris » 29.11.2006, 19:30

mcaplinger wrote:OK, I changed the orbit frame to EclipticJ2000 and it appears to work fine. (The orbit display looks better if you explicitly define Period.) However, as I simulate along in sync orbit of MRO tracking MGS, at about 11/20/2006 16:00, it appears to go nuts and ends up 5543.1 Mpc (2630858023250000000 km) away from MRO. Not sure what's going on here.


I found the problem. It's a bug in a function used for the track mode rather than anything specific to SPICE trajectories. I'll commit the fix to CVS tonight.

--Chris

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

Post #29by chris » 30.11.2006, 02:56

OK, I changed the orbit frame to EclipticJ2000 and it appears to work fine. (The orbit display looks better if you explicitly define Period.) However, as I simulate along in sync orbit of MRO tracking MGS, at about 11/20/2006 16:00, it appears to go nuts and ends up 5543.1 Mpc (2630858023250000000 km) away from MRO. Not sure what's going on here.


The problems with track are now fixed in CVS. Are you building from the CVS tree or using a prebuilt version of Celestia?

--Chris

mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #30by mcaplinger » 30.11.2006, 14:48

chris wrote:The problems with track are now fixed in CVS. Are you building from the CVS tree or using a prebuilt version of Celestia?

What great service! Thanks!

I've been using the prebuilt Windows binary. I've got the source on my Linux machine at work but haven't had the chance to sort through all the package dependencies yet.

I've also been looking at the Mars Express SPICE kernels and haven't gotten the MEx orbit to display very well even with a period specification. Here's my ssc for that:

"MEX" "Sol/Mars" {
Radius 0.0001
Color [ 1 1 0]

Beginning "2006 11 01 00:00"
Ending "2006 12 01 00:00:00"

OrbitFrame {
EclipticJ2000 { Center "Sol/Mars" }
}
SpiceOrbit
{
Kernel "ORMM__061101000000_00313.BSP"
Target "-41" # MEX
Origin "499" # MARS BARYCENTER

BoundingRadius 1e10
Period 6.7

Beginning "2006 11 01 00:00:00"
Ending "2006 12 01 00:00:00"

}
}

Note that I had to use 499 for the center rather than 4.

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

Post #31by chris » 05.12.2006, 08:58

mcaplinger wrote:
chris wrote:The problems with track are now fixed in CVS. Are you building from the CVS tree or using a prebuilt version of Celestia?
What great service! Thanks!

I've been using the prebuilt Windows binary. I've got the source on my Linux machine at work but haven't had the chance to sort through all the package dependencies yet.

The new 1.5.0 prerelease has the track fix incorporated. You can download it from here:

http://www.celestiaproject.net/~claurel/celest ... .0pre1.exe

I've also been looking at the Mars Express SPICE kernels and haven't gotten the MEx orbit to display very well even with a period specification.

I'll try and find a way to make this work better; the current limitations of Celestia's trajectory plotting are causing trouble in a number of situations, the latest being the Sun's orbit about the solar system barycenter. Do you think that you could give an example of what you'd like to see plotted for Mars Express? Do you want to see every orbit over the whole time range of the SPICE kernel? Or just a few orbits around the current time?

Note that I had to use 499 for the center rather than 4.


Thanks for pointing that out. I had thought that the Mars center and Mars system barycenter were always treated as effectively the same.

--Chris

mcaplinger
Posts: 6
Joined: 28.11.2006
With us: 17 years 11 months

Post #32by mcaplinger » 28.12.2006, 21:04

chris wrote:Do you think that you could give an example of what you'd like to see plotted for Mars Express? Do you want to see every orbit over the whole time range of the SPICE kernel? Or just a few orbits around the current time?

I would prefer a single orbit centered on the current time, but anything approximating this wouild be OK.


Return to “Celestia Users”