Main Content

tleread

Read data from two-line element (TLE) file

Since R2023b

    Description

    tleStruct = tleread(tleFile) reads the data from a two-line element (TLE) file, tleFile. To calculate the position and velocity of one or more spacecraft over time using two-line element (TLE) data, use this vector of structures as input to the propagateOrbit function. The function outputs a vector of structures containing data from the input TLE file in tleStruct. You can then use the propagateOrbit function to calculate the position and velocity using tleStruct.

    If the TLE file contains multiple entries for the same catalog number, the function outputs only the data corresponding to the latest epoch (defined for each TLE set).

    example

    Examples

    collapse all

    Read the data from the TLE (Two-Line Element) file named 'leoSatelliteConstellation.tle'. Calculate the position and velocity based on the TLE structure, 'tleStruct'. This file is located on the MATLAB® path and is provided with the Aerospace Toolbox.

    tleStruct = tleread('leoSatelliteConstellation.tle')
    tleStruct=40×1 struct array with fields:
        Name
        SatelliteCatalogNumber
        Epoch
        BStar
        RightAscensionOfAscendingNode
        Eccentricity
        Inclination
        ArgumentOfPeriapsis
        MeanAnomaly
        MeanMotion
    
    

    Calculate the position and velocity corresponding to the input time using the TLE data defined in tleStruct.

    [r,v] = propagateOrbit(datetime(2022, 1, 3, 12, 0, 0),tleStruct);

    Input Arguments

    collapse all

    TLE file, specified as a character vector or a string scalar. The file must exist in the current folder or in a folder on the MATLAB® path, or the argument must include a full or relative path to a file. For more information on TLE files, see Two Line Element (TLE) Files.

    Example: 'leoSatelliteConstellation.tle'

    Data Types: char | string

    Output Arguments

    collapse all

    TLE structures extracted from tleFile, returned as a vector of structs. To calculate the position and velocity using two-line element (TLE) data, use this file as input to the propagateOrbit function. For more information on TLE-file structures, see Two Line Element (TLE) Files.

    Version History

    Introduced in R2023b