Page 1 of 3

Catch 22 with SPICE

Posted: 22.09.2006, 19:54
by cartrite
Anyone remember the movie??:wink:

Problem:
The Spice library only works on my 64 bit OS if it was compiled with a 32 bit compiler. It does work though. It will not work when compiled with a 64 bit compiler.
I can only compile Celestia with a 64 bit compiler on my 64 bit OS. If I try to compile with a 32 bit compiler KDE fails because of QT and GTK and Gnome fails because of a missing jpeg lib.
Those programs are installed and I tell configure where to find them but they are ignored.
So I can't get the 2 of them talking. :? 8O :cry: :?: Any Ideas would be appreciated. I did get it working on my other systems so I can still play around with it. But I would like to get it working on Suse 10 because that's where most of my work is done.

Anyhow, on a different note, while using the Spice libs I came across the program brief.
Running it on a .bsp file gives some interesting output to help with creating ssc files.

Code: Select all

Brief.  Version: 2.3.1        (SPICE Toolkit N0060)


Summary for: 060810R_SCPSE_06162_06193.bsp

Body: CASSINI (-82)
      Start of Interval (ET)              End of Interval (ET)
      --------------------------------    --------------------------------
      2006 JUN 11 12:00:00.000            2006 JUL 12 12:00:00.000

Bodies: EARTH BARYCENTER (3)    MIMAS (601)             HYPERION (607)
        JUPITER BARYCENTER (5)  ENCELADUS (602)         IAPETUS (608)
        SATURN BARYCENTER (6)   TETHYS (603)            PHOEBE (609)
        SUN (10)                DIONE (604)             SATURN (699)
        MOON (301)              RHEA (605)
        EARTH (399)             TITAN (606)
        Start of Interval (ET)              End of Interval (ET)
        --------------------------------    --------------------------------
        2006 JUN 11 12:00:00.000            2006 JUL 12 12:00:00.000
At least I think it would help. I have not created any yet.

cartrite

Re: Catch 22 with SPICE

Posted: 22.09.2006, 20:06
by Cham
cartrite wrote:Anyone remember the movie??:wink:


Actually, I have that great movie in DVD, in my smalll movies collection. :P

Posted: 22.09.2006, 20:13
by chris
I don't think you'll have to wait too much longer for a 64-bit version. Here's an announcement on NAIF site (http://naif.jpl.nasa.gov/naif/):

The next Toolkit release, N61, is expected in the November 2006 time frame. It will include several new computing environments: PC/Linux 64 bit, Intel Fortran for PC/Windows, and Intel Fortran for Mac/OSX. In response to customer recommendations it will also include substantial hyperlinking of documentation.


--Chris

Posted: 22.09.2006, 20:39
by cartrite
Cool, Thats good news. :)

Posted: 26.09.2006, 03:32
by cartrite
I tried to construt the Near mission as Chris did and I got it working with my linux version on suse 9.2 but the win32 version will not read the metakernel.

Code: Select all

\begindata

PATH_VALUES = ( 'extras/near/data' )
PATH_SYMBOLS = ( 'P' )

KERNELS_TO_LOAD = (
                    '$P/de403s.bsp',
                    '$P/erosephem_1999004_2002181.bsp',
           '$P/math9749.bsp',
                    '$P/near_cruise_nav_v1.bsp',
           '$P/near_erosorbit_nav_v1.bsp',
           '$P/near_eroslanded_nav_v1.bsp'
                   )


Is there a different path I should be using. I tried a full path, path with "\" instead of "/" , and nothing.

The linux version is from 9/20 and the win32 version is from 9/25 if that make a diiff. 8O My linux version reported touchdown at 19:29:59 on 2/12/2001 UTC.

Image

edit: Actually at 19:44:16 the near model dissappears so I guess that is the actual touhdown time that celestia is reporting. I also guess the negative distance is due to the irregular shape of Eros. Just before touchdown I took this screenshot. The Eros model starts to disappear when veiwed from this angle after this.

Image

I wonder if this was where Near really touched down. Near is the little white dot just above the large crater facing downwards.It will diappear at the next second.

Image

cartrite

Posted: 26.09.2006, 14:03
by cartrite
The win32 version of cvs (09/25/2006) doesn't seem to read a ssc file from the extras folder for asteroids or spacecraft correctly. The Replace line doesn't work at all and the Modify line will only work fully if the texture line from the asteroid.ssc file is commented out. If it isn't commented out , then the normalmap is not loaded.

The Near addon from the motherlode will not work at all with or without spice unless it is added to the spacecraft.ssc file and the texture is added to the texture/medres folder.

This doesn't seem to affect the linux kde version from 9/20/06.

Posted: 26.09.2006, 14:49
by Cham
Take note that the NEAR model has some specular reflection problems here. I've corrected that model to use with Celestia 1.5.0. Just follow that thread :

