SPKDIFF User's Guide =========================================================================== Last revised on 2021 NOV 17 by B. V. Semenov. Abstract -------------------------------------------------------- SPKDIFF provides means for comparing the trajectories of two bodies or sampling the trajectory of a single body using data from SPICE kernels. Summary -------------------------------------------------------- SPKDIFF provides means for comparing the trajectories of two bodies or sampling the trajectory of a single body known to SPICE and supported by data from SPICE kernels. To compare trajectories the program computes a set of geometric states of a body as seen from a center in a reference frame over an interval of time with a fixed or variable time step using one SPK file, computes a set of geometric states for the same or different body-center-frame combination at the same times using the other SPK file, and then subtracts the corresponding states from each other. Depending on the type of output report requested the program prints to the screen only the maximum differences in position and velocity, or a complete table of position and velocity differences, or a complete table of differences expressed in ``view frame'' coordinates, or results of a simple statistical analysis of the differences expressed in ``view frame'' coordinates. To sample trajectory of a body the program computes a set of geometric states of a body as seen from a center in a reference frame over an interval of time with fixed or variable time step, using a given set of kernel files, and prints to the screen a table containing these states. If You Are in a Hurry -------------------------------------------------------- This section shows four very common SPKDIFF usage scenarios with just enough explanations to get you going. An extensive set of detailed examples is provided at the end of this User's Guide. To Check if Two SPK Files Provide Identical Data To check if two SPK files containing trajectories for the same body with respect to the same center in the same reference frame provide identical data, run SPKDIFF as follows: % spkdiff -s where ``'' and ``'' are the names of the two SPK files, and ``step'' is the time step, in seconds. If the maximum position and velocity difference magnitudes in the output are zero (or close to zero, accounting for round off), then the SPKs contain the same data. To Assess Difference Between Two SPK Files To assess the difference between two SPK files containing trajectories for the same body with respect to the same center in the same reference frame as a function of time, run SPKDIFF as follows: % spkdiff -t dump -s where ``'' and ``'' are the names of the two SPK files; ``-t dump'' sets the output format to the dump report showing differences between individual states computed from the files; and ``step'' is the time step, in seconds. The program's output, which can be rather lengthy, can be re-directed to a file using the ``>'' pipe. Using the data captured in the file the difference in position (columns 2-4) and velocity (columns 5-7) can be plotted against time, given as TDB seconds (column 1), to analyze the difference between the trajectories. To print output time tags as UTC in ISO date format instead of TDB seconds, add -k -f 'YYYY-MM-DDTHR:MN:SC.### ::RND' before the ``-t'' option. These additional options specify the name of an LSK file required to convert times to any form other than TDB seconds and the desired output time format using the SPICE TIMOUT routine output time picture notation. To use the view frame dump report output instead of the dump report output, replace ``dump'' with ``dumpvf'', like this: % spkdiff -t dumpvf -s To Sample Trajectory from an SPK File To sample a trajectory provided in an SPK file, run SPKDIFF as follows: % spkdiff -s where ``'' is the name of an SPK file and ``step'' is the time step, in seconds. The program's output -- position (columns 2-4) and velocity (columns 5-7) tagged with time, given as TDB seconds past J2000 (column 1) -- can be re-directed to a file using the ``>'' pipe. To print output time tags as UTC in ISO date format, add -k -f 'YYYY-MM-DDTHR:MN:SC.### ::RND' before ``-s''. These additional options specify the name of an LSK file required to convert times to any form other than TDB seconds and the desired output time format using the SPICE TIMOUT routine output time picture notation. If the SPK file contains data for more than one body and a body different from the body picked by SPKDIFF as default is desired, the name or NAIF ID of the desired body can be specified using ``-b1 '' option, like this: % spkdiff -b1 -s To Sample Trajectory from a set of Kernels To sample the trajectory for a body relative to a center in a reference frame provided by a set of kernels or meta-kernels, run SPKDIFF as follows (the command line below is wrapped to fit the page width): % spkdiff -k -s -b1 -c1
-r1 where ``'' are the names of SPK and other kernel files and/or meta-kernels needed to compute trajectory; ``step'' is the time step, in TDB seconds; ``'' and ``
'' are the names or NAIF IDs of the body and center; and ``'' is the name of the reference frame. For lengthy reports the program's output should be re-directed to a file using the ``>'' pipe. Usage -------------------------------------------------------- SPKDIFF is a command line program with the following usage: % spkdiff [options] % spkdiff [options] % spkdiff [options] The options are: -k -b1 -c1 -r1 -k1 -b2 -c2 -r2 -k2 -b -e -s