Code 500 PC Ephemeris File

Top  Previous  Next

The Code 500 Ephemeris file is an Ephemeris file format for use with many NASA applications that requires the NASA pack. This format is used mostly at the Goddard Space Flight Center (GSFC) and can be used for both input and output of Spacecraft orbital data. See the Working with Ephemerides guide for more information about creating and importing a Code 500 Ephemeris file.




The Code 500 Ephemeris is a binary file whose specifications are available from NASA GSFC. This format contains two headers and multiple chronologically ordered data points where the step size is fixed. Additionally, the specific binary formatting of the file can vary and may be written in either PC (little endian) or HP (big endian) formats. As for supported reference frames, the Code 500 format supports both Mean of J2000 and True of Date.


To read or write a Code 500 Ephemeris to file with varying endianness and other properties, consider the following examples. These examples assume that an appropriate Ephemeris has been instantiated in script.


// Put Ephemeris to Code 500 ephemeris file in HP (big endian) format

Put myEphemeris to ephem "SCephem.ephem";

Put myEphemeris to ephem "SCephem.ephem" with StepSize = 300 and CS as J2000;


// Put Ephemeris to Code 500 ephemeris file in PC (little endian) format

Put myEphemeris to PCephem "SCephem.PCEphem";

Put myEphemeris to PCephem "SCephem.PCEphem" with StepSize = 300 and CS as TOD;


// Get Ephemeris as Code 500 ephemeris file in various endianess

Get myEphemeris from ephem "SCephem.ephem";     // HP (big endian)

Get myEphemeris from PCephem "SCephem.PCephem"// PC (little endian)


// This approach will load either big or little endian variants and then tell you which it was

String ephemFormat;

myEphemeris.LoadEphemeris("My//File//Path.ephem", ephemFormat);

Report ephemFormat; // Will report "ephem" for HP (big endian) and "PCephem" for PC (little endian)



See Also

Ephemeris Properties and Methods

The Put Command

Working with Ephemerides

oCreating an Ephemeris File

oImporting an Ephemeris File