[Spice_discussion] Error loading event kernel

Nat Bachman Nathaniel.Bachman at jpl.nasa.gov
Sat Sep 24 17:24:32 PDT 2005


Hi Joe,

Of the existing types of binary SPICE kernels, only binary
DAF-based SPICE kernels are portable between platforms having
incompatible binary data formats (big-endian vs little-endian).
The DAF based kernel types are:

  SPK
  CK
  binary PCK (provides high-precision orientation of planets,
              natural satellites, and asteroids)


DAS-based files---of the current binary SPICE kernel types, only
E-kernels (EKs) are DAS-based---are not portable without modification.

If you want to move an EK from a Sun/Unix system to a PC/*Linux* system, you
normally should first run toxfr on the kernel to convert it to ASCII
"transfer" format, then ftp the transfer file to your system in either
binary or *ASCII* ftp mode, then convert the file back to binary format
on your system using tobin.  If you're using a PC/*Windows* system, you
must either copy the transfer file to your system in ASCII ftp mode, or
run unix2dos on it, copy it in binary mode and then  before running tobin.

Moving text kernels (for example, leapseconds kernels) from a Sun/Unix
to PC/Windows platform via ftp also requires using ASCII mode if
available, or else running unix2dos on the kernels before porting them
in binary mode.  Since you're running Linux, you should be able to use text
kernels from a Sun as is.

The above topics are discussed in detail in NAIF's "Porting Kernels"
tutorial, which is available on the NAIF web site, at the URL:

   http://naif.jpl.nasa.gov/naif/tutorials.html

NAIF has on our worklist (specifically, it's on my worklist) the task of 
upgrading
the SPICE system to make DAS files, and hence EKs, portable.  As much as 
I'd like
to solve this problem today, I don't think this upgrade will happen before
the N0060 version of the Toolkit is released (we're currently working on
the N0059 version).

NAIF is also working on a tool "bingo" that converts a binary kernel
from little-endian to big-endian format, and vice versa.  I
can provide you with a Linux executable, and if necessary C source code, for
a prototype version.  This tool works on both DAF and DAS files; you can
run it locally on the file you're having trouble with. 

By the way, NAIF is also working on an upgrade to make CSPICE and Icy 
(the IDL version
of SPICE) able to read non-native text kernels.  We don't expect to 
upgrade the Fortran
Toolkit in this way because although the problem is solvable on a 
variety of Fortran
systems, we haven't found a solution using strictly ANSI standard 
Fortran 77.
Without a portable solution, we'd have a serious maintenance problem on 
our hands,
and in addition, we'd run the risk of having existing functionality 
unexpectedly
"disappear" if the Toolkit were ported to a platform that didn't support our
non-standard implementation.

A final note about the error message you observed:  SPICE is *supposed* 
to give
you a meaningful error message indicating you're trying to load a binary 
kernel
having a non-native format.  Very old E-kernels that don't have internal 
platform
identification info don't support this error diagnostic capability.  Do 
you have
an original file creation date for the problem kernel?  I'd like to 
check this out.
Thanks in advance for any help you can provide.

Best regards,

 -Nat Bachman (NAIF/JPL)

Nathaniel.Bachman at jpl.nasa.gov




Joe Knapp wrote:

> Trying to use the event kernels for the first time, I'm having trouble 
> loading any that I try. This is with the CSPICE library on both a 
> Linux system. I get the folllowing error:
>  
> Subscript out of range on file line 1509, procedure dasfm.
> Attempt to access the 707406378-th element of variable prev.
> Abort
>  
> I get the same message regardless of which e-kernel I try. Same thing 
> happens on a Windows platform.
>  
> I stripped down the code to the bare minimum:
>  
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <cspice/SpiceUsr.h>
> #define KROOT "/home/httpd/html/cassini/kernels"
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <cspice/SpiceUsr.h>
> #define KROOT "/home/httpd/html/cassini/kernels"
>
> int main(int argc, char **argv)
> {
>         erract_c("SET",80,"REPORT") ;
>         furnsh_c(KROOT"/lsk/naif0008.tls") ;
>         furnsh_c(KROOT"/sclk/cas00093.tsc") ;
>         furnsh_c(KROOT"/ek/10A.bdb") ;
>
> }
>
> The leapsecond & sclk kernels load OK, but the event kernels (from the 
> Cassini NAIF files) fail every time with the above error.
>
> Any help appreciated!
>
> Joe
>
>  
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Spice_discussion mailing list
>Spice_discussion at naif.jpl.nasa.gov
>http://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion
>  
>



More information about the Spice_discussion mailing list