http://www.celestiaproject.net/forum/viewtopic.php?t=10149

There's a download link to a new version in the middle of the first page. :wink:

Posted: 26.09.2006, 15:02
by cartrite
The Near addon I used was created by Jack Higgins and packaged by Frank Gregorio. The only spacecraft addons I seen there from you was Messenger and Luna 1..

Posted: 26.09.2006, 15:05
by Cham
O my ! :roll: Just follow that link and read !

Posted: 26.09.2006, 15:31
by cartrite
I just downloaded the packages and put together a Near folder and that works so there must be something incompatable between the motherlode addon and cvs ver 1.5. That doesn't explain why the eros model isn't working right with Replace or Modify defs in the other .ssc which looks like this.

Code: Select all

Modify "Eros" "Sol"
{
    Class "asteroid"
    Mesh   "eros-360.cmod"
    Color [ 1.000 0.878 0.853 ]
    BlendTexture true
    Radius 16.3 # maximum semi-axis
    MeshCenter [ -1.262 0.168 -0.164 ]
 
    SpiceOrbit
    {
        Kernel "near-kernels.txt"
        Target "2000433"
        Origin "Sun"
            BoundingRadius 2
            Period 1.761
 
        Beginning "1999 1 3 20:00:00"
        Ending "2002 8 1 00:00:00"
    }
 
    RotationPeriod         5.270
    Obliquity             78.70
    EquatorAscendingNode 107.23
    RotationOffset       338.165
 
    Albedo 0.16
}

"NEAR Shoemaker" "Sol"
{
    Class "spacecraft"
    Mesh "near.3ds"        # substitute "near.3ds" if you have the NEAR
                 # model installed in Celestia
    Radius 0.002
    RotationOffset 270
 
    Beginning "1996 5 31"
    Ending "2001 2 12 19:45:20"
 
    SpiceOrbit
    {
        Kernel "near-kernels.txt"
        Target "NEAR"
            Origin "Sun"
        BoundingRadius 2
 
        Beginning "1996 5 31"
        Ending "2001 2 12 19:45:20"
    }
}

With that file the model eros-360 loads without the normalmap with Modify and doesn't load at all with Replace. This doesn't effect the linux version.
Also, the Near model not only doesn't load, but it is not even defined when trying to enter it on the command line.

Posted: 26.09.2006, 15:53
by Cham
I wasn't able to use the NormalMap either. I don't know why, but no bumps ! :-(

Posted: 26.09.2006, 15:59
by cartrite
The model eros-360.cmod is looking for erosnm.png not 2k-erosnm.png or erosnm-2k.png. One of those last 2 names is the name of the file I downloaded. Also.

Cham wrote
I wasn't able to use the NormalMap either. I don't know why, but no bumps

Did you try this?
Modify line will only work fully if the texture line from the asteroid.ssc file is commented out. If it isn't commented out , then the normalmap is not loaded.

Posted: 26.09.2006, 16:14
by chris
[Editing to add missing image link :oops: ]
http://near.jhuapl.edu/iod/20010202/index.html

This image shows the point where NEAR landed on Eros. It's difficult to tell how closely Celestia matches that image. The fifteen minute discrepancy in the landing time suggests that it's not quite the right spot. If I had to guess what was wrong, I'd blame inaccuracies in the orientation of Eros. There's a large binary file on the NEAR SPICE respository with orientation information for Eros. Celestia can't yet use that type of SPICE file. But, tuning the rotation parameters for Eros so that they're exactly right at the time of touchdown might be a shortcut to a perfect recreation of the NEAR Shoemaker mission.

--Chris

Posted: 26.09.2006, 16:48
by cartrite
Chris,
I'm not sure which image you mean.
Is this the file you were referring to. erosatt_1999304_200115.bpc.
If it is, I'll try running some of the spice tools on it to see what it says to see if I can come up with a correct orientation. This was the description in the lbl file
"The latest Eros body-fixed frame
orientation binary PCK file provided by the NEAR NAV, JPL to the NEAR
project and used to support Eros orbit phase operations and science data
processing "
Also the file eros80.bsp had an lbl counterpart that had this description. Mabey this file would work better than erosephem_1999004_2002181.bsp.
"SPK file containing Asteroid Eros
ephemerides, provided by the Solar System Dynamics Group, JPL in September
2001. This solution has higher accuracy than the files used during the
mission operations because it is based on a greater number of observations,
many of which were obtained over the course of the NEAR mission. "
The spkinfo.txt file from the folder where all the kernels were downloaded had this to say
EROS80 SPK file containing the Asteroid Eros
ephemerides, provided by the Solar
System Dynamics Group, JPL in
September 2001. This solution has
higher accuracy than the file used
during the mission operations because
it is based on a greater number of
observations, many of which were
obtained over the course of the NEAR
mission. The average difference
between this file and the
'EROSEPHEM_1999004_2002181' file is on
the order of 30-50 kilometers.

Posted: 26.09.2006, 17:26
by chris
cartrite wrote:Chris,
I'm not sure which image you mean.
It was left out my original post; I edited it to add the link.

Is this the file you were referring to. erosatt_1999304_200115.bpc.
If it is, I'll try running some of the spice tools on it to see what it says to see if I can come up with a correct orientation. This was the description in the lbl file
"The latest Eros body-fixed frame
orientation binary PCK file provided by the NEAR NAV, JPL to the NEAR
project and used to support Eros orbit phase operations and science data
processing "

That's the one. I'd be very interested in the results of your attempts to correct the orientation of Eros.

Also the file eros80.bsp had an lbl counterpart that had this description. Mabey this file would work better than erosephem_1999004_2002181.bsp.
"SPK file containing Asteroid Eros
ephemerides, provided by the Solar System Dynamics Group, JPL in September
2001. This solution has higher accuracy than the files used during the
mission operations because it is based on a greater number of observations,
many of which were obtained over the course of the NEAR mission. "


I think that I looked at that one and it didn't have coverage for the entire NEAR mission. I could be mistaken about that. Anyhow, it doesn't matter much for the NEAR touchdown since the position of NEAR in the Eros orbiting phase of the mission is relative to Eros in the SPK files (you can use brief with the -c option to show the centers for each segment of the trajectory.)

--Chris

Posted: 26.09.2006, 18:18
by cartrite
I just tried to replace the file erosephem_1999004_2002181.bsp with eros80.bsp and that didn't work. Everything disappeared. Using both didn't make much (if any) of a difference either.

The ship is not really touching down. This sreenshot shows the veiw of the last second before everything disappears. Trouble is, that when eros is rotated, Near's position changes too. (I'll have to post it later. Image Shack will not upload anything now)

