Creating an Ephemeris File

Top  Previous  Next

The Ephemeris object is used to generate new Ephemeris files from FreeFlyer. There is built-in support for writing FreeFlyer, STK, CCSDS OEM, SPICE, and some NASA file formats. These files can contain various combinations of:

 

Position, velocity, acceleration

Attitude, angular velocity, angular acceleration

Some formats support:

oClock bias and drift

oCovariance

oCustom user-defined columns

oCustom column delimiters

 

 

Collect Spacecraft State Data


FreeFlyer can collect Spacecraft state data into an Ephemeris object using the Put command or by declaring the Ephemeris object as a global ephemeris. In both cases, once all the desired data for the ephemeris file is collected, the Put command applied to the Ephemeris object takes the data and converts it to a single ephemeris file, as described in the "Generate an External Ephemeris File" section below.

 

Configuring the Ephemeris Data

The ephemeris central body and columns to include can be configured through the Ephemeris object editor (as shown in the image below), or using the properties of the Ephemeris object shown in the syntax example below. This example shows how to include all the available built-in columns.

 

Ephemeris Ephemeris1;

 

// Set the ephemeris central body

Ephemeris1.CentralBody = "Earth";

 

// Configure the columns to include

Ephemeris1.WritePosVel = 1;

Ephemeris1.WriteAcceleration = 1;

Ephemeris1.WriteAttitude = 1;

Ephemeris1.WriteAngularVelocity = 1;

Ephemeris1.WriteAngularAcceleration = 1;

Ephemeris1.WritePositionVelocityCovariance = 1;

Ephemeris1.WriteClockBiasAndDrift = 1;

 

Note that not all available columns are supported by all ephemeris file formats.

 

The Put Command

The Put command provides a mechanism to collect Spacecraft state data into an Ephemeris object. Whenever you want to add the Spacecraft's current state into the Ephemeris object, use the Put command. The Put command is often placed in a While loop, usually following Step and/or Maneuver commands. You can control which portions of your simulation are added to the ephemeris file by only calling the Put command when desired, for example, when only the first week of a month-long propagation is required for external product generation.

 

// Put Spacecraft state to ephemeris

Put mySpacecraft to myEphemeris;

 

Spacecraft state data can also be added to an Ephemeris object using the Ephemeris.AddVectorData() or Ephemeris.SetVectorData() methods. See the Accessing Data in an Ephemeris page for more information.

 

Note: For Mission Plans still using millisecond precision mode, Ephemeris objects can be declared "as Global", as described below. As of FreeFlyer 7.3, the default timing precision mode is nanosecond precision mode which provides more modern and robust interfaces for this functionality.

When an Ephemeris object is declared "as Global", it is linked to a Spacecraft object, and every time the corresponding Spacecraft changes its state through a Step or Maneuver command, that state is automatically added to the Ephemeris object. Because of the link between the Spacecraft and Ephemeris objects, the Put command is no longer needed after each Step or Maneuver.

The "as Global" option is scoped to the control statement it was called in. So, when the "as Global" option is used inside of an If block, While loop, or For loop, all steps inside of the control statement will automatically be added; any steps taken outside of the control statement will not be added.

 

 

Generate an External Ephemeris File


Once all of the Spacecraft states have been collected into the Ephemeris object, the Put command can be used to transmit data from a FreeFlyer Object to an external file. This is usually at the end of the Mission Sequence. For more information on creating external files, see the Interfacing with External Resources Guide.

 

// Put Ephemeris to FreeFlyer, CCSDS OEM, STK, or SPICE formatted ephemeris file

Put myEphemeris to FFephem "SCephem.FFephem";

Put myEphemeris to CCSDSOEM "SCephem.txt";

Put myEphemeris to STKephem "SCephem.e";

Put myEphemeris to SPKephem "SCephem.bsp";

 

External ephemeris files can also be generated using the Ephemeris.GenerateEphemeris() method.

 

// Generate Ephemeris file in FreeFlyer, CCSDS OEM, STK, or SPICE formats

Ephemeris1.GenerateEphemeris(0,"testEphemerisFF.FFephem");
Ephemeris1.GenerateEphemeris(2,"testEphemerisSTK.e");
Ephemeris1.GenerateEphemeris(3,"testEphemerisCCSDS.txt");

Ephemeris1.GenerateEphemeris(1,"testEphemerisSPK.bsp");

 

Several formats are available for the creation of external ephemeris files, including FreeFlyer ephemerides (*.FFephem), STK ephemerides (*.e), SPICE ephemerides (*.bsp), and Goddard Space Flight Center Code 500 ephemerides (requires NASA pack). See the Ephemeris Formats table on the Ephemerides and AHF page for more information.

 

Note: If data exists in an Ephemeris object but is not supported by the format to which it is being written, that data will be ignored. Similarly, if required data for the selected format is missing from the Ephemeris object, it will be taken from the Spacecraft object associated with the Ephemeris object to fill in the gaps.

 

 

Ephemeris Object Editor


The Ephemeris Object editor is used to configure the type of Ephemeris the user would like to work with.

 

Note: Only the FreeFlyer ephemeris format version 1 is supported in the Ephemeris object editor; all subsequent FreeFlyer ephemeris versions must be configured using FreeFlyer script instead of the object editor.

 

The Ephemeris Object editor allows the user to:

 

Select the central body the Ephemeris data is referenced to.

Set the type to be Ephemeris, Attitude History File, or Custom File.

oChoose the information to be included in the Ephemeris file.

Specify what FreeFlyer Ephemeris Format Version to use (1, 2, or 3).

oFor more information on the features of Version 2 and Version 3 of the FreeFlyer Ephemeris Format, please see the FreeFlyer Ephemeris File page of the Help File.

In millisecond precision mode only: Designate the Ephemeris as Global and set the associated Spacecraft. When Global is selected, the state of the associated Spacecraft is added to the Ephemeris Object each time the Spacecraft is stepped. If the Global option is not selected, the Spacecraft state must be added to the Ephemeris Object manually using the Put command.

 

The information included in the Ephemeris is dependent on the type of ephemeris selected. For example, when the Type is "Ephemeris", only Position and Velocity will be be included. A Custom File allows the user to choose any combination of information to include in the Ephemeris file.

 

Note: Writing the position and velocity covariance using the checkbox shown below is only supported for the CCSDS OEM ephemeris file format. Additionally, the FreeFlyer Ephemeris v2.0 file format allows the user to specify any custom columns.

 

Ephemeris Object Editor

Ephemeris Object Editor

 

FreeFlyer can use the data contained in ephemeris files to seed an initial Spacecraft state, and then use an integrator and Force Model to "step" the Spacecraft forward in time, or FreeFlyer can step the Spacecraft sequentially to the states represented by the data points in the ephemeris file, interpolating Spacecraft states in between data points if needed. See the Importing an Ephemeris File page for more information on stepping the Spacecraft using an ephemeris file.

 

 

See Also


Ephemeris Properties and Methods

The Put Command

Importing an Ephemeris File

Ephemerides and Attitude History Files