IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Cassini SPICE problem
Bjorn Jonsson
post May 14 2006, 12:22 AM
Post #1


IMG to PNG GOD
****

Group: Moderator
Posts: 1449
Joined: 19-February 04
From: Near fire and ice
Member No.: 38



This is a slightly unusual topic wink.gif.

I have been writing a utility program to extract lots of information from the Cassini SPICE kernels, for example determining exactly what Cassini's cameras 'see' at a given time. I'm using the CSPICE toolkit.

I have had no problems determining Cassini's location in either the J2000 or the IAU_<target> reference frames and subsequently the subspacecraft longitude/latitude, distance and illumination geometry using spkezr_c, subpt_c etc.

However, determining the camera pointing and then using it to determine the location of the subspacecraft point in the image as well as the north azimuth has been problematic. This is trivial if I know the camera angles (right ascension, declination and twist), see e.g. appendix A in Cooper et. al., Icarus 181 (2006), 223-234. However if I don't know these angles I need to extract a C-matrix from one of the CK kernel files. This works but these files contain only the rotation of the entire spacecraft (this is not unexpected since the instruments are body fixed so this can be used to determine where they are looking). However, I have had problems using this C-matrix to determine the exact viewing geometry. I need to somehow 'convert' it to a C-matrix that gives me the camera angles. My code is very close to working but one of the camera angles is always off by 180 degrees. I will probably eventually figure this out but I know there are some people here who have done something similar, in particular jmknapp (however, he has been inactive for several weeks now) so I decided to try asking here.

Has anyone here done something similar to what I'm doing ?
Go to the top of the page
 
+Quote Post
pat
post May 15 2006, 01:47 PM
Post #2


Junior Member
**

Group: Members
Posts: 76
Joined: 19-October 05
Member No.: 532



QUOTE (Bjorn Jonsson @ May 14 2006, 01:22 AM) *
This is a slightly unusual topic wink.gif.

I have been writing a utility program to extract lots of information from the Cassini SPICE kernels, for example determining exactly what Cassini's cameras 'see' at a given time. I'm using the CSPICE toolkit.

I have had no problems determining Cassini's location in either the J2000 or the IAU_<target> reference frames and subsequently the subspacecraft longitude/latitude, distance and illumination geometry using spkezr_c, subpt_c etc.

However, determining the camera pointing and then using it to determine the location of the subspacecraft point in the image as well as the north azimuth has been problematic. This is trivial if I know the camera angles (right ascension, declination and twist), see e.g. appendix A in Cooper et. al., Icarus 181 (2006), 223-234. However if I don't know these angles I need to extract a C-matrix from one of the CK kernel files. This works but these files contain only the rotation of the entire spacecraft (this is not unexpected since the instruments are body fixed so this can be used to determine where they are looking). However, I have had problems using this C-matrix to determine the exact viewing geometry. I need to somehow 'convert' it to a C-matrix that gives me the camera angles. My code is very close to working but one of the camera angles is always off by 180 degrees. I will probably eventually figure this out but I know there are some people here who have done something similar, in particular jmknapp (however, he has been inactive for several weeks now) so I decided to try asking here.

Has anyone here done something similar to what I'm doing ?


The problem is probably due to the camera frame definition JPL uses (and defined in the Cassini SPICE frames kernel) being different to the camera frame thats actually being used by the ISS scientists. The transformation from the 'JPL frame' to the frame used by the ISS people involves an additional 180 deg rotation about the camera frame 'Z' axis after the transformation from the spacecraft bus frame (which is the frame of the C-kernels) to the 'JPL camera frame' as per the Cassini SPICE frames kernel.

The coordinate system being used by the ISS team members has the origin in the top left of the image with line(y) increasing downwards and sample(x) increasing to the right. This is the same as the Voyager convention.

For some weird reason the 'JPL camera frame' has line increasing upwards and sample increasing to the left

Like all the imaging scientists you are probably used to the Voyager convention. Adding an an additional 180 deg rotation around the camera frame 'Z' axis to the transformation will probably solve your problem. This is what the software being used by ISS team members does.
Go to the top of the page
 
