Importing an Ephemeris File

Top  Previous  Next

The Ephemeris object is a type of Propagator which can be associated with a Spacecraft object. The Ephemeris object holds all Spacecraft state data gathered from an ephemeris file.

 

This page is divided into the following sections:

Configuring a Spacecraft to use an Ephemeris

Setting the Ephemeris File

Setting the Step Mode

Setting the Step Size

Interpolation Methods

 

FreeFlyer can perform calculations on a previously computed trajectory without re-propagation of the orbit, thereby providing a significant improvement in performance. To do this, an ephemeris file is imported into Ephemeris object. The Ephemeris object is the associated with a Spacecraft, and provides the link between the Spacecraft and the ephemeris file containing the orbital data. During the simulation as the spacecraft is stepped, the Ephemeris object provides the next state from the ephemeris file or interpolates between the ephemeris states, if necessary. Ephemeris files can be imported by specifying the file in the Spacecraft Object Editor or using the LoadEphemeris method in FreeFlyer script. The type of ephemeris file is automatically recognized by FreeFlyer when the data is retrieved.

 

 

Configuring a Spacecraft to use an Ephemeris


To configure a Spacecraft to use an Ephemeris, double-click the Spacecraft in the Object Browser, and then select the Propagator page from the menu on the left, as shown in the image below.

 

Once the Propagator page has been selected, ensure that the Spacecraft is propagated using an Ephemeris using the "Motion Source" radio buttons.

 

Setting up the Spacecraft Propagator to use Ephemeris.

Setting up the Spacecraft Propagator to use Ephemeris.

 

The Ephemeris object is accessible directly from the Object Browser by clicking the "+" next to the Spacecraft object. Double-clicking on this object allows direct access to the Propagator page of the Spacecraft Object Editor, instead of going to the first page of the Editor.

 

Accessing the Propagator page of the Spacecraft Object Editor from the Object Browser.

Accessing the Propagator page of the Spacecraft Object Editor from the Object Browser.

 

You can also create an Ephemeris object via FreeFlyer script, or access the properties of an Ephemeris created in the Spacecraft object editor via FreeFlyer script.

 

To create an Ephemeris object via FreeFlyer script, use the syntax shown in the script below:

 

Ephemeris Ephemeris1;

Spacecraft Spacecraft1(Ephemeris1);

 

Where:

Ephemeris1 is a new object of type "Ephemeris"

Ephemeris1 can also be accessed through Spacecraft1.Propagator or (Spacecraft1.Propagator AsType Ephemeris)

 

When a Spacecraft is created without specifying a Propagator or Force Model, the default Propagator and Force Model are used. The default Propagator is the highest fidelity Propagator available with your license level. For example, with the Mission license, the default is the RK89 Propagator. You can change the Spacecraft's Propagator to an Ephemeris using syntax such as:

 

Spacecraft Spacecraft1;

Spacecraft1.SetPropagatorType(TypeOf(Ephemeris));

 

You can access the properties of the Ephemeris using the syntax:

 

(Spacecraft1.Propagator AsType Ephemeris)

 

To learn more about related topics, see the Object Constructors and Type Casting references in the Working with Objects Guide.

 

 

Setting the Ephemeris File


Once "Ephemeris" has been selected via the "Motion Source" radio buttons menu or set via script, you can specify the File Name using the file browser shown in the image below. If the file format matches a format supported by FreeFlyer, the format will be displayed as the "Ephemeris Format". For more information on which formats FreeFlyer will recognize, go to the Ephemerides and AHF page.

 

When using an Ephemeris as a Spacecraft's motion source, the Spacecraft's initial state (epoch, position, velocity, etc.) will be overwritten with the first state in the ephemeris file.

 

Setting up the Ephemeris File on the Propagator page of the Spacecraft Object Editor.

Setting up the Ephemeris File on the Propagator page of the Spacecraft Object Editor.

 

To set the Ephemeris file via FreeFlyer script, use the following syntax:

 

Alias eph = (Spacecraft1.Propagator AsType Ephemeris); // This alias is used to shorten the script examples below

 

eph.LoadEphemeris("SampleEphemeris.ephem");

 

Where "SampleEphemeris.ephem" specifies the relative path and name of the file containing ephemeris data.

 

See the Get command for alternate syntax for loading ephemerides. The Put command can be used to write ephemeris states to several different types of formatted ephemeris files.

 

 

Setting the Step Mode


FreeFlyer can either propagate the Spacecraft to the exact vectors in the ephemeris file, or propagate based off of a specified fixed step size. If "Fixed Step Size" is selected, an input box appears for Step Size specification. FreeFlyer will interpolate the state of the Spacecraft if a fixed step lands outside of an ephemeris state. A "Fixed Step Size" will ensure a fixed data output interval, with the possible side effect of slower execution speeds.

 

To set the Ephemeris Step Mode, use the radio buttons shown in the image above, or set the mode via FreeFlyer script using the Ephemeris.StepSize property. A StepSize of 0.0 seconds will cause the Spacecraft to step exactly to the points in the ephemeris.

 

eph.StepSize = TIMESPAN(0 seconds);

 

FreeFlyer can step backwards in time through ephemerides in the FreeFlyer ephemeris format version 2 or higher.

 

 

Setting the Step Size


When the "Step Mode" discussed above is set to "Fixed", a step size must be set. A positive Step Size will propagate the Spacecraft forward through time, while a negative Step Size will propagate the Spacecraft into the past. If the Step Size takes the Spacecraft to a point between states in the ephemeris, FreeFlyer will interpolate the state of the Spacecraft at that point. See the section on Interpolation Methods for more information.

 

To set the Ephemeris Step Size, use the "Step Size" numeric text entry field, or set the step size via FreeFlyer script using this syntax:

 

eph.StepSize = TIMESPAN(60 seconds);

 

Where 60 is the value of the step size in seconds.

 

Note: As of FreeFlyer 7.3, the default timing precision mode is nanosecond precision mode. For older Mission Plans that have not yet been converted from millisecond precision mode, the syntax for working with times such as step sizes is different. A sample is shown below; see the timing precision mode page for more information.

 

eph.StepSize = 60;

 

 

Interpolation Methods


FreeFlyer will interpolate the state of the Spacecraft if the Step Size takes the Spacecraft to a point between vectors in the ephemeris. The following interpolation modes are available: 5th Order Spline, 8th Order Lagrange, and 10th Order Lagrange. To set the interpolation method, use this syntax:

 

eph.InterpolationMethod = 0; // 5th Order Spline

eph.InterpolationMethod = 1; // 8th Order Lagrange

eph.InterpolationMethod = 2; // 10th Order Lagrange

 

FreeFlyer allows the user to specify different interpolation algorithms for each column of data in the Ephemeris file in recent versions of the FreeFlyer ephemeris format.

 

eph.FFEphemProperties.FormatVersion = 2;          // Version 2 or higher is required for setting ColumnInterpolators

eph.FFEphemProperties.ColumnInterpolators[0] = 1; // Sets the first column to use 8th Order Lagrange

 

FreeFlyer will automatically reduce the interpolation method to handle segments with fewer points than required for the method. For example, if the user selected a 10th order Lagrange interpolator and the segment is 8 points long, FreeFlyer will downgrade to an 8th order Lagrange interpolator.

 

 

See Also


Ephemeris Properties and Methods

The Put Command

Creating an Ephemeris File

Ephemerides and Attitude History Files

Using a SPICE Ephemeris