Caelus3,462 checksGitHubv0.25.0MIT
API Reference / decodePack · function

Function: decodePack()

function decodePack(bytes): ChebData;

Decode a binary (CPK1) Chebyshev pack into the same shape a JSON pack loads to, ready for EngineData. The coefficients are exact multiples of the pack's quantum, identical to the Python reference's decoding.

Parameters

ParameterTypeDescription
bytesUint8ArrayThe contents of a .cpk file.

Returns

ChebData

The pack: jd0, seg_days, scale, segments, and provenance.

Example

const bytes = new Uint8Array(await (await fetch("/data/mars_cheb.cpk")).arrayBuffer());
const data = { ...embeddedData, chebPacks: { mars: decodePack(bytes) } };

Start building

Quickstart →