unpackCataloguefunction
Read a packed file (not gzipped: see unpackAny). The header is checked against the length, so a cut or wrong file is a PackError and never a wrong number; a file of more than MAX_PACKED records is refused.
Import it
import { unpackCatalogue } from "@johnmorrisdotca/chikyu-earth/catalogue";
Definition
function unpackCatalogue(bytes: Uint8Array): PackedCatalogue
Parameters
| Name | Type | Description |
|---|---|---|
bytes | Uint8Array<ArrayBufferLike> | What |
Returns
PackedCatalogue
The records, by column.
Examples
import { packCatalogue, unpackCatalogue } from "@johnmorrisdotca/chikyu-earth/catalogue";
const set = { OBJECT_NAME: "MADE-UP 2", EPOCH: "2026-11-08T00:00:00", MEAN_MOTION: 14.1, ECCENTRICITY: 0.001, INCLINATION: 98, RA_OF_ASC_NODE: 1, ARG_OF_PERICENTER: 2, MEAN_ANOMALY: 3, NORAD_CAT_ID: 123_456, BSTAR: 0, MEAN_MOTION_DOT: 0, MEAN_MOTION_DDOT: 0 };
const file = unpackCatalogue(packCatalogue([{ set, kind: "RB", size: "M" }]));
console.log(file.nameAt(0), file.kindAt(0), file.norad[0], file.recordAt(0).size);MADE-UP 2 RB 123456 MWhat it prints (run when this page was built)