+Quote Post
tallbear
post May 16 2006, 08:59 PM
Post #3


Junior Member
**

Group: Members
Posts: 45
Joined: 30-November 05
Member No.: 592



QUOTE (pat @ May 15 2006, 06:47 AM) *
The problem is probably due to the camera frame definition JPL uses (and defined in the Cassini SPICE frames kernel) being different to the camera frame thats actually being used by the ISS scientists. The transformation from the 'JPL frame' to the frame used by the ISS people involves an additional 180 deg rotation about the camera frame 'Z' axis after the transformation from the spacecraft bus frame (which is the frame of the C-kernels) to the 'JPL camera frame' as per the Cassini SPICE frames kernel.

The coordinate system being used by the ISS team members has the origin in the top left of the image with line(y) increasing downwards and sample(x) increasing to the right. This is the same as the Voyager convention.

For some weird reason the 'JPL camera frame' has line increasing upwards and sample increasing to the left

Like all the imaging scientists you are probably used to the Voyager convention. Adding an an additional 180 deg rotation around the camera frame 'Z' axis to the transformation will probably solve your problem. This is what the software being used by ISS team members does.






The Instrument Frame kernels document this system...

for furthere instructions on how to do the transforms look at the SPICE instructional materials
... doing the transform correctly using the SPICE sytem should get you the correct pointing
... just load the correct instrument frame kernel and do the transform....

sort of sounds like you are not doing the transform correctly ...
but I'd strongly suggest re reading the SPICE docs on the use of the instrument
fram kernels...
Go to the top of the page
 
+Quote Post
Bjorn Jonsson
post May 16 2006, 09:39 PM
Post #4


IMG to PNG GOD
****

Group: Moderator
Posts: 1449
Joined: 19-February 04
From: Near fire and ice
Member No.: 38



Thanks for very useful bits of information. It was very nice to get a (probable) confirmation of what I was starting to suspect. I didn't want to add any 'magic constants' (e.g. 180 degrees) to my code without first knowing what was going on - when one needs these it often means that something is wrong somewhere.

My code now apparently works perfectly and returns from the SPICE kernels *exactly* the camera angles I expected for the PDS images I have checked my code against.


EDIT: Despite the fact that everything seems to work I strongly suspect my code could be streamlined a bit once I have read more of the SPICE docs.
Go to the top of the page
 
+Quote Post
tallbear
post May 17 2006, 04:33 AM
Post #5


Junior Member
**

Group: Members
Posts: 45
Joined: 30-November 05
Member No.: 592



QUOTE (Bjorn Jonsson @ May 16 2006, 02:39 PM) *
EDIT: Despite the fact that everything seems to work I strongly suspect my code could be streamlined a bit once I have read more of the SPICE docs.




<GGG> I was shown a bit ago how replacing many of the simpler SPICE transforms and calculations with your own code could greatly speed up SPICE based programs.... The code is super ROBUST but it can slow things down... I'ts probably good to start out using the SPICE modules just to get things correct ... but thenif you need more speed and can do a bunch of the transforms on your own....pulling out some of the super robust SPICE routines and replacing thiem with simpler routines can really speed a program up...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 16th April 2014 - 07:02 PM
RULES AND GUIDELINES
Please read the Forum Rules and Guidelines before posting.

IMAGE COPYRIGHT
Images posted on UnmannedSpaceflight.com may be copyrighted. Do not reproduce without permission. Read here for further information on space images and copyright.

OPINIONS AND MODERATION
Opinions expressed on UnmannedSpaceflight.com are those of the individual posters and do not necessarily reflect the opinions of UnmannedSpaceflight.com or The Planetary Society. The all-volunteer UnmannedSpaceflight.com moderation team is wholly independent of The Planetary Society. The Planetary Society has no influence over decisions made by the UnmannedSpaceflight.com moderators.
SUPPORT THE FORUM
Unmannedspaceflight.com is a project of the Planetary Society and is funded by donations from visitors and members. Help keep this forum up and running by contributing here.