Skip to main content

🧪 OMMLoader

From-v5.0Status: Experimental

OMMLoader reads the general perturbations (GP) subset of CCSDS Orbit Mean-Elements Message (OMM) for SGP4. It reads the JSON form that CelesTrak (FORMAT=json) and Space-Track serve, and the KVN (keyword = value) form.

In KVN, the loader reads keywords between META_START and META_STOP or between DATA_START and DATA_STOP. It skips other blocks, such as covariance, through their matching *_STOP delimiter and treats an unterminated block as an invalid element set.

This subset uses Earth as the center (CENTER_NAME), TEME as the frame (REF_FRAME), UTC as the time system (TIME_SYSTEM), and SGP4 as the theory (MEAN_ELEMENT_THEORY). The loader assumes these values for omitted or blank fields. It accepts SGP/SGP4 as an alias and rejects other explicit values. It trims whitespace and matches values without regard to case.

🧪 OMMLoader
File formatOMM
File extension.omm (JSON is detected from its content)
Data formatApache Arrow Table or ObjectRowTable
Supported APIsload, parse, parseSync (bundled loader)

Usage​

import {load} from '@loaders.gl/core';
import {OMMLoader} from '@loaders.gl/scientific/omm';

const url = 'https://celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=json';
const table = await load(url, OMMLoader);
// Apache Arrow table, one row for each element set
const meanMotion = table.getChild('MEAN_MOTION');

Use the object-row shape when the next step needs one object for each element set, for example an SGP4 library that reads OMM JSON objects:

const {data} = await load(url, OMMLoader, {omm: {shape: 'object-row-table'}});
for (const row of data) {
console.log(row.OBJECT_NAME, row.NORAD_CAT_ID, row.EPOCH);
}

Shapes​

ShapeOutput
arrow (default)Apache Arrow Table. Field metadata unit gives the unit.
object-row-table{shape: 'object-row-table', schema, data: OMMRow[]}

Options​

OptionTypeDefaultDescription
omm.shapestring'arrow'Output shape.
omm.skipInvalidRecordsbooleanfalseWhen true, skip an invalid element set and log a warning (core.log). When false, throw.

Error messages give the location: element set N (1-based) for JSON, and the line number for KVN.

Output schema​

OMMLoader and TLELoader return the same columns, in this order. The names are the CCSDS OMM keywords.

ColumnTypeUnitDescription
OBJECT_NAMEutf8, nullableSpacecraft name
OBJECT_IDutf8, nullableInternational designator, for example 1998-067A
NORAD_CAT_IDint32, nullableSatellite catalog number
EPOCHutf8UTCEpoch, ISO 8601, for example 2026-11-23T21:54:38.454048
MEAN_MOTIONfloat64rev/dayMean motion
ECCENTRICITYfloat64Eccentricity, 0 or more and less than 1
INCLINATIONfloat64degInclination, 0 to 180
RA_OF_ASC_NODEfloat64degRight ascension of the ascending node
ARG_OF_PERICENTERfloat64degArgument of pericenter
MEAN_ANOMALYfloat64degMean anomaly
EPHEMERIS_TYPEint32, nullableEphemeris type, usually 0
CLASSIFICATION_TYPEutf8, nullableU, C or S
ELEMENT_SET_NOint32, nullableElement set number
REV_AT_EPOCHint32, nullablerevRevolution number at epoch
BSTARfloat64, nullable1/ERSGP4 drag term (ER: earth radii)
MEAN_MOTION_DOTfloat64, nullablerev/day**2First derivative of mean motion, as written in the TLE (see notes)
MEAN_MOTION_DDOTfloat64, nullablerev/day**3Second derivative of mean motion, as written in the TLE

Notes:

  • The loader requires EPOCH, MEAN_MOTION, ECCENTRICITY, INCLINATION, RA_OF_ASC_NODE, ARG_OF_PERICENTER and MEAN_ANOMALY. Other columns are null when the input does not have them.
  • Numbers can be JSON numbers or numeric strings (Space-Track JSON uses strings).
  • NORAD_CAT_ID can also be an Alpha-5 string, for example A0057 (100057).
  • EPOCH keeps the text of the input. Use parseOMMEpoch() to get milliseconds since the Unix epoch. The loader reads dates without a zone suffix as UTC and rejects out-of-range calendar and day-of-year dates.
  • MEAN_MOTION_DOT and MEAN_MOTION_DDOT have the values of the TLE fields. The TLE format defines these fields as the first derivative divided by 2 and the second derivative divided by 6. CelesTrak and Space-Track copy the TLE values into OMM unchanged, and SGP4 libraries expect these values.
  • The loader checks GP metadata during parsing. It ignores COMMENT and USER_DEFINED_*.

Helpers​

FunctionDescription
parseOMMText(text, options?)Parses OMM JSON or KVN text to OMMRow[].
parseOMMJSON(json, options?)Converts parsed OMM JSON (an array or one object) to OMMRow[].
parseOMMKVNText(text, options?)Parses OMM KVN text to OMMRow[].
convertOMMObjectToRow(object)Validates one OMM object and returns an OMMRow.
parseOMMEpoch(epoch)Converts an OMM epoch string to milliseconds since the Unix epoch.
parseAlpha5CatalogNumber(text)Converts a five-character catalog number (25544 or A0057) to a number.
makeOMMArrowTable(rows)Makes an Arrow table with the schema above.
OMM_SCHEMA, OMM_COLUMNSThe schema above.

Limitations​

  • The loader does not read the OMM XML form. It throws a clear error for XML input.
  • The loader does not propagate orbits. Use an SGP4 library, for example satellite.js, with the rows.
  • Covariance data, spacecraft parameters (mass, areas) and user-defined parameters are not in the output.