1 / 20

Porting SPICE Kernels Between Computers

This article provides a summary and guidelines for porting SPICE text and binary kernel files between compatible and incompatible computing environments. It includes information on identification, porting methods, and allowed operations. The article also discusses future plans and new kinds of kernels under development.

Download Presentation

Porting SPICE Kernels Between Computers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Porting SPICE KernelsBetween Computers June 2004

  2. Topics • Porting summary • Identification of SPICE text and binary kernel files • Compatible and incompatible computing environments • for text files • for binary files • Porting text and binary kernel files between compatible environments • Porting kernels between text-incompatible environments • Porting kernels between binary-incompatible environments • using any Toolkit version • using SPICE Toolkit Version N0052* or later • Caveats • Allowed operations when using non-native binary kernels with Toolkit version N0052* or later • Future plans regarding porting SPICE kernels • No difference between using the FORTRAN or C versions of the Toolkit *SPICE Toolkit Version N0052 was released February, 2002 Porting Kernels

  3. Porting Summary *SPICE Toolkit Version N0052 was released February, 2002 Porting Kernels

  4. SPICE text kernels are: text PCK (the most standard type of PCK) IK FK LSK SCLK “Furnsh” kernel MK (“mission kernel) SPICE binary kernels are: SPK binary PCK (exists only for Earth and moon) CK ESQ (part of the E-kernel) DBK (database kernel) Sky catalog* Control net kernel* Terrain kernel* Text and Binary Kernels * New kinds of kernels, under development “kernel” means “SPICE data file” Porting Kernels

  5. Compatible Environmentsfor Text Kernels Since text kernels are only text files… Porting Kernels

  6. Compatible Environmentsfor Binary Kernels Porting Kernels

  7. Porting Text and Binary KernelsBetween Compatible Computers • You may safely use the binary mode of ftp when moving binary or text kernels between compatible computing environments. • Use an ftp client or use an Internet browser with ftp://….. • Can also use AFS, NFS or unix cp, scp, or sftp Porting Kernels

  8. Porting Kernels BetweenText-Incompatible Computers (1) • Text information is always provided using ASCII codes for all computing environments. • However, different environments use different methods for indicating the end of a line of text. • Port text kernels using ftp ASCII mode. • ftp provides the needed conversion when moving text files between incompatible computers. • SPICE cannot process a text-incompatible kernel. Loading such a kernel does not change the state of the kernel pool (a no-op). FTP using ASCII mode text kernel text kernel Porting Kernels

  9. Porting Kernels BetweenText-Incompatible Computers (2) • Porting text kernels between incompatible environments requires care. Enhanced security requirements at some installations now mandates the use of sftp and scp. sftp and scp perform pure binary data transfers. • Simple commands to convert line terminator • Unix commands dos2unix, unix2dos. If unavailable, try Perl… • Dos->Unix • perl -pi -e 's/\015\012/\012/' file_name • Unix->Dos • perl -pi -e 's/\012/\015\012/' file_name Porting Kernels

  10. Porting Kernels BetweenBinary-Incompatible Computers (1) • Different computers use different means for storing binary data • The compatible groupings were shown on an earlier page • Computers in different groups are “incompatible” • Prior to SPICE Toolkit version N0052* you had to use the “SPICE transfer format” to port binary kernels between incompatible computers • This is explained in subsequent pages • Starting with Toolkit version N0052*, binary kernels may be ported between incompatible computers by simply ftp’ing in binary mode • This is explained in subsequent pages • Does not include VAX computers • Does not yet work for EK/ESQ *SPICE Toolkit Version N0052 was released February, 2002 Porting Kernels

  11. Porting Kernels BetweenBinary-Incompatible Computers (2) Using version N0051 Toolkit or earlier • On the source machine, use “toxfr” to convert from binary to SPICE transfer format.* • Use FTP in ASCII mode to move the SPICE transfer format file between the incompatible computers. • On the destination machine, use “tobin” to convert from transfer to binary format.* • The next page displays a graphic representation of this process. * “toxfr” and “tobin” are SPICE Toolkit programs Porting Kernels

  12. Porting Binary Kernels BetweenIncompatible Computers (3) Using version N0051 Toolkit or earlier Brand X Computer (e.g. PC/Win) Brand Y Computer (e.g. Sun/Solaris) ephemeris.bsp ephemeris.bsp toxfr tobin FTP using ASCII mode ephemeris.xsp ephemeris.xsp “toxfr” and “tobin” are SPICE Toolkit utility programs Porting Kernels

  13. Porting Kernels BetweenBinary-Incompatible Computers (4) Using version N0052 Toolkit or later • The N0052 Toolkit includes binary kernel reader modules that detect the environmental heritage of a binary kernel and perform the proper run-time interpretation of the byte stream. • You can simply move the file between the incompatible computers using binary mode of FTP. • Could also use AFS, NFS or cp • Since the SPICE reader modules perform additional processing when reading binary files from incompatible computers, the “read” speed may be slower then when reading compatible binary kernels. Brand Y Computer (e.g. Sun/Solaris) Brand X Computer (e.g. PC/WinNT) FTP using binary mode binary kernel binary kernel Porting Kernels

  14. Porting Binary Kernels - Caveats (1) Using version N0052 Toolkit or later • This process is really not “porting” the file; rather it is run-time interpretation of non-native binary files. • If the kernel you are using is a non-native binary kernel you can read this file but you may not write data to this file. • You can not use the SPICE Toolkit’s “commnt” or “spacit” programs, or any other means, to write information into the comment area, or to delete information from the comment area. • You cannot append additional data to the kernel. • Run-time conversion does not work for E-kernel (ESQ) files. • More generally, it does not yet work for any file built upon the SPICE “DAS” architecture. • This process will not work when a VAX is the source or destination machine • No plans to add this capability. Porting Kernels

  15. Porting Binary Kernels - Caveats (2) Using Any Toolkit Version • Never transfer any type of binary kernel using ftp’s ASCII mode. The line terminator conversion intended for pure text files will corrupt the binary data Porting Kernels

  16. Porting Binary Kernels- Allowed Operations (1) Using version N0052 Toolkit or later • You may “load” and read both non-native and native binary kernels in the same runtime instance • You may merge any combination of native and non-native SPK files • The resultant, merged SPK file will be in native format Porting Kernels

  17. Porting Binary Kernels- Allowed Operations (2) Using version N0052 Toolkit or later • You can convert a non-native binary file to native binary format by going through the binary–to transfer–to binary conversion process using NAIF Toolkit utilities “toxfr” and “tobin” • Converting to native binary format will speed up read access • This simple, two-step process takes place on one machine • See flow chart below: tobin ephemeris.bsp toxfr ephemeris.xsp ephemeris.bsp (native binary format) (non-native binary format) (“transfer” format) Porting Kernels

  18. Don’t Use Email! • NAIF recommends against the use of email to transfer kernels… …unless tests prove successful using the same conditions/computers intended for current use. Possible problem causes: • Incompatible binary or text representations (as already discussed). • An attachment size limit somewhere in the e-mail chain. • The sender’s or recipient’s mail client modifies the kernel based on file name or presumed content. • When you must email kernels, compress either with zip, or gzip (or stuffit) to the file then send the compressed file as an email attachment. Porting Kernels

  19. Future Plans for Porting Kernels • NAIF does not anticipate revising text kernel readers to process non-native (incompatible) text kernels. As of Toolkit version N0057, the FURNSH/furnsh_c/cspice_furnsh loader checks the line terminator, signaling an error on non-native text kernels. • NAIF does anticipate extending the ability to use non-native binary files to EK (ESQ) files. • More generally, NAIF will extend non-native read to any SPICE file based on the “DAS” architecture. • NAIF does not plan to extend the ability to use non-native binary files to any situation involving any VAX computer or a DEC Alpha computer using VMS. • Users must continue to use the SPICE “transfer format” process when using these environments. Porting Kernels

  20. FORTRAN versus C • The C, FORTRAN, and IDL SPICE Toolkits possess the same kernel read and write attributes. • This applies whether using a pre-Version N0052 or a post-Version N0052 Toolkit. • This applies whether using “transfer” format to port a binary kernel, or the new N0052 kernel reader modules to do on-the-fly translation of data in a binary kernel. Porting Kernels

More Related