Posted: 26.09.2006, 18:42
by chris
cartrite wrote:I just tried to replace the file erosephem_1999004_2002181.bsp with eros80.bsp and that didn't work. Everything disappeared. Using both didn't make much (if any) of a difference either.

Yes, I think that's because eros80.bsp doesn't cover the entire mission timespan.

The ship is not really touching down. This sreenshot shows the veiw of the last second before everything disappears. Trouble is, that when eros is rotated, Near's position changes too. (I'll have to post it later. Image Shack will not upload anything now)
[/quote]

I see the probe disappear inside of Eros before disappearing about 15 minutes later. The orientation of Eros shouldn't affect the position of NEAR. You have the parent object of NEAR set to Sol, not Eros right?

--Chris

Posted: 26.09.2006, 19:56
by cartrite
Yes. Near's parent is Sol. It doesn't really change poitions. It just looks that way. As eros is rotated, the white dot that represents Near "appears" to be over a different part of eros. But if you "zoom in", eros dissapears and Near is actually inside the model. Or at least it seems that way. It's hard to tell what's really happening.

I'm not having much luck with the bpc file yet. I tried the tools commt and spacit to try and summarize the file but there were not many good details. Start time, End time, body Id. Nothing on orientation.
:?
I am starting to study the pck.req in doc so..........

Posted: 26.09.2006, 20:20
by cartrite
I managed to convert the bpc file to transfer mode and the first few lines look like

Code: Select all

DAFETF NAIF DAF ENCODED TRANSFER FILE
'DAF/PCK '
'2'
'5'
'astatt.tst                                                  '
BEGIN_ARRAY 1 3496387
'asteroid attitude                       '
'-51144^6'
'2A8EEC^7'
'1E8631'
'1'
'3'
1024
'B^1'



last few lines of the data area look like this

Code: Select all

'44^2'
'1^1'
'11^2'
END_ARRAY 1 3496387
TOTAL_ARRAYS 1


Not much ayy :(

Posted: 26.09.2006, 21:24
by cartrite
I found another way to do multi kernels. Using the tool spkmerge on a command file that looks like this

Code: Select all

leapseconds_kernel  = /home/cartrite/bin/09202006/cspice/exe/naif0007.tls
spk_kernel          = /home/cartrite/bin/09202006/cspice/exe/near-eros.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/de403s.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/erosephem_1999004_2002181.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/eros80.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/math9749.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/near_cruise_nav_v1.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/near_erosorbit_nav_v1.bsp
source_spk_kernel   = /home/cartrite/bin/09202006/cspice/exe/near_eroslanded_nav_v1.bsp


combined all the spk files into one. So I used only one kernel to reconstruct the near mission. Works good with Linux.

BUT it still will not work with Windows.8O
Something happened to eros though. One bookmark I created with the old way did not work because eros shifted by a few hundred KM's. So part of it is working. Near is still MIA. :?