Last revised on 2004 DEC 20 by B. V. Semenov.
MKSPK is a program that creates an SPK file from a text file
containing trajectory information.
MKSPK is a NAIF Toolkit utility program that generates a new, or
appends data to an existing, spacecraft or target body's ephemeris
file in SPICE SPK format using one of the following SPK types: 5, 8,
9, 10, 12, 13, 15, 17. This SPK file is a binary file constructed
according to the SPICE DAF (Double Precision Array File) architecture,
containing one or more SPK data segments.
The MKSPK program accepts one ASCII text file containing descriptions of input data (setup file) and a second ASCII text file (input file) containing the source ephemeris data to be processed.
Source ephemeris data can be time ordered lists of states (positions and velocities), sets of conic elements, sets of two-line elements, or a single set of equinoctial elements. All input data must be defined in a reference frame and relative to a body center both of which are specified in the setup file.
The program allows the user to optionally specify some descriptive text in a separate file (comment file) to be placed into the ``comment area'' of the SPK ephemeris file. (Doing this is highly recommended.)
For archival documentation purposes the content of the MKSPK setup file is automatically placed at the end of the ``comment area'' of the SPK file.
Program usage:
> mkspk [-setup <setup file name>] [-input <input data file name>] [-output <output SPK file name>] [-append] [-u|-usage] [-h|-help] [-t|-template] [<input data type> <output spk type&gIf a setup file name isn't provided on the command line, the program will prompt for it. It will not prompt for the input or output file names -- these must be provided on the command line or in the setup file. If input and output file names are provided on the command line, any file names assigned using setup keywords are ignored.
The input file must already exist.
If the -append key or the corresponding setup file keyword is not specified, the output file must not exist prior to running the program.
If the -append key or the corresponding setup file keyword is provided and the SPK file specified after the -output key exists, then new data will be appended to it.
If the -append key or the corresponding setup file keyword is provided but the SPK file specified after the -output key doesn't exist, then a new SPK file with the name specified after -output key will be created.
Caution: if the program fails for any reason, it, in most cases, deletes the output file, even if it was appending data to an existing SPK file. Therefore, users should always make a backup copy of an SPK file to which new data is going to be appended before running the program in append mode.
Also, the program cannot append data to an existing SPK file if its format is not native to the platform on which the program is running. Refer to the CONVERT User's Guide for details.
You will need a setup file to execute the MKSPK utility program. The
format for the setup file is described below.
As it executes, the program will display a brief summary of its action.
Only one SPK ephemeris file using a single SPK type and containing one or more segments may be generated during a single MKSPK session.
Other than the input and output file names, which may occur on the
command line, the program requires all inputs such as object and body
names or ID, frame name or ID, types of input and output data, list
and order of input parameters, constants, etc. to be provided in a
setup file. The format of this file must conform to the SPICE text
kernel specification since the data from the setup file will be loaded
into a kernel pool. This means that input values must be assigned to
keyword variables using the format
KEYWORD = VALUEEach assignment is restricted to a single line. Sets of these assignments must be enclosed between
\begindata \begintexttokens, each of which must also be placed on a line by itself. Free-form descriptive/explanatory text may occur after the
\begintexttoken. Still more assignments could follow another
\begindatatoken.
The names of the setup file keywords must be strictly uppercase while the standard value of keywords may be upper, lower or mixed case. Any white space preceding or following keyword names, values and equal sign is ignored.
All character string values and time strings must be enclosed in single quotes, provided on a single line and be no longer than 80 characters. When multiple value are allowed and used, enclose the complete set in the "()" characters: KEYWORD = ( 'value1' 'value2' 'value3' ... )
All assignments are either required, conditional or optional as described below.
A setup file may contain blank lines. Non-printing characters including TAB should not be used in a setup file lines containing keyword assignments or a blank lines separating them within the data sections of a setup file. The program may not be able to parse correctly any of the setup file lines that contains non-printing characters and will signal s setup file parsing error on some computer platforms.
The following assignments must be present in a setup file:
INPUT_DATA_TYPE = 'STATES' or 'ELEMENTS' or 'EQ_ELEMENTS' or 'TL_ELEMENTS' OUTPUT_SPK_TYPE = 5 or 8 or 9 or 10 or 12 or 13 or 15 or 17 OBJECT_ID = Numeric code assigned to the object, or NORAD s/c code ('TL_ELEMENTS'/SPK 10 only) or OBJECT_NAME = 'NAIF supported object name' CENTER_ID = Numeric code assigned to the body which is the center of the motion for the object or CENTER_NAME = 'NAIF supported body name' REF_FRAME_NAME = 'reference frame name' PRODUCER_ID = 'producer identifier' DATA_ORDER = 'ordered list of input parameter names' DATA_DELIMITER = 'delimiter separating input data items' LEAPSECONDS_FILE = 'leapseconds file name'The following assignments are required in the setup file if their values are not provided on the command line:
INPUT_DATA_FILE = 'input data file name' OUTPUT_SPK_FILE = 'output SPK file name'
One or more of the following assignments may be needed depending on
the kind of input data being used and other conditions. See the
definitions that follow for details.
PCK_FILE = ( 'PCK_1 file name' 'PCK_2 file name' ... 'PCK_n file name' ) FRAME_DEF_FILE = 'frame definition file name' COMMENT_FILE = 'comment file name' INPUT_DATA_UNITS = ( 'ANGLES = angle unit' 'DISTANCES= distance unit' ) EPOCH_STR_LENGTH = length of epoch string IGNORE_FIRST_LINE = number of initial lines to be ignored while reading input file LINES_PER_RECORD = number of lines in one input record TIME_WRAPPER = '# time wrapper' START_TIME = 'start time' STOP_TIME = 'stop time' PRECESSION_TYPE = 'NO PRECESSION' or 'APSIDE PRECESSION ONLY' or 'NODE PRECESSION ONLY' or 'APSIDE AND NODE PRECESSION' POLYNOM_DEGREE = polynomial degree of Lagrange or Hermite interpolation CENTER_GM = center GM value CENTER_POLE_RA = the right ascension of the center's north pole given with respect to the reference frame CENTER_POLE_DEC = the declination of the center's north pole given with respect to the reference frame CENTER_J2 = center's J2 value CENTER_EQ_RADIUS = center's equatorial radius
SEGMENT_ID = 'segment identifier' APPEND_TO_OUTPUT = flag indicating whether new segments should or shouldn't be appended to an existing SPK file
NAIF_ID = -100000 - NORAD_ID
RADIANS DEGREES ARCMINUTES ARCSECONDS HOURANGLE MINUTEANGLE SECONDANGLE METERS KM CM MM FEET INCHES YARDS STATUTE_MILES NAUTICAL_MILES AU PARSECS LIGHTSECS LIGHTYEARS
"#"
TIME_WRAPPER = '# TDT'
MKSPK requires the input data file to be an ASCII text file containing
states, conic elements or equinoctial elements, or Space Command
two-line elements. Any two-line elements file has fixed format and is
processed as a special case; an input file containing any other type
of input data must comply with the rules described in this section and
the section immediately following it.
The input file must contain a number of data records sufficient to generate an SPK file of a specified type (see subsection below). Each of the records must occupy the same number of non-blank lines and contain the same set of input data items, provided in the same order. Blank lines can appear anywhere between non-blank record lines and are not taken into account by the program.
The data set contained in each record must correspond to a single epoch. Data records in an input file must be provided in strictly increasing time order based on the values of the data item EPOCH. Data records with duplicate EPOCHs are not allowed.
An input file may also contain one or more initial lines that do not represent a valid data record (for example a table header). These lines can be ignored by specifying their count in the IGNORE_FIRST_LINE setup file keyword.
The order of the data items in each input data record must be specified in the DATA_ORDER keyword.
Input data items within each data record must be separated by one of the following delimiters:
'TAB' or 'EOL' or ';' or ',' or ' 'The delimiter is not required but is permitted after the last data item on a line. Any spaces between the delimiter and preceding or following data items are ignored. In the case when white space is used as the delimiter, multiple spaces between data items are treated as a single space.
If tabulation ('TAB'), end-of-line ('EOL') or semicolon (';') is used as the data delimiter then only two setup file keywords are required for MKSPK in order to parse input data -- DATA_ORDER and DATA_DELIMITER.
If comma (',') or white space (' '), which are also allowed in SPICE time strings, is used as the data delimiter and the input data records contain only one time parameter (EPOCH), then the number of lines in each input data record must be specified using the setup file keyword LINES_PER_RECORD. The DATA_ORDER and DATA_DELIMITER keywords must also be used.
If comma (',') or white space (' ') is used as the data delimiter and the input data records contain two times (EPOCH and EPOCHP), then both input times must have the same width, from the first though the last non-blank character, and this width must be specified in the setup file keyword EPOCH_STR_LENGTH. The DATA_ORDER and DATA_DELIMITER keywords must also be used.
The MKSPK program gains considerable flexibility by accepting several
forms of ephemeris information and epochs. Further flexibility is
achieved by allowing the user to tell MKSPK how those input data are
organized, and, by allowing the user to clearly identify the time
system and format used for time tags (epochs).
Listed below are the names of all the input data known to MKSPK--you would use just a subset of these in any one MKSPK session. How you use these parameter names to tell MKSPK what kind of input data are to be processed is described below. Note that one parameter name, "SKIP", is used to indicate that some item(s) in your input data file are to be ignored by MKSPK.
Four types of input data can be processed by the program:
STATES, ELEMENTS, EQ_ELEMENTS, TL_ELEMENTSIf input type is STATES, you can create an SPK of output types: 5, 8, 9, 12, 13, 15 and 17.
If input type is ELEMENTS, you can create an SPK of output types: 5, 8, 9, 12, 13, 15 and 17.
If input type is EQ_ELEMENTS, you can create only an SPK of output type 17.
If input type is TL_ELEMENTS, you can create only an SPK of output type 10.
An input file of the STATES type must contain records consisting of
EPOCH and a full set of state vector parameters X, Y, Z, VX, VY, Vz.
If you use the STATES input type to produce an SPK of Type 17, you must also include three equinoctial parameters:
DPER/DT, DMPN/DT, DNOD/DTin addition to the state vector.
An input file of the ELEMENTS type must contain records consisting of
EPOCH, E, INC, PER, NOD and one of A, RPI, T, P, as well as one of
MEAN, EXAN, TRAN, EPOCHP, TAU.
If you use the ELEMENTS input type to produce an SPK of Type 17, you must also include three equinoctial parameters:
DPER/DT, DMPN/DT, DNOD/DTin addition to the state vector.
An input file of the EQ_ELEMENTS type must contain EPOCH and nine
equinoctial elements EQ_A, EQ_H, EQ_K, EQ_ML, EQ_P, EQ_Q, DPER/DT,
DMPN/DT, DNOD/DT.
An input file of the TL_ELEMENTS type has a pre-defined format and is
processed by the program in a special way. Therefore, the program does
not need specification of the record data order and ignores all setup
file keywords describing input data format.
An SPK of Type 5 requires one or more input records of time ordered
STATES or ELEMENTS. If the input file contains only one record, the
program can formally create an SPK of Type 5 but this file will not be
useful for real applications.
An SPK of Types 8, 9 requires input records of time ordered STATES or ELEMENTS. The degree of Lagrange polynomial specified by the keyword POLYNOM_DEGREE must be less than the number of the data records.
An SPK of Type 10 requires one or more input records of time ordered TL_ELEMENTS for the spacecraft with the NORAD ID specified in the OBJECT_ID setup file keyword.
An SPK of Types 12, 13 requires input records of time ordered STATES or ELEMENTS. The degree of Hermite polynomial specified by the keyword POLYNOM_DEGREE must be an odd number and less than the number of the data records times 2.
An SPK of Type 15 requires only one input record of STATES or ELEMENTS. If the input file contains more than one record, only the first is used by the program.
An SPK of Type 17 requires only one input record of EQ_ELEMENTS or one input record of STATES or ELEMENTS with DPER/DT, DMNP/DT, DNOD/DT added. If the input file contains more than one record, only the first is used by the program.
To use an input data file you must describe the order of data items in
its data records and the delimiter used to separate these data items.
You do this using appropriate keyword=value assignments in the setup
file:
DATA_ORDER = '<param1> <param2> ... <paramN>' DATA_DELIMITER = '<selection>'In some situations it is necessary to use the keyword EPOCH_STR_LENGTH to define input epoch string length, or the keyword LINES_PER_RECORD to define the number of lines used for each input record. One of these assignments may be needed to allow MKSPK to determine which characters are part of the epoch parameter as opposed to being one of the state or elements parameters.
The input type is STATES. We first consider the case when the
delimiter separating data items is one of those also allowed as a
delimiter in SPICE time strings.
Case 1. ------
It this example the data delimiter is the comma.
You have a time ordered set of states with each record consisting of one line.
epoch1, x1, y1, z1, vx1, vy1, vz1 [,] (record 1) epoch2, x2, y2, z2, vx2, vy2, vz2 [,] (record 2) epoch3, x3, y3, z3, vx3, vy3, vz3 [,] (record 3) epoch4, x4, y4, z4, vx4, vy4, vz4 [,] (record 4) ..................................... .......... ..................................... ..........Note that the data delimiter at the end of each line ( record ) is optional (as indicated by the square brackets) and may be omitted.
Let the format of each epoch string be:
1998 DEC 12 10:23:20You can define this input data using the following specifications in the setup file:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'epoch x y z vx vy vz' DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 20Alternatively we can use this set of specifications:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'epoch x y z vx vy vz ' DATA_DELIMITER = ',' LINES_PER_RECORD = 1This alternative method is possible because MKSPK is told that there are seven data items per line, of which the last six are the state. Therefore all other character strings are part of the epoch.
Case 2. ------
The epoch can occur in any position on the input line. For example, the input line could contain:
x, y, z, epoch, vx, vy, vz [,]Relative to case 1 you need to change only the order of parameters in DATA_ORDER:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'x y z epoch vx vy vz' DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 20or
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'x y z epoch vx vy vz' DATA_DELIMITER = ',' LINES_PER_RECORD = 1Case 3. ------
The input data use a blank (white space) as the delimiter. For example, the input line could contain:
x y z epoch vx vy vzYou need to change only the value of DATA_DELIMITER:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'x y z epoch vx vy vz' DATA_DELIMITER = ' ' EPOCH_STR_LENGTH = 20or
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'x y z epoch vx vy vz' DATA_DELIMITER = ' ' LINES_PER_RECORD = 1If the delimiter used to separate input data items is one that is not allowed as a delimiter in SPICE time strings (white space or comma), then the specifications needed in the setup file are fewer -- neither EPOCH_STR_LENGTH nor LINE_PER_RECORD is needed.
Case 4. ------
The input data use one of 'TAB', 'EOL' or ';' as delimiter. For example, if an input line contains:
x; y; z; epoch; vx; vy; vz [;]You should change the value of DATA_DELIMITER and omit the keyword EPOCH_STR_LENGTH or LINES_PER_RECORD:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'x y z epoch vx vy vz' DATA_DELIMITER = ';'
This is a more general example of input data.
The input type is STATES and the delimiter is ',' which is also allowed in SPICE time strings.
You have a time ordered set of states with epochs, and each input record consists of a few lines. There are some unused parameters ('not_used') between input data values and there are blank lines between significant lines. Each input record consists of 2 significant lines with none to several intervening blank lines:
epoch1, not_used, not_used [,] blank line x1, y1, z1, vx1, vy1, vz1 [,] (record 1) epoch2, not_used, not_used [,] x2, y2, z2, vx2, vy2, vz2 [,] (record 2) epoch3, not_used, not_used [,] x3, y3, z3, vx3, vy3, vz3 [,] (record 3) epoch4, not_used, not_used [,] blank line blank line x4, y4, z4, vx4, vy4, vz4 [,] (record 4) .............................. .......... .............................. ..........The delimiter at the end of each line (record) is optional (as indicated by the square brackets) and may be omitted.
Let the format of each epoch string look like this:
1998 DEC 12 10:23:20.617You can define this input data using the following specification in the setup file:
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'epoch skip skip x y z vx vy vz' DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 24or
INPUT_DATA_TYPE = 'STATES' DATA_ORDER = 'epoch skip skip x y z vx vy vz' DATA_DELIMITER = ',' LINES_PER_RECORD = 2Note that the LINES_PER_RECORD assignment specifies the number of ``significant'' data lines per record -- it does not need to account for any number of intervening blank lines.
All modifications like the cases of Example 1 are possible.
Case 1: -------
The input type is ELEMENTS. We consider the case when the data delimiter is one of those also allowed in SPICE time strings -- white space (' ') or comma (',').
For example assume the delimiter is the comma character.
You have a time ordered set of conic elements with epochs and each input record consists of a few lines. There are some unused parameters ('not_used') between input data values and occasionally some blank lines between significant lines. Each input record consists of 2 significant lines:
epoch1, not_used, not_used [,] blank line e1,a1,inc1, per1, nod1, mean1 [,] (record 1) epoch2, not_used, not_used [,] e2,a2,inc2, per2, nod2, mean2 [,] (record 2) epoch3, not_used, not_used [,] e3,a3,inc3, per3, nod3, mean [,] (record 3) epoch4, not_used, not_used [,] blank line blank line e4,a4,inc4, per4, nod4, mean4 [,] (record 4) .............................. .......... .............................. ..........The delimiter at the end of each line (record) is optional (as indicated by the square brackets) and may be omitted.
Let the format of each epoch string look like this:
1998 DEC 12 10:23:20.3You can define this input data using the following specification in the setup file:
INPUT_DATA_TYPE = 'ELEMENTS' DATA_ORDER = 'epoch skip skip e a inc per nod mean' DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 22or
INPUT_DATA_TYPE = 'ELEMENTS' DATA_ORDER = 'epoch skip skip e a inc per nod mean' DATA_DELIMITER = ',' LINES_PER_RECORD = 2You could use, by the same rules, other elements included in the list of parameters for input type ELEMENTS, except the case when the existing epoch of periapsis is also included in the input data.
Case 2: -------
In this example you need epoch of periapsis as an additional input data item and the data delimiter is one of those also allowed in SPICE time strings -- white space (' ') or comma (','):
epoch1, not_used, not_used [,] blank line e1,a1,inc1, per1, nod1, epochp1 [,] (record 1) epoch2, not_used, not_used [,] e2,a2,inc2, per2, nod2, epochp2 [,] (record 2) epoch3, not_used, not_used [,] e1,a1,inc1, per1, nod1, epochp3 [,] (record 3) epoch4, not_used, not_used [,] blank line blank line e1,a1,inc1, per1, nod1, epochp4 [,] (record 4) .............................. .......... .............................. ..........The value of epochp must use the same format as for the epoch string:
1998 DEC 12 09:12:34.9and the length of the time string (must be the same for epoch and epochp) must be defined using the keyword EPOCH_STR_LENGTH:
INPUT_DATA_TYPE = 'ELEMENTS' DATA_ORDER = 'epoch skip skip e a per nod epochp' DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 22All other modifications like the cases of Example 1 are possible.
Input type is EQ_ELEMENTS. We consider the case when the delimiter is
one of those also allowed in SPICE time strings -- white space (' ')
or comma (',').
For example assume the delimiter is the comma character.
Each data record consists of two lines. There are some not used parameters ('not_used') between some of the input data values of nine equinoctial elements.
epoch1, eq(1), eq(2), eq(3), eq(4), eq(5), eq(6) [,] not_used, not_used, eq(7), eq(8), eq(9), no_used [,]The delimiter at the end of each line (record) is optional (as indicated by the square brackets) and may be omitted.
Let the format of each epoch string look like this:
1998 DEC 12 10:23You can define this input data using the following specification in the setup file:
INPUT_DATA_TYPE = 'EQ_ELEMENTS' DATA_ORDER = 'epoch eq_a eq_h eq_k eq_ml eq_p eq_q skip skip dper/dt dmnp/dt dnod/dt skip' (*) DATA_DELIMITER = ',' EPOCH_STR_LENGTH = 17or
INPUT_DATA_TYPE = 'EQ_ELEMENTS' DATA_ORDER = 'epoch eq_a eq_h eq_k eq_ml eq_p eq_q skip skip dper/dt dmnp/dt dnod/dt skip' (*) DATA_DELIMITER = ',' LINES_PER_RECORD = 2(*) In a real setup file the assignment for the DATA_ORDER keywords must be on a single line. It was split to be on two lines only to fit onto the page in this document.
The TIME_WRAPPER keyword allows you to modify occurrences of time
strings (either "epoch" or "epochp") in an input data file, either to
add a time system identifier known to SPICE or some missing but fixed
additional characters. The modifier alphanumeric characters are
prefixed and/or suffixed around the given time string; enter the
additional alphanumeric characters needed as the value for this
keyword while using the
"#"character to indicate where the given time string data are to be placed relative to the characters being added.
As an example of providing a time string identifier, suppose the input data has epoch values that look like this:
2554617.231This string will be interpreted as a standard Julian Date (UTC) unless a modifier known to the SPICE system is added. If you wish to indicate that these values are in ephemeris time (now called Barycentric Dynamical Time, abbreviated as TDB) you would use the following assignment:
TIME_WRAPPER = '# JD TDB'As another example suppose the time strings are given in calendar format Pacific Standard Time and look like this:
1999 MAR 10 14:31:22.376You must then use the TIME_WRAPPER assignment as follows:
TIME_WRAPPER = '# PST'to add ``PST'' to each time string so that SPICE time parsing software inside MKSPK will properly interpret these time tags.
You can also use this assignment to add missing information. Suppose your data look like this:
MAR 10 14:31:22.376You should use the following TIME_WRAPPER assignment:
TIME_WRAPPER = '1999 # UTC'This will prefix your data with '1999 ' and suffix your data with ' UTC' so the input to the time parsing software inside MKSPK will look like:
1999 MAR 03 10:14:22.376 UTC
Examples in this section illustrate which ``keywords=value''
assignments must be specified in a MKSPK setup file for particular
combinations of the input data type and format and output SPK type.
Although most of the examples create an SPK file containing trajectory
of the Jovian satellite AMALTHEA with respect to Jupiter, which is a
not very likely application for this program, the guidelines for
creating setup files demonstrated by these examples apply to the
situation when an SPK file for a spacecraft needs to be made.
If you cut and paste one of these examples to help construct your own setup file be sure to change all values that need to be updated for your particular situation.
The Type 05 SPK represents a continuous ephemeris using a discrete set
of unevenly spaced states and a two body propagation method.
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter) is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM can be specified using the CENTER_GM keyword. The GM value will be stored in the output SPK file together with the states. The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 5 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_STATES_05' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The Type 08 SPK represents a continuous ephemeris using a discrete set
of evenly spaced states and a Lagrange interpolation method.
The POLYNOM_DEGREE keyword is used to specify the polynomial degree that will be used to interpolate over discreet states stored in the output SPK file; this parameter is required for SPK Type 8. The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
To ensure the continuity of the interpolating polynomials over the time span covered by an SPK Type 08 segment the degree of the polynomial should be odd.
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 8 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 9 SEGMENT_ID = 'SPK_STATES_08' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The Type 09 SPK represents a continuous ephemeris using a discrete set
of unevenly spaced states and a Lagrange interpolation method.
The POLYNOM_DEGREE keyword is used to specify the polynomial degree that will be used to interpolate over discreet states stored in the output SPK file; this parameter is required for SPK Type 9. The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
To ensure the continuity of the interpolating polynomials over the time span covered by an SPK Type 09 segment the degree of the polynomial should be odd.
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 9 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 9 SEGMENT_ID = 'SPK_STATES_09' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The Type 12 SPK represents a continuous ephemeris using a discrete set
of evenly spaced states and a sliding window Hermite interpolation
method.
The POLYNOM_DEGREE keyword is used to specify the polynomial degree that will be used to interpolate over discreet states stored in the output SPK file; this parameter is required for SPK Type 12 and its value must be an odd number. The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
To ensure the continuity of the interpolating polynomials over the time span covered by an SPK Type 12 segment the degree of the polynomial should be equivalent to 3 mod 4 (3, 7, 11, etc.)
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 12 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'B.V.Semenov, NAIF/JPL' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 7 SEGMENT_ID = 'SPK_STATES_12' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The Type 13 SPK represents a continuous ephemeris using a discrete set
of unevenly spaced states and a sliding window Hermite interpolation
method.
The POLYNOM_DEGREE keyword is used to specify the polynomial degree that will be used to interpolate over discreet states stored in the output SPK file; this parameter is required for SPK Type 13 and its value must be an odd number. The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
To ensure the continuity of the interpolating polynomials over the time span covered by an SPK Type 13 segment the degree of the polynomial should be equivalent to 3 mod 4 (3, 7, 11, etc.)
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 13 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'B.V.Semenov, NAIF/JPL' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 7 SEGMENT_ID = 'SPK_STATES_13' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The Type 15 SPK represents a continuous ephemeris using a compact
analytic model. The object is modeled as orbiting a central body under
the influence of a central mass plus first order secular effects of
the J2 term in harmonic expansion of the the central body
gravitational potential.
The PCK file 'gravity.tpc' containing GM and J2 of the central body (Jupiter) is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM and J2 can be specified using the CENTER_GM and CENTER_J2 keywords. The CENTER_POLE_RA and CENTER_POLE_DEC keywords contain Jupiter's pole RA and DEC with respect to the reference frame specified in the REF_FRAME_NAME keyword -- in this case B1950. If these keywords wouldn't be present in the setup file the program would compute these values from data present in the PCK file 'pck00005.tpc' provided using the keyword PCK_FILE. The START_TIME and STOP_TIME keywords specifying the file coverage interval, and the PRECESSION_TYPE keyword specifying the type of precession due to J2 are required for the output SPK Type 15. Also The IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies two lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 15 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH X Y Z VX VY VZ' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1979 MAR 05' STOP_TIME = '1979 MAR 06' DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc' ) PRECESSION_TYPE = 'NO PRECESSION' CENTER_POLE_RA = 268.001 CENTER_POLE_DEC = 64.504 SEGMENT_ID = 'SPK_STATES_15' \begintextThough the input file in this example contains multiple records, only the first of them will used to create the output SPK file.
Input data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V ------- 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 1979 MAR 05 00:02:00 -178337.419 -30878.143 -18771.071 5.186043 -23.421245 -10.996084 1979 MAR 05 00:04:00 -177688.033 -33683.859 -20087.682 5.636786 -23.339517 -10.946873 ...
The SPK data Type 17 represents a continuous ephemeris using a compact
analytic model. The object is following an elliptic orbit with
precessing line of nodes and argument of periapse relative to the
equatorial frame of some central body. The orbit is modeled via
equinoctial elements.
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter) is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM can be specified using the CENTER_GM keyword. The GM value is required to convert states from the input file to a set of equinoctial elements stored in the output SPK file. The CENTER_POLE_RA and CENTER_POLE_DEC keywords contain Jupiter's pole RA and DEC with respect to the reference frame specified in the REF_FRAME_NAME keyword -- in this case B1950. If these keywords wouldn't be present in the setup file the program would compute these values from data present in the PCK file 'pck00005.tpc' provided using the PCK_FILE keyword. The START_TIME and STOP_TIME keywords specifying file coverage interval are required for the output SPK Type 17. The IGNORE_FIRST_LINE keyword is used to the header (three lines) of the input file and the LINES_PER_RECORD keyword is used to specify that each record of the input file occupies three lines, which the program must know because the input data delimiter ' ' is one that can be used in a SPICE time string.
Setup file (In this example the value of DATA_ORDER is line-wrapped due to document formatting restrictions; it must be contained on a single line in an actual MKSPK setup file):
\begindata INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 17 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH X Y Z VX VY VZ DPER/DT DMPN/DT DNOD/DT' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1979 MAR 05' STOP_TIME = '1979 MAR 06' DATA_DELIMITER = ' ' LINES_PER_RECORD = 3 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc') CENTER_POLE_RA = 268.001 CENTER_POLE_DEC = 64.504 SEGMENT_ID = 'SPK_STATES_17' \begintextSince only one state is needed to create an output SPK file of type 17, the input file in this example contains a just one record.
Input data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, R,V, EQ_EL(7), EQ_EL(8), EQ_EL(9) ------------------------------------ 1979 MAR 05 00:00:00 -178932.619 -28063.045 -17448.755 4.733702 -23.495860 -11.041956 2.912548790268837E-05 8.363793086428307E-03 -2.898889191844143E-05
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM is needed to
convert elements to states and it is also contained in the output SPK
file. The IGNORE_FIRST_LINE keyword is used to skip the header (three
lines) of the of the input file and the LINES_PER_RECORD keyword is
used to specify that each record of the input file occupies two lines,
which the program must know because the input data delimiter ' ' is
one that can be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 5 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_ELEMENTS_05' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM is needed to
convert elements to states. The POLYNOM_DEGREE keyword is used to
specify the polynomial degree that will be used to interpolate over
discreet states stored in the output SPK file; this parameter is
required for SPK Type 8. The IGNORE_FIRST_LINE keyword is used to skip
the header (three lines) of the input file and the LINES_PER_RECORD
keyword is used to specify that each record of the input file occupies
three lines, which the program must know because the input data
delimiter ' ' is one that can be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 8 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 8 PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_ELEMENTS_08' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM is needed to
convert elements to states. The POLYNOM_DEGREE keyword is used to
specify the polynomial degree that will be used to interpolate over
discreet states stored in the output SPK file; this parameter is
required for SPK Type 9. The IGNORE_FIRST_LINE keyword is used to skip
the header (three lines) of the input file and the LINES_PER_RECORD
keyword is used to specify that each record of the input file occupies
three lines, which the program must know because the input data
delimiter ' ' is one that can be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 9 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 8 PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_ELEMENTS_09' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM is needed to
convert elements to states. The POLYNOM_DEGREE keyword is used to
specify the polynomial degree that will be used to interpolate over
discreet states stored in the output SPK file; this parameter is
required for SPK Type 12 and its value must be an odd number. The
IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of
the input file and the LINES_PER_RECORD keyword is used to specify
that each record of the input file occupies three lines, which the
program must know because the input data delimiter ' ' is one that can
be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 12 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'B.V.Semenov, NAIF/JPL' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 7 PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_ELEMENTS_12' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM is needed to
convert elements to states. The POLYNOM_DEGREE keyword is used to
specify the polynomial degree that will be used to interpolate over
discreet states stored in the output SPK file; this parameter is
required for SPK Type 13 and its value must be an odd number. The
IGNORE_FIRST_LINE keyword is used to skip the header (three lines) of
the input file and the LINES_PER_RECORD keyword is used to specify
that each record of the input file occupies three lines, which the
program must know because the input data delimiter ' ' is one that can
be used in a SPICE time string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 13 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' POLYNOM_DEGREE = 7 PCK_FILE = 'gravity.tpc' SEGMENT_ID = 'SPK_ELEMENTS_13' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM and J2 of the central body
(Jupiter) is specified using the PCK_FILE keyword. Alternatively,
Jupiter's GM and J2 can be specified using the CENTER_GM and CENTER_J2
keywords. The CENTER_POLE_RA and CENTER_POLE_DEC keywords contain
Jupiter's pole RA and DEC with respect to the reference frame
specified in the REF_FRAME_NAME keyword -- in this case B1950. If
these keywords wouldn't be present in the setup file, the program
would compute these value from data present in the PCK file
'pck00005.tpc' provided using the keyword PCK_FILE. The START_TIME and
STOP_TIME keywords specifying the file coverage interval and the
PRECESSION_TYPE keyword specifying the type of precession due to J2
are required for the output SPK Type 15. The IGNORE_FIRST_LINE keyword
is used to skip the header (three lines) of the input file and the
LINES_PER_RECORD keyword is used to specify that each record of the
input file occupies two lines, which the program must know because the
input data delimiter ' ' is one that can be used in a SPICE time
string.
Setup file:
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 15 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1979 MAR 05' STOP_TIME = '1979 MAR 06' DATA_DELIMITER = ' ' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc' ) PRECESSION_TYPE = 'NO PRECESSION' CENTER_POLE_RA = 268.001 CENTER_POLE_DEC = 64.504 SEGMENT_ID = 'SPK_ELEMENTS_15' \begintextThough the input file in this example contains multiple records, only the first of them will used to create the output SPK file.
Input data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0 ------------------------------------- 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 1979 MAR 05 00:02:00 181814.040 0.001008 25.415 357.216 115.117 78.678 -657287829.8 1979 MAR 05 00:04:00 181824.846 0.000949 25.415 357.216 115.809 78.990 -657287709.8 ...
The PCK file 'gravity.tpc' containing GM of the central body (Jupiter)
is specified using the PCK_FILE keyword. Alternatively, Jupiter's GM
can be specified using the CENTER_GM keyword. The GM value is required
to convert elements from the input file to a set of equinoctial
elements stored in the output SPK file. The CENTER_POLE_RA and
CENTER_POLE_DEC keywords contain Jupiter's pole RA and DEC with
respect to the reference frame specified in the REF_FRAME_NAME keyword
-- in this case B1950. If these keywords wouldn't be present in the
setup file, the program would compute these values from data present
in the PCK file 'pck00005.tpc' provided using the keyword PCK_FILE.
The START_TIME and STOP_TIME keywords specifying the file coverage
interval are required for the output SPK Type 17. The
IGNORE_FIRST_LINE keyword is used to the header of the input file and
the LINES_PER_RECORD keyword is used to specify that each record of
the input file occupies three lines, which the program must know
because the input data delimiter ' ' is one that can be used in a
SPICE time string.
Setup file (In this example the value for DATA_ORDER is wrapped due to document formatting; it must be on a single line in the actual setup file):
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 17 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH RP E INC NOD PER MEAN SKIP DPER/DT DMPN/DT DNOD/DT' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1979 MAR 05' STOP_TIME = '1979 MAR 06' DATA_DELIMITER = ' ' LINES_PER_RECORD = 3 IGNORE_FIRST_LINE = 3 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc' ) CENTER_POLE_RA = 268.001 CENTER_POLE_DEC = 64.504 SEGMENT_ID = 'SPK_ELEMENTS_17' \begintextInput data file:
Test: 505 relative to 599 in frame B1950. GM= 126686536.75178 JD, RP, ECC, INC, LNODE, ARGP, M0, T0, EQ_EL(7), EQ_EL(8), EQ_EL(9) ------------------------------------------------------------------ 1979 MAR 05 00:00:00 181803.245 0.001067 25.415 357.216 114.445 78.346 -657287949.8 2.912548790268837E-05 8.363793086428307E-03 -2.898889191844143E-05
The CENTER_POLE_RA and CENTER_POLE_DEC keywords contain Jupiter's pole
RA and DEC with respect to the reference frame specified in the
REF_FRAME_NAME keyword -- in this case B1950. If these keywords
wouldn't be present in the setup file, the program would compute these
values from data present in the PCK file 'pck00005.tpc' that will have
to be provided using the keyword PCK_FILE. The START_TIME and
STOP_TIME keywords specifying the file coverage interval are required
for the output SPK Type 17. The IGNORE_FIRST_LINE keyword is used to
skip the header (six lines) of the input file and the LINES_PER_RECORD
keyword is used to specify that each record of the input file occupies
ten lines, which the program must know because the input data
delimiter ' ' is one that can be used in a SPICE time string.
Setup file (In this example the value of DATA_ORDER is wrapped due to document formatting; it must be on a single line in actual setup file):
\begindata INPUT_DATA_TYPE = 'EQ_ELEMENTS' OUTPUT_SPK_TYPE = 17 OBJECT_ID = 505 OBJECT_NAME = 'AMALTHEA' CENTER_ID = 599 CENTER_NAME = 'JUPITER' REF_FRAME_NAME = 'B1950' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'EPOCH EQ_A EQ_H EQ_K EQ_ML EQ_P EQ_Q DPER/DT DMPN/DT DNOD/DT' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1979 MAR 05' STOP_TIME = '1979 MAR 06' DATA_DELIMITER = ',' IGNORE_FIRST_LINE = 6 LINES_PER_RECORD = 10 LEAPSECONDS_FILE = 'naif0007.tls' TIME_WRAPPER = '# JD' CENTER_POLE_RA = 268.001 CENTER_POLE_DEC = 64.504 SEGMENT_ID = 'SPK_EQ_ELEMENTS_17' \begintextInput data file:
LABEL = 'Astrometric and Voyager data solution - JUP101', RCKEQX = 2.433282500000000E+06, RCKNAM(01) = 'AMALTH', RCKNUM(01) = 505, RCKCTR(01) = 'JUPITE', RCKTYP(01) = 'EQUIN ', 2443937.5, 1.813655610000000E+05, 1.713267736805066E-03, 2.975197760058551E-03, 1.920818611670669E+02, -2.939839894519083E-03, -7.170730998150093E-04, 2.912548790268837E-05, 8.363793086428307E-03, -2.898889191844143E-05,
The OBJECT_ID keyword contains NORAD spacecraft ID for the Mir Space
Station; this ID is used to locate data in the input two-line elements
file. The CENTER_ID and REF_FRAME_NAME contain required values of 399
and 'J2000' correspondingly. The PCK_FILE keyword contains the name of
an Earth geophysical constants PCK file; a copy of such file is
usually provided with the SPICE toolkit under the ``/data'' directory.
Note that no keywords describing input data format are present in the
setup file. These keywords are not needed for 'TL_ELEMENTS'/SPK 10
program runs because two-line elements files have fixed format and are
processed by the program as a special case.
Setup file:
\begindata INPUT_DATA_TYPE = 'TL_ELEMENTS' OUTPUT_SPK_TYPE = 10 OBJECT_ID = 16609 CENTER_ID = 399 REF_FRAME_NAME = 'J2000' LEAPSECONDS_FILE = 'naif0007.tls' INPUT_DATA_FILE = 'mir.tle' OUTPUT_SPK_FILE = 'mir.bsp' PCK_FILE = 'geophysical.ker' SEGMENT_ID = 'SPACE STATION MIR' PRODUCER_ID = 'Boris Semenov, NAIF/JPL' \begintextInput data file (the first two characters on each line of the sample two-line element record -- '1 ' for the line '16609U 86017A 97 ...' and '2 ' for the line '16609 51.6542 51...' -- were taken out to fit the sample record into the page):
Mir 16609U 86017A 97175.09681976 .00000769 00000-0 15893-4 0 3939 16609 51.6542 51.1598 0005239 178.2438 181.8517 15.59510867648105
The next example demonstrates how ``SKIP'' can be used in the
definition of the input record contents specified using the DATA_ORDER
keyword. In this example ``SKIP'' is used to ignore zero-length tokens
present in the input data records. The IGNORE_FIRST_LINE keyword is
used to skip one line of the header information.
Setup file:
\begindata INPUT_DATA_FILE = 'good_inputs/states:commas' OUTPUT_SPK_FILE = 'good_outputs/states_commas.bsp' INPUT_DATA_TYPE = 'STATES' OUTPUT_SPK_TYPE = 5 OBJECT_ID = -557 OBJECT_NAME = 'GRANAT' CENTER_ID = 399 CENTER_NAME = 'EARTH' REF_FRAME_NAME = 'J2000' PRODUCER_ID = 'B.V. Semenov' DATA_ORDER = 'X Y Z VX VY VZ SKIP SKIP EPOCH SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') DATA_DELIMITER = ',' LINES_PER_RECORD = 2 IGNORE_FIRST_LINE = 1 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc') SEGMENT_ID = 'TEST' \begintextInput data file:
X,Y,Z,VX,VY,VZ,,,Epoch,, -79376.312,94802.228,152149.381,-.537457,.057167,.299857, ,,1990-01-01 00:00:00.000,, -111902.474,71404.027,136526.217,.031594,-.434385,-.559425, ,,1990-01-02 09:02:02.774,, -70048.213,14411.561,47294.006,1.324262,-.933652,-1.728348, ,,1990-01-03 09:23:15.101,, ...
The next example demonstrates use of the EPOCH_STR_LENGTH keyword in
cases where two epoch strings -- epoch, and epoch of periapsis --
provided in input records have to be used to compute data for the
output SPK file. The IGNORE_FIRST_LINE keyword is used to skip one
line of the header information.
Setup file (in this example the value of DATA_ORDER is wrapped due to document formatting; it must be on a single line in the actual setup file):
\begindata INPUT_DATA_TYPE = 'ELEMENTS' OUTPUT_SPK_TYPE = 5 OBJECT_ID = -557 OBJECT_NAME = 'GRANAT' CENTER_ID = 399 CENTER_NAME = 'EARTH' REF_FRAME_NAME = 'J2000' PRODUCER_ID = 'N.G.Khavenson, IKI RAS, Russia' DATA_ORDER = 'SKIP EPOCH E RP INC NOD PER EPOCHP SKIP SKIP SKIP SKIP SKIP SKIP' INPUT_DATA_UNITS = ('ANGLES=DEGREES' 'DISTANCES=km') START_TIME = '1998 JAN 01' STOP_TIME = '1999 JAN 01' DATA_DELIMITER = ',' TIME_WRAPPER = '# TDB' EPOCH_STR_LENGTH = 30 IGNORE_FIRST_LINE = 1 LEAPSECONDS_FILE = 'naif0007.tls' PCK_FILE = ('pck00005.tpc' 'gravity.tpc') SEGMENT_ID = 'TEST' \begintextInput data file:
JDTDB, T, e, q, i, LAN, APF, ToP, n, MA, TA, a, AD, PER 2450819.000000000, A.D. 1998-Jan-05 12:00:00.0000, 0.9998547684834859E+00, 0.3450736825384300E+08, 0.1249344272957001E+03, 0.1880167631634887E+03, 0.1301649235108716E+03,A.D. 1998-JUL-05 12:00:00.0000, 0.1802195911346396E-09, 0.9563896596356295E-02, 0.1601180118692756E+03, 0.2376024783190921E+12, 0.4751704492699304E+12, 0.1997563071436828E+13,