N IF Navigation and Ancillary Information Facility Porting

  • Slides: 20
Download presentation
N IF Navigation and Ancillary Information Facility Porting SPICE Kernels Between Computers June 2004

N IF Navigation and Ancillary Information Facility Porting SPICE Kernels Between Computers June 2004

N IF Topics Navigation and Ancillary Information Facility • Porting summary • Identification of

N IF Topics Navigation and Ancillary Information Facility • 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 betweencompatible environments • Porting kernels betweentext-incompatibleenvironments • Porting kernels betweenbinary-incompatibleenvironments – using any Toolkit version – using SPICE Toolkit Version N 0052* or later • Caveats • Allowed operations when using non-native binary kernels with Toolkit version N 0052* or later • Future plans regarding porting SPICE kernels • No difference between using the FORTRAN or C versions of the Toolkit *SPICE Toolkit Version N 0052 was released February, 2002 Porting Kernels 2

N IF Porting Summary Navigation and Ancillary Information Facility *SPICE Toolkit Version N 0052

N IF Porting Summary Navigation and Ancillary Information Facility *SPICE Toolkit Version N 0052 was released February, 2002 Porting Kernels 3

N IF Text and Binary Kernels Navigation and Ancillary Information Facility SPICE text kernels

N IF Text and Binary Kernels Navigation and Ancillary Information Facility 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* * New kinds of kernels, under development Porting Kernels “kernel” means “SPICE data file” 4

N IF Compatible Environments for Text Kernels Navigation and Ancillary Information Facility Since text

N IF Compatible Environments for Text Kernels Navigation and Ancillary Information Facility Since text kernels are only text files… Porting Kernels 5

N IF Compatible Environments for Binary Kernels Navigation and Ancillary Information Facility Porting Kernels

N IF Compatible Environments for Binary Kernels Navigation and Ancillary Information Facility Porting Kernels 6

N IF Porting Text and Binary Kernels Between Compatible Computers Navigation and Ancillary Information

N IF Porting Text and Binary Kernels Between Compatible Computers Navigation and Ancillary Information Facility • You may safely use the binary mode of ftp when moving binary or text kernels betweencompatible 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 7

N IF Porting Kernels Between Text-Incompatible Computers (1) Navigation and Ancillary Information Facility •

N IF Porting Kernels Between Text-Incompatible Computers (1) Navigation and Ancillary Information Facility • 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 incompatiblecomputers. – SPICE cannot process a text-incompatible kernel. Loading such a kernel does not change the state of the kernel pool (a no-op). text kernel Porting Kernels FTP using ASCII mode text kernel 8

N IF Porting Kernels Between Text-Incompatible Computers (2) Navigation and Ancillary Information Facility •

N IF Porting Kernels Between Text-Incompatible Computers (2) Navigation and Ancillary Information Facility • Porting text kernels betweenincompatible environments requires care. Enhanced security requirements at some installations now mandates the use of sftp and scp perform pure binary data transfers. – Simple commands to convert line terminator » Unix commandsdos 2 unix, unix 2 dos. If unavailable, try Perl… » Dos->Unix • perl -pi -e 's/1512/' file_name » Unix->Dos • perl -pi -e 's/12/1512/' file_name Porting Kernels 9

N IF Porting Kernels Between Binary-Incompatible Computers (1) Navigation and Ancillary Information Facility •

N IF Porting Kernels Between Binary-Incompatible Computers (1) Navigation and Ancillary Information Facility • 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 N 0052* you had to use the “SPICE transfer format” to port binary kernels between incompatiblecomputers – This is explained in subsequent pages • Starting with Toolkit version N 0052*, binary kernels may be ported betweenincompatiblecomputers 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 N 0052 was released February, 2002 Porting Kernels 10

N IF Porting Kernels Between Binary-Incompatible Computers (2) Navigation and Ancillary Information Facility Using

N IF Porting Kernels Between Binary-Incompatible Computers (2) Navigation and Ancillary Information Facility Using version N 0051 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 11

N IF Porting Binary Kernels Between Incompatible Computers (3) Navigation and Ancillary Information Facility

N IF Porting Binary Kernels Between Incompatible Computers (3) Navigation and Ancillary Information Facility Using version N 0051 Toolkit or earlier Brand X Computer (e. g. PC/Win) Brand Y Computer (e. g. Sun/Solaris) ephemeris. bsp toxfr tobin ephemeris. xsp FTP using ASCII mode ephemeris. xsp “toxfr” and “tobin” are SPICE Toolkit utility programs Porting Kernels 12

N IF Porting Kernels Between Binary-Incompatible Computers (4) Navigation and Ancillary Information Facility Using

N IF Porting Kernels Between Binary-Incompatible Computers (4) Navigation and Ancillary Information Facility Using version N 0052 Toolkit or later • The N 0052 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 theincompatiblecomputers 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 X Computer (e. g. PC/Win. NT) binary kernel Porting Kernels Brand Y Computer (e. g. Sun/Solaris) FTP using binary mode binary kernel 13

N IF Porting Binary Kernels - Caveats (1) Navigation and Ancillary Information Facility Using

N IF Porting Binary Kernels - Caveats (1) Navigation and Ancillary Information Facility Using version N 0052 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 notwrite 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 14

N IF Porting Binary Kernels - Caveats (2) Navigation and Ancillary Information Facility Using

N IF Porting Binary Kernels - Caveats (2) Navigation and Ancillary Information Facility 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 15

N IF Porting Binary Kernels - Allowed Operations (1) Navigation and Ancillary Information Facility

N IF Porting Binary Kernels - Allowed Operations (1) Navigation and Ancillary Information Facility Using version N 0052 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 nonnative SPK files – The resultant, merged SPK file will be in native format Porting Kernels 16

Porting Binary Kernels - Allowed Operations (2) N IF Navigation and Ancillary Information Facility

Porting Binary Kernels - Allowed Operations (2) N IF Navigation and Ancillary Information Facility Using version N 0052 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: ephemeris. bsp toxfr ephemeris. xsp tobin ephemeris. bsp (native binary format) (non-native binary format) (“transfer” format) Porting Kernels 17

N IF Don’t Use Email! Navigation and Ancillary Information Facility • NAIF recommends against

N IF Don’t Use Email! Navigation and Ancillary Information Facility • 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 18

N IF Future Plans for Porting Kernels Navigation and Ancillary Information Facility • NAIF

N IF Future Plans for Porting Kernels Navigation and Ancillary Information Facility • NAIF does not anticipate revising text kernel readers to process non-native (incompatible) text kernels. As of Toolkit version N 0057, 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 nonnative 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 19

N IF FORTRAN versus C Navigation and Ancillary Information Facility • The C, FORTRAN,

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