Importing Two Line Element Sets |
Top Previous Next |
FreeFlyer provides the capability to read TLE files via the Spacecraft, TwoLineElement, Formation, and TLECatalog objects.
All the examples in this section use this sample Three-Line Element file. Three-Line Element files are simply TLEs with an additional first line for the name of the Spacecraft:
SpacecraftThrough the Spacecraft.LoadTLE method, the user is able to load a spacecraft state from a TLE file given the file name and either an index or the name of the spacecraft to load. The state of the ISS can be loaded with the following script:
Note: If a Spacecraft name is specified, the TLE file must be in the Three-Line Element format and the name must match the name in the file exactly (i.e. the search is case sensitive).
The Spacecraft.LoadTLE method also provides the capability of reading the SGP4 derived state from a StringArray object. This specific overload may be useful when loading SGP4 states through a socket connection or by other means where reading a file is not necessary. Once again, the state of the ISS can be loaded from a StringArray object with the following script:
Note: See the StringArray properties and methods page for more information on reading text files through the StringArray object.
TwoLineElementThe TwoLineElement object gives access to a suite of tools used for TLE generation and reading (among other capabilities). The TwoLineElement.LoadTLE method provides similar functionality as the Spacecraft.LoadTLE method while additionally reading components of the TLE that are not used by the Spacecraft such as International Designator, B* dot, B* double dot, and element set number. The examples below are similar to those given above, re-written with the TwoLineElement object:
Note: The SGP4StateEstimator object (used for TLE generation) owns a TwoLineElement object named TLEHandler. See the section on generating TLEs using the SGP4StateEstimator.
The TwoLineElement can also be initialized from the state of an existing Spacecraft object:
To apply a loaded state to a Spacecraft object, use the TwoLineElement.SetSpacecraftStateFromTLE method like so (this example assumes the SGP4 state has already been loaded into the TwoLineElement object as in the example above):
FormationUsing the Formation.LoadTLE method, a text file containing multiple SGP4 states can be imported into a Formation object. Using the sample file 'threeStates.tle' given above, the syntax to load all three states into a Formation object is:
TLECatalogThe TLECatalog object is a container for one or more TwoLineElement objects. TLECatalogs are a specialized version of a List of TwoLineElements (you can create a List of most FreeFlyer objects). The benefit of a TLECatalog over a List of TwoLineElements is that the TLECatalog gives the user the ability to load a large list of SGP4 states and manipulate them in a central location. To load a list of SGP4 states, the same syntax from the Formation.LoadTLE method can be used. For example, the syntax to load all three states into the TLECatalog object is:
Once the states have been loaded into the TLECatalog object, the user can set an individual state to a Spacecraft object in the same fashion described above with the TwoLineElement.SetSpacecraftStateFromTLE method. Assuming the TLECatalog has been loaded, the syntax to load a specific state to a Spacecraft object is:
See Also•Spacecraft Properties and Methods •Formation Properties and Methods •TwoLineElement Properties and Methods •TLECatalog Properties and Methods
|