Documentation / @interstellar-tools/tracking / formatOmm
Function: formatOmm()
ts
function formatOmm(elements: MeanElementsInterface): OmmRecordInterface;Defined in: satellites/omm.ts:236
Write mean elements as an Orbit Mean-elements Message (OMM) record, in the JSON form CelesTrak publishes: the reverse of parseOmm. Unlike a TLE, it keeps every digit, and has room for any catalogue number.
Notes
EPOCHis in UTC, with six decimals of the second and no trailingZ, as CelesTrak writes it. It comes fromepochJulianDate, which holds the epoch to about 40 µs, so the last digit or two can differ from a published OMM's.JSON.stringifythe record for the text, or put several in an array for a file of them, as CelesTrak serves them.OBJECT_NAMEandOBJECT_IDare left out when the elements have none.
Parameters
| Parameter | Type | Description |
|---|---|---|
elements | MeanElementsInterface | The mean elements, from parseTle, parseOmm or fitElements. |
Returns
One OMM record, with the keywords CelesTrak uses, in its order.
Throws
If a value of elements is not a finite number.
Example
ts
const omm = formatOmm(iss);
omm.EPOCH; // '2026-11-04T08:52:07.404092'
JSON.stringify([omm]); // a file of one recordSee
- parseOmm
- formatTle
- https://celestrak.org/NORAD/documentation/gp-data-formats.php CelesTrak, "A new way to obtain GP data"