Generating TLEs Using the SGP4StateEstimator

Top  Previous  Next

The SGP4StateEstimator object allows the user to generate an SGP4 state by using a Batch Least Squares estimator which computes incremental state updates to converge on a solution. In FreeFlyer, the user can specify a propagator type or observation data to be used in the estimation process to compute an SGP4 state. A common approach is to use an ephemeris file. Procedures for generating a TLE using an ephemeris and using observation data are provided below.

 

FreeFlyer can generate TLE data in the type 0, type 2 or type 4 ephemeris formats (see Two-Line Orbital Element Set File for details on the ephemeris types). Types 0 or 2 will use the base SGP4 algorithm, while type 4 will use the SGP4-XP algorithm and generate the AGOM term in place of the second derivative of mean motion. To select the SGP4-XP algorithm, set the EphemerisType property for the Spacecraft being processed to 4, as shown below.

 

scSGP4.SGP4.EphemerisType = 4;

 

 

Using an Ephemeris


Given an ephemeris, it is fairly easy to generate an SGP4 state which can then be exported to a TLE file. The process involves configuring two Spacecraft objects: one to be propagated with the ephemeris and another which will be processed through an estimator to generate the SGP4 state. Below is an example of how the Spacecraft objects can be configured:

 

TimeSpan fitSpan = TIMESPAN(2 days);

 

// Set up a 'definitive' Spacecraft with the ephemeris

Spacecraft scDefinitive;

scDefinitive.SetPropagatorType(TypeOf(Ephemeris));

(scDefinitive.Propagator AsType Ephemeris).LoadEphemeris("myDefinitive.ephem");

 

// Set up a Spacecraft for processing

Spacecraft scSGP4;

scSGP4.SetPropagatorType(TypeOf(SGP4));

 

// Make sure initial states are lined up

scSGP4.Epoch = scDefinitive.Epoch;

scSGP4.Position = scDefinitive.Position;

scSGP4.Velocity = scDefinitive.Velocity;

 

Once the Spacecraft objects are configured, the SGP4StateEstimator can be configured as follows:

 

// Configure SGP4StateEstimator object

SGP4StateEstimator sgp4Estimator;

sgp4Estimator.SetReferenceSpacecraft(scDefinitive);

sgp4Estimator.SetSpacecraftToProcess(scSGP4);

sgp4Estimator.FitSpanDuration = fitSpan;

 

// This call will execute 3 iterations of the Batch OD process to determine an SGP4 state

sgp4Estimator.PerformFit(); 

 

The SGP4StateEstimator object has a child object, the ObservationModel object, which generates observations to be used in the fit of the trajectory. The user can access the ObservationModel child object in order to configure how the observations will be generated. Some of the configuration options are shown in the following example:

 

// Configure SGP4StateEstimator object

SGP4StateEstimator sgp4Estimator;

sgp4Estimator.SetReferenceSpacecraft(scDefinitive);

sgp4Estimator.SetSpacecraftToProcess(scSGP4);

 

// Specify the Element set to use when estimating the orbit state

sgp4Estimator.ObservationModel.ElementSetToUse = "Equinoctial";

 

// Set option flags

sgp4Estimator.ObservationModel.SpanStartEpochOption = 1;

sgp4Estimator.ObservationModel.SpanIntervalOption = 1;

 

// Configure sampling start and frequency

sgp4Estimator.ObservationModel.DataSpanStartEpoch = scDefinitive.Epoch; 

sgp4Estimator.ObservationModel.StepSize = TimeSpan.FromSeconds(60);

 

// Solve for B*

scSGP4.OD.BStar.ProcessAction = 1;

 

// This call will execute 3 iterations of the Batch OD process to determine an SGP4 state

sgp4Estimator.PerformFit(); 

 

// The final SGP4 state is stored in Spacecraft properties under the SGP4Properties child object

Report scSGP4.SGP4.E, scSGP4.SGP4.I, scSGP4.SGP4.MA, scSGP4.SGP4.MeanMotion, scSGP4.SGP4.RAAN, scSGP4.SGP4.W;

 

Note: Any type of propagator can be used for the definitive Spacecraft object. This example used the Ephemeris type since it is a common use case.

 

See Exporting Two Line Elements for information and examples on exporting the SGP4 state.

 

 

Using Observation Data


In place of having an ephemeris, an SGP4 state can be generated using observation data which will be processed through a Batch Least Squares estimator. The method of processing the observation data is similar to configuring a BatchLeastSquaresOD object in FreeFlyer. To start, the observation data needs to be imported into FreeFlyer:

 

FFGroundObservationFile ffGroundObservationData;

 

ffGroundObservationData.Filename = "groundstationObservations.txt";

 

ffGroundObservationData.SetObservedSpacecraft(scSGP4);

ffGroundObservationData.AddObservationSource(myGroundstation);

 

See the Including Tracking Data in an Estimator guide for more detailed information on importing observation data into FreeFlyer. Once the data is imported, the SGP4StateEstimator object needs to be configured to use the observation data:

 

// Configure SGP4StateEstimator object

SGP4StateEstimator sgp4Estimator;

sgp4Estimator.SetSpacecraftToProcess(scSGP4);

 

// Do not use the ObservationModel child object to generate observations

sgp4Estimator.UseObservationModel = 0;

 

// Register the tracking data file to the BatchLeastSquaresOD child object

sgp4Estimator.Batch.RegisterTrackingDataFile(ffGroundObservationData);

 

// Solve for B*

scSGP4.OD.BStar.ProcessAction = 1;

 

Variable numIterations = 5;

 

// This call will iterate the Batch OD process 5 times to determine an SGP4 state

sgp4Estimator.Batch.Iterate(numIterations); 

 

See the Setting up Batch Least Squares guide for detailed information on configuring BatchLeastSquaresOD object. See Exporting Two Line Elements for information and examples on exporting the SGP4 state.

 

 

See Also


Setting up Batch Least Squares

OrbitStateObservationGenerator Properties and Methods

SGP4StateEstimator Properties and Methods