Skip to main content

🧪 TLELoader

From-v5.0Status: Experimental

TLELoader parses two-line element sets (TLE). It converts each set to a row with the CCSDS OMM keyword names and units. Thus TLE and OMM data give the same table schema.

🧪 TLELoader
File formatTLE
File extension.tle, .3le
Data formatApache Arrow Table or ObjectRowTable
Supported APIsload, parse, parseSync (bundled loader)

Usage​

import {load} from '@loaders.gl/core';
import {TLELoader} from '@loaders.gl/scientific/tle';

const url = 'https://celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=tle';
const table = await load(url, TLELoader);
const {data} = await load(url, TLELoader, {tle: {shape: 'object-row-table'}});

Input​

  • The two-line form and the three-line form (a name line before each set). A 0 prefix on the name line (Space-Track 3LE) is removed.
  • LF, CRLF and CR line ends, blank lines, trailing white space and a byte order mark.
  • Alpha-5 catalog numbers (A0057 is 100057). See the format notes.

Shapes​

ShapeOutput
arrow (default)Apache Arrow Table
object-row-table{shape: 'object-row-table', schema, data: OMMRow[]}

Options​

OptionTypeDefaultDescription
tle.shapestring'arrow'Output shape.
tle.validateChecksumbooleantrueWhen false, do not compare the modulo-10 checksum of each line.
tle.skipInvalidRecordsbooleanfalseWhen true, skip an invalid set and log a warning (core.log). When false, throw.

Error messages give the line number in the input text, for example TLELoader: line 2: checksum error on TLE line 1: found "0", computed 3.

Output schema​

The output schema is the OMMLoader output schema. The loader converts the TLE fields as follows.

ColumnTLE field (line: columns)Conversion
OBJECT_NAMEname lineTrimmed. null for the two-line form.
OBJECT_ID1: 10-1798067A becomes 1998-067A. null when blank.
NORAD_CAT_ID1: 3-7Numeric or Alpha-5. Must agree with line 2.
CLASSIFICATION_TYPE1: 8As written.
EPOCH1: 19-32 (YYDDD.DDDDDDDD)ISO 8601 UTC with microseconds. Years 57-99 are 1957-1999, 00-56 are 2000-2056.
MEAN_MOTION_DOT1: 34-43As written (rev/day**2).
MEAN_MOTION_DDOT1: 45-52Implied decimal point and exponent: -11606-4 is -0.11606e-4.
BSTAR1: 54-61Implied decimal point and exponent (1/ER).
EPHEMERIS_TYPE1: 630 when blank.
ELEMENT_SET_NO1: 65-68Integer.
INCLINATION2: 9-16Degrees.
RA_OF_ASC_NODE2: 18-25Degrees.
ECCENTRICITY2: 27-33Implied leading decimal point: 0007379 is 0.0007379.
ARG_OF_PERICENTER2: 35-42Degrees.
MEAN_ANOMALY2: 44-51Degrees.
MEAN_MOTION2: 53-63Revolutions per day.
REV_AT_EPOCH2: 64-68Integer.

The epoch conversion uses integer arithmetic: 1e-8 day is exactly 864 microseconds. Thus the EPOCH text is the same as the EPOCH of the CelesTrak OMM JSON for the same element set.

Helpers​

FunctionDescription
parseTLEText(text, options?)Parses TLE text to OMMRow[].
convertTLEToOMMRow(line1, line2, name?, options?)Converts one set to an OMMRow.
computeTLEChecksum(line)Returns the modulo-10 checksum of a TLE line.

Limitations​

  • The loader does not write TLE text.
  • The loader does not propagate orbits.