pub struct CompressedArtifact {
pub header: ArtifactHeader,
pub checksum: u64,
pub bodies: Vec<BodyArtifact>,
}Expand description
A compressed ephemeris artifact.
Fields§
§header: ArtifactHeaderFile header metadata.
checksum: u64Checksum over the payload bytes.
bodies: Vec<BodyArtifact>Body series stored in the artifact.
Implementations§
Source§impl CompressedArtifact
impl CompressedArtifact
Sourcepub fn new(header: ArtifactHeader, bodies: Vec<BodyArtifact>) -> Self
pub fn new(header: ArtifactHeader, bodies: Vec<BodyArtifact>) -> Self
Creates a new artifact with an unset checksum.
Sourcepub fn validate(&self) -> Result<(), CompressionError>
pub fn validate(&self) -> Result<(), CompressionError>
Validates the in-memory artifact before encoding or regeneration.
This checks the header metadata, the bundled body/profile coverage, canonical body ordering, duplicate body entries, and every body segment’s metadata. It is useful for generators that want to fail fast before writing a deterministic binary payload.
Sourcepub fn profile_coverage_summary(&self) -> ArtifactProfileCoverageSummary
pub fn profile_coverage_summary(&self) -> ArtifactProfileCoverageSummary
Returns the artifact profile paired with the bundled body list.
Sourcepub fn residual_body_coverage_summary(
&self,
) -> ArtifactResidualBodyCoverageSummary
pub fn residual_body_coverage_summary( &self, ) -> ArtifactResidualBodyCoverageSummary
Returns the bodies that include at least one residual-correction segment.
Sourcepub fn body_artifact(&self, body: &CelestialBody) -> Option<&BodyArtifact>
pub fn body_artifact(&self, body: &CelestialBody) -> Option<&BodyArtifact>
Returns the body artifact for the requested body, if present.
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Returns the total number of segments stored in the artifact.
Sourcepub fn residual_segment_count(&self) -> usize
pub fn residual_segment_count(&self) -> usize
Returns the number of segments that carry residual-correction channels.
Sourcepub fn residual_bodies(&self) -> Vec<CelestialBody>
pub fn residual_bodies(&self) -> Vec<CelestialBody>
Returns the bundled bodies that include at least one residual-correction segment.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
Returns a compact one-line summary of the artifact body, segment, and residual-correction coverage.
Sourcepub fn segment_for(
&self,
body: &CelestialBody,
instant: Instant,
) -> Result<&Segment, CompressionError>
pub fn segment_for( &self, body: &CelestialBody, instant: Instant, ) -> Result<&Segment, CompressionError>
Returns the body segment covering the requested instant.
Sourcepub fn checksum(&self) -> Result<u64, CompressionError>
pub fn checksum(&self) -> Result<u64, CompressionError>
Returns the on-disk checksum for this artifact.
Sourcepub fn encode(&self) -> Result<Vec<u8>, CompressionError>
pub fn encode(&self) -> Result<Vec<u8>, CompressionError>
Encodes the artifact as a deterministic binary blob.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, CompressionError>
pub fn decode(bytes: &[u8]) -> Result<Self, CompressionError>
Decodes an artifact from a binary blob.
Checksum mismatches are rejected with CompressionErrorKind::ChecksumMismatch
before the payload is parsed.
Sourcepub fn lookup_ecliptic(
&self,
body: &CelestialBody,
instant: Instant,
) -> Result<EclipticCoordinates, CompressionError>
pub fn lookup_ecliptic( &self, body: &CelestialBody, instant: Instant, ) -> Result<EclipticCoordinates, CompressionError>
Returns the ecliptic coordinates for a body at a given instant.
The artifact profile must advertise EclipticCoordinates as a derived
output before this helper will serve the result.
Sourcepub fn lookup_equatorial(
&self,
body: &CelestialBody,
instant: Instant,
obliquity: Angle,
) -> Result<EquatorialCoordinates, CompressionError>
pub fn lookup_equatorial( &self, body: &CelestialBody, instant: Instant, obliquity: Angle, ) -> Result<EquatorialCoordinates, CompressionError>
Returns equatorial coordinates reconstructed from the stored ecliptic channels.
This keeps the artifact format focused on the stored channels while still allowing
the runtime to reconstruct a derived coordinate family when the caller supplies the
geometric obliquity used for the frame rotation (the packaged backend passes the
J2000 obliquity). The artifact profile must advertise EquatorialCoordinates as a
derived output before this helper will serve the result.
Sourcepub fn lookup_motion(
&self,
body: &CelestialBody,
instant: Instant,
) -> Result<Motion, CompressionError>
pub fn lookup_motion( &self, body: &CelestialBody, instant: Instant, ) -> Result<Motion, CompressionError>
Returns the angular and radial speeds for a body at a given instant.
Speeds are computed analytically from the fitted polynomial segment derivatives. For geocentric-stored bodies (Sun, Moon, Eros) the derivative of the stored channel is returned directly. For heliocentric-stored planets the heliocentric spherical state is converted to Cartesian, added to the Sun’s geocentric Cartesian state, and converted back to geocentric spherical rates.
The artifact profile must advertise Motion as a supported output (via a
non-Unsupported SpeedPolicy) before this helper will serve the result.