Accessing Data in an Ephemeris

Top  Previous  Next

Once an Ephemeris object has been configured appropriately and contains data, that data can be accessed in a variety of ways.

 

 

General Ephemeris Data


This section deals with retrieving data from an Ephemeris object for all ephemeris formats, including version 1 of the FreeFlyer ephemeris format. Versions 2 and higher of the FreeFlyer ephemeris format have special interfaces that can be used and extra data that can be retrieved, all discussed later in this guide.

 

Vector Information

Vector-specific information can be retrieved from an Ephemeris object, including the current vector index and the values contained in that vector, as shown in the syntax examples below:

 

 

Ephemeris Information

Header information can also be queried from an Ephemeris object. This includes the number of states in the ephemeris, the time span of the ephemeris, the next and previous epochs in the ephemeris around the Ephemeris.CurrentIndex. Syntax examples are provided below:

 

 

 

FreeFlyer Ephemeris Format-Specific Data


FreeFlyer provides additional interfaces to allow users to access additional information in FreeFlyer ephemeris formatted files. These extra interfaces include discontinuity information, customized column details (corresponding to the TITLE section of the ephemeris), and vector comments. These interfaces are located in the FFEphemProperties child object of the Ephemeris object. Below is the script necessary to access this child object:

 

 

Discontinuity Data

Discontinuities are modeled in the FreeFlyer ephemeris format with vectors that contain a pre- and post-discontinuity state. Discontinuities cannot be interpolated across, and instead must have states on both sides of the discontinuity to model the Spacecraft state. In many cases discontinuities are used to represent changes to a Spacecraft's state due to orbital events like maneuvers. Because each column in the FreeFlyer ephemeris format can be interpolated independent of the others, any subset of columns may marked with a discontinuity at a given epoch. This means that the marked columns cannot be interpolated across the discontinuity, but other columns could still be interpolated across that epoch since they are not discontinuous.

 

See the discontinuities section of the FreeFlyer Ephemeris File documentation for a full discussion of how to mark and use discontinuities in the format. Below are examples of how to access the discontinuity data in a FreeFlyer ephemeris.

 

 

Column Information

FreeFlyer has the ability to add and remove custom columns using the FreeFlyer ephemeris format, and so it becomes important to be able to easily manage those custom columns. The user can access column information including the column labels, unit labels, interpolators, and mapped Spacecraft properties, as shown in the syntax example below.

 

 

Vector Comments

Vector comments in the FreeFlyer ephemeris format are either set by the Put command itself or through the SetVectorComment method, but can also be retrieved from ephemeris files that are loaded in through the following syntax.

 

 

 

EphemerisVector Object


The EphemerisVector object allows for convenient handling of multiple different object types in the FreeFlyer ephemeris format's columns, including String objects, Variable objects, and TimeSpan objects. This is necessary to take advantage of these different column object types in version 3 of the FreeFlyer ephemeris format, but it is also convenient for other ephemeris formats in a limited capacity based on what that format supports.

 

Using an EphemerisVector

The EphemerisVector object can be created directly in FreeFlyer script or accessed from an Ephemeris object when you retrieve a full vector from it at a given index. EphemerisVector objects are, by design, always associated to a specific ephemeris, and can even be handled and then added to the Ephemeris without the need for the Put command. Many of these interfaces are demonstrated in the FreeFlyer script examples below, where an Ephemeris object is loaded into the EphemerisVector and then the new EphemerisVector is set into the Ephemeris object itself using the Ephemeris.SetVectorData method.

 

 

The Ephemeris.AddVectorData method can also be used to set data at the end of an Ephemeris or at a specified epoch in the form of an EphemerisVector, Spacecraft state, or Array.

 

 

The EphemerisVector.InitializeColumns method, as shown above, can also be used repeatedly to associate a new Ephemeris object to the EphemerisVector. In doing this, you can reuse an EphemerisVector throughout a Mission Plan.

 

Getting an EphemerisVector

The other primary use-case for the EphemerisVector object is to get data from the Ephemeris and report and handle it with ease. The following script example showcases doing just that.

 

 

Note: If the EphemerisVector object's column details do not match the column details of the Ephemeris to which it is being added, FreeFlyer will throw a runtime error.

 

 

See Also


Ephemeris Properties and Methods

EphemerisVector Properties and Methods

The Put Command