Skip to main content

Crate pleiades_compression

Crate pleiades_compression 

Source
Expand description

Compression codecs and artifact packing helpers for ephemeris data.

The current implementation defines a small, deterministic artifact format with explicit versioning, checksums, artifact capability profiles, and quantized polynomial segments. Optional residual-correction channels are also supported so denser artifacts can keep a compact base fit while layering deterministic corrections on top. The format is intentionally simple enough to audit while still exercising the same segmented lookup flow and random-access body/segment helpers that later, denser artifacts will use. See spec/data-compression.md for the stored-vs-derived output contract and docs/time-observer-policy.md for the explicit packaged lookup policy that keeps derived coordinates separate from observer-driven body-position modes.

Enable the optional serde feature to serialize compressed artifacts for inspection or interchange workflows.

§Examples

use pleiades_compression::{ArtifactHeader, BodyArtifact, ChannelKind, CompressedArtifact,
    PolynomialChannel, Segment, ARTIFACT_VERSION};
use pleiades_types::{CelestialBody, Instant, JulianDay, TimeScale};

let artifact = CompressedArtifact::new(
    ArtifactHeader::new("demo", "synthetic example data"),
    vec![BodyArtifact::new(
        CelestialBody::Sun,
        vec![Segment::new(
            Instant::new(JulianDay::from_days(0.0), TimeScale::Tt),
            Instant::new(JulianDay::from_days(1.0), TimeScale::Tt),
            vec![PolynomialChannel::linear(ChannelKind::Longitude, 9, 10.0, 11.0)],
        )],
    )],
);
assert_eq!(artifact.header.version, ARTIFACT_VERSION);

Structs§

ArtifactHeader
Describes the non-body metadata stored in a compressed artifact.
ArtifactProfile
Capability/profile metadata for a compressed artifact.
ArtifactProfileCoverageSummary
Structured body coverage attached to an artifact capability profile.
ArtifactResidualBodyCoverageSummary
Structured body coverage for residual-correction-bearing segments in a compressed artifact.
BodyArtifact
All segments for a single body.
CartesianState
Cartesian ecliptic state: position and velocity (all in AU and AU/day).
CompressedArtifact
A compressed ephemeris artifact.
CompressionError
A structured compression error.
PolynomialChannel
Quantized polynomial coefficients for one channel of a time segment.
Segment
A single time segment for a specific body.
SphericalState
Spherical ecliptic state: position (lon, lat, dist) plus velocity rates (all in AU and rad/day).

Enums§

ArtifactOutput
Artifact-level output semantics for fields that are not raw segment channels.
ArtifactOutputSupport
Describes how a high-level artifact output is represented by the profile.
ChannelKind
The kind of ecliptic channel carried by a segment.
CompressionErrorKind
Error categories for compression and artifact parsing.
EndianPolicy
Describes the byte-order policy encoded by a compressed artifact.
SpeedPolicy
Declares how motion/speed values are represented by an artifact.
StoredFrame
The coordinate frame a body’s stored channels are expressed in.

Constants§

ARTIFACT_VERSION
Current artifact format version.

Functions§

cartesian_au_to_ecliptic
Converts ecliptic Cartesian (AU) back to ecliptic spherical. Longitude is normalized to [0, 360) by Longitude::from_degrees.
cartesian_state_to_spherical
Converts a Cartesian ecliptic state back to spherical using the inverse chain rule.
ecliptic_to_cartesian_au
Converts ecliptic spherical (deg, deg, AU) to ecliptic Cartesian (AU). Returns None when distance is absent — recombination requires a radius.
geocentric_from_heliocentric
Reconstructs geocentric ecliptic from a planet’s heliocentric ecliptic and the geocentric Sun: P_geo = P_helio + S_geo (vector add in ecliptic-of-date).
heliocentric_from_geocentric
Derives a planet’s heliocentric ecliptic from its geocentric ecliptic and the geocentric Sun: P_helio = P_geo − S_geo (vector subtract in ecliptic-of-date).
join_display
Joins displayable values into a compact comma-separated list.
spherical_state_to_cartesian
Converts a spherical ecliptic state to Cartesian using the chain rule.