Expand description
§empyrean
High-precision Solar System dynamics — trajectory propagation, ephemeris generation, orbit determination, and event analysis (close approaches, occultations, eclipses, sphere-of-influence crossings) for real Solar System bodies.
Safe Rust wrapper over empyrean-sys. Use this crate to propagate
orbits, generate ephemerides, and determine orbits from observations
without writing unsafe code.
§Standard workflow
Pull an orbit from JPL SBDB, propagate it forward, generate ephemerides at an observatory, and inspect detected events:
use empyrean::{Context, EphemerisConfig, Frame, Origin, PropagationConfig};
let ctx = Context::from_data_dir(None)?;
// 1. Pull Apophis from SBDB (CometaryCoordinates with covariance).
let batch = empyrean::query_sbdb(&["99942"], None)?;
// 2. Propagate 10 years past the SBDB epoch.
let cfg = PropagationConfig::default();
let t0 = batch.orbits[0].state.epoch.mjd_tdb()?;
let epochs = vec![empyrean::Epoch::from_mjd_tdb(t0 + 10.0 * 365.25)];
let result = ctx.propagate(&batch.orbits, &epochs, &cfg)?;
println!("{} states, {} events", result.states.len(), result.events.len());
// 3. Predict on-sky positions at Mauna Kea (MPC code 568).
let observers = ctx.get_observers(&["568"], &epochs, Frame::ICRF, Origin::SSB)?;
let eph_cfg = EphemerisConfig::default();
let eph = ctx.generate_ephemeris(&batch.orbits, &observers, &eph_cfg)?;For close-approach analysis (impact probability, B-plane geometry),
see Context::compute_impact_probabilities and
Context::compute_b_planes. For OD from astrometric
observations, see Context::determine and the Session type
for interactive masking workflows.
§Coordinate transform
use empyrean::{Context, CoordinateState, Frame, Origin, Representation};
let ctx = Context::from_data_dir(None)?;
let input = CoordinateState::cometary(
empyrean::Epoch::from_mjd_tdb(60200.0),
[0.7461, 0.1914, 3.339, 204.446, 126.687, 60159.0],
Frame::EclipticJ2000,
Origin::SUN,
);
let cart =
ctx.transform_coordinates_single(&input, Representation::Cartesian, Frame::ICRF, Origin::SUN)?;
println!("x = {:.6} AU", cart.elements[0]);§Quick reference
| You want… | API |
|---|---|
| Propagate orbits to target epochs | Context::propagate |
| Predict observations at observatories | Context::generate_ephemeris |
| Fit an orbit to observations | Context::determine |
| Re-fit with a Bayesian prior | Context::refine |
| Residuals only — no fit | Context::evaluate |
| Stateful, mask-and-refit OD | Session |
| Impact probability | Context::compute_impact_probabilities |
| B-plane geometry | Context::compute_b_planes |
| Rank candidate follow-up observations | Context::evaluate_plan |
| Convert between coordinate types | Context::transform_coordinates (batch) / Context::transform_coordinates_single |
| Body / observer states | Context::get_states / Context::get_observers |
| Pull an orbit from JPL SBDB | query_sbdb |
| Pull predicted ephemeris from Horizons | query_horizons |
| Pull SSB state vectors from Horizons | query_horizons_vectors |
| Pull observations from MPC | query_observations |
| Pull radar astrometry from JPL | query_radar |
| Read ADES PSV observations | Context::read_ades |
| Default data directory | default_data_dir |
§Conventions
- Distances in AU; velocities in AU/day; angles in degrees at the API boundary (radians internally).
- Epochs are MJD on the TDB scale unless otherwise stated.
See
time::Epochfor time-scale-aware values andtime::iso_to_mjd/time::mjd_to_isofor ISO 8601 interop. - Default integrator is
IntegratorChoice::GR15(median Horizons error ≈ 35 m). Switch toIntegratorChoice::DOP853viaAdvancedIntegratorConfig::integratorfor ~1.4× speed at the cost of ~10× position error. - Default frame for propagation output is
Frame::EclipticJ2000(the integration frame); setPropagationConfig::frametoFrame::ICRFfor ICRF output.
Re-exports§
pub use propagate::AdvancedIntegratorConfig;pub use propagate::CovarianceKind;pub use propagate::CovarianceQuality;pub use propagate::DiagnosticsConfig;pub use propagate::EphemerisOverlapPolicy;pub use propagate::Event;pub use propagate::EventConfig;pub use propagate::ForceModelTier;pub use propagate::IntegratorChoice;pub use propagate::OriginSwitchingConfig;pub use propagate::PropagatedState;pub use propagate::PropagationConfig;pub use propagate::PropagationResult;pub use propagate::TaggedCovariance;pub use propagate::TargetFunctional;pub use propagate::UncertaintyMethod;pub use time::Epoch;pub use time::TimeScale;pub use time::iso_to_mjd;pub use time::mjd_to_iso;
Modules§
- propagate
- Orbit propagation and event detection.
- time
- Time scale conversions: ISO 8601 ↔ MJD in UTC or TDB.
Structs§
- Acceptability
Report - Acceptability sub-checks reported on a
DetermineResult. - Acceptability
Thresholds - Thresholds for the post-DC fit-acceptability sub-checks.
- Auto
Escalation Policy - Tuning for
SolveForParams::Autoautomatic escalation. - BPlane
- One B-plane breakdown for a single close approach.
- Band
Stat - Per-band photometric fit statistics.
- Built
System - A reusable pre-built force-model handle.
- Context
- Handle to loaded SPICE kernels, gravitational parameters, and ephemeris state required for every propagation, ephemeris, or OD call.
- Coordinate
State - Coordinate state: epoch + six-element state vector + optional covariance.
- Covariance
Metrics - Summary metrics for a state covariance — the prior, the posterior, or a candidate’s running total.
- Data
DirOptions - Options for
Context::from_data_dir_with. - Debiasing
Config - Catalog-bias-correction configuration.
- Determine
Entry - One object’s slot in a batch determine: its identifier and either the delivered fit or the typed failure.
- Determine
Failure - One object’s failure inside a batch determine.
- Determine
Result - Result of a differential-correction orbit determination.
- Determine
Results - The result of a batch
Context::determine— oneDetermineEntryper ADES object in the observations, ordered byobject_id. - Ephemeris
Config - Ephemeris-generation configuration.
- Ephemeris
Entry - One row of predicted astrometry.
- Ephemeris
Result - Result of
Context::generate_ephemeris: the per-(orbit, observer, epoch)ephemeris entries plus the observation-sensitivity rows (empty unless the propagation traced the STM — seeObservationSensitivityfor what makes it trace). - Error
- Error returned from an empyrean FFI call.
- Evaluate
Result - Result of evaluating a candidate orbit against observations (no fit).
- FitSummary
Row - One row of the fit summary: what orbit determination did with one object.
- Gate
Record - One model-ladder gate decision from the photometric fit.
- IODConfig
- IOD ranging tuning.
- Impact
Probability - One impact-probability record produced by a single
UncertaintyMethodpropagation. - Joint
Covariance - A fitted or propagated joint’s cross terms, as the library hands them back.
- Kernel
Record - One entry of the kernel-identity manifest a handle captured at construction. Names the provenance of each loaded data file — never any tuning rationale.
- Mixture
Component - A component of a Gaussian mixture produced by
split_gaussian. - ODConfig
- Orbit-determination configuration.
- Observation
- A single astrometric observation — full ADES schema.
- Observation
Residual - Per-observation result from orbit determination or evaluation.
- Observation
Sensitivity - Observation-sensitivity row: the partial derivatives of the sky-plane
observable w.r.t. the input state, for one
(orbit, observer, epoch). - Observations
- Owned set of ADES observations returned by
Context::read_ades. - Observatory
Config - Per-site astrometric assumptions and observability filters.
- Observer
- Observer state at one epoch.
- Orbit
- Orbit to propagate: coordinate state plus optional Marsden non-grav coefficients (A1, A2, A3), a configurable g(r) distance scaling, and optional photometric parameters.
- Orbit
Batch - A batch of orbits paired with their orbit / object identifiers.
- Photometry
Config - Post-OD photometric-fit configuration (mirrors the engine’s
photometry config). Attach via
ODConfig::photometry. Sentinel rule:0/0.0on a tuning field requests the engine default. - Photometry
Result - Post-OD photometric solution — an H/G fit over the arc’s magnitudes,
run after the orbit is solved (photometry has no astrometric
partials, so it never touches the state). H carries honest σ via
covariance. - Plan
Candidate - What one candidate observation would buy.
- Plan
Ephemeris Point - One predicted sky position from the plan’s optical ephemeris.
- Plan
Result - The result of evaluating an observation plan.
- Planned
Observation - One candidate observation: when it would be taken and what it would measure.
- Planning
Config - Configuration for
Context::evaluate_plan. - Radar
Observation - A single radar observation — full ADES radar schema.
- Radar
Plan Spec - The radar measurement a candidate would make: the link (transmit and receive dishes), the waveform, and how the effective SNR is sourced.
- Radar
Residual - Radar residual block on an
ObservationResidualrow. - Rejection
Config - Outlier-rejection configuration. The active fields are determined
by
kind. - Residual
Summary - Summary statistics over a residual set. AT/CT RMS values are NaN when no sky-motion rates were available.
- Session
- Stateful orbit-determination handle.
- Session
Diff - Pairwise diagnostic between two fits in the same session.
- Solve
For - What a fit does with each parameter axis (mirrors the engine’s
SolveFor). - Solved
Covariance - Full tagged solved-parameter covariance from a wide OD fit.
- Stall
Delivery - The numbers behind a fit delivered by the stable-stall acceptance — one whose final solve latched no convergence criterion but was stationary to a small fraction of its own formal σ with χ² clearing the fit-quality bars.
- State
- A single body state.
- Station
Bias - One per-station fitted nuisance bias.
- Station
RaDec Config - Per-station RA/Dec bias-fit configuration.
- System
Description - A reproducibility summary of a
BuiltSystem’s frozen force model plus the kernel-identity manifest it captured from the context. - Target
Radar Properties - Target physical properties the radar link budget needs to predict an
SNR. Every field is optional;
Nonemeans “not known”. - Thrust
Arc - A single continuous-thrust arc with smooth on/off switching and optional mass depletion.
- Thrust
Params - Thrust parameters for an orbit: thrust arcs plus optional Δv targeting corrections.
- Versions
- Per-crate versions reported by the empyrean stack.
- Weighting
Config - Observation weighting pipeline.
- Wide
Cross - Cross-covariance terms beyond the state+Marsden \(9 \times 9\): state↔DT, state↔AMRAT, state↔\(\Delta v\), and every mixed parameter pair.
Enums§
- Built
System Guard Error - Which guard axis a
BuiltSystemcall tripped. - Candidate
Kind - What a candidate turned out to be, with the fields only that kind reports.
- Covariance
Representation - Coordinate basis tag for OD output covariance.
- Covariance
Trust - Event-aware trust verdict on the delivered covariance, evaluated
over its validity window on the converged orbit. Absence
(
DetermineResult::covariance_trust == None) means the call path ran no gate — absence of a verdict is not trust. - Data
Tier - Force-model tier whose kernel set a data-directory constructor acquires and loads.
- Debiasing
Resolution - Healpix resolution of a debiasing table.
- Determine
Failure Kind - Why one object’s fit failed inside a batch
Context::determine. - Frame
- Reference frame.
- Kernel
Kind - Category of a loaded data file in a handle’s kernel manifest.
- Kernel
Provenance - Where a kernel in a handle’s manifest came from.
- Origin
- Origin (center body) for a coordinate state.
- Origin
Policy - Origin-policy selector for the OD pipeline.
- Output
Epoch - Output epoch for the fitted orbit.
- Param
Column - Which solved parameter a cross term refers to.
- Param
Disposition - What a fit did with one parameter axis.
- Phase
Function - Phase-function model for HG-family photometry.
- Photometry
Model - Photometric model for the post-OD phase-function fit.
- Planned
Observation Kind - The measurement a
PlannedObservationwould make. - Radar
Measurement - The delay-or-Doppler measurement carried by a
RadarObservation(ADESRadarValuechoice). All values are ADES-native — no unit conversion is applied anywhere in the safe wrapper. - Radar
Mode - Which radar observable(s) a candidate would measure.
- Radar
Residual Kind - Which radar observable a
RadarResidualrefers to. - Radar
Station - A radar dish the planner can schedule against.
- Rejection
Kind - Outlier-rejection strategy selector. The variant chosen determines
which fields of
RejectionConfigare read; ignored fields keep their defaults. - Rejection
Reason - Why an observation was kept or rejected. The
NotEvaluatedvariant is the safe-Rust analogue of the C ABI’s “not evaluated” sentinel — used on the evaluate path where rejection is not run. - Representation
- Orbital state representation.
- Sigma
Policy - How a weighting layer’s
sigmacombines with a per-observation reportedsigma. - Solve
ForParams - Solve-for parameter set used by differential correction.
- Solver
Stop - Which criterion ended the solve that produced a fit’s published state.
- Steering
Law - Steering law — how the thrust direction is computed from the
spacecraft state relative to the arc’s
central_body. - Trust
Gate Event - The intervening event named by a
CovarianceTrust::EncounterIntervenesverdict. - Weighting
Layer - One element of the weighting pipeline.
- Weighting
Preset - Preset selector for
WeightingConfig. Picking a preset seeds the layer chain with curated layers; entries inWeightingConfig::additional_layersare placed ahead of the preset’s rules (sigma resolution is first-match-wins, so they override the preset for their stations).
Constants§
- MAX_
THRUST_ SEGMENTS - The largest number of thrust Δv correction segments one fit can
declare, and the length of
SolveFor::thrust. - SENSITIVITY_
ROW_ DEC - Row of the declination partials, in degrees per input unit.
- SENSITIVITY_
ROW_ RA - Row of the right-ascension partials, in degrees per input unit.
- SENSITIVITY_
ROW_ RANGE - Row of the range (topocentric distance) partials, in AU per input unit.
- SENSITIVITY_
ROW_ VDEC - Row of the Dec-rate partials, in deg/day per input unit.
- SENSITIVITY_
ROW_ VRA - Row of the RA-rate partials, in deg/day per input unit. The rate is dRA/dt, not scaled by cos(Dec).
- SENSITIVITY_
ROW_ VRANGE - Row of the range-rate partials, in AU/day per input unit.
Functions§
- default_
data_ dir - Return the platform XDG-compliant default data directory.
- download_
data - Provision the complete Standard-tier kernel set into
data_dir(or the platformdefault_data_dirwhenNone) and return the resolved directory. - eigenvector_
max_ 6x6 - Compute the largest eigenvalue and corresponding eigenvector of a 6×6 symmetric matrix.
- frame_
to_ int - Convert a
Frameto its integer code (matches the C ABI). - int_
to_ frame - Convert an integer code to a
Frame. - int_
to_ rep - Convert an integer code to a
Representation. - offline_
floor_ is_ active - Whether the
EMPYREAN_OFFLINEfloor is in force for this process. - query_
horizons - Query JPL Horizons for predicted ephemeris records at a single observatory across a list of MJD TDB epochs.
- query_
horizons_ vectors - Query JPL Horizons for a Cartesian state vector at a single epoch.
- query_
observations - Query the MPC observations API for ADES records of one or more designations.
- query_
radar - Query the JPL
sb_radarAPI for delay/Doppler radar astrometry of one or more designations. - query_
sbdb - Query the JPL Small-Body Database for one or more orbits by designation, name, or SPK ID.
- read_
orbits_ csv - Read an orbits CSV file.
- read_
orbits_ json - Read an orbits JSON file.
- read_
orbits_ parquet - Read an orbits parquet file.
- rep_
to_ int - Convert a
Representationto its integer code (matches the C ABI). - split_
gaussian - Split a Gaussian (mean, covariance) into a mixture of
ksmaller Gaussians along the eigenvector of maximum variance. - version_
string - Multi-line version report —
empyrean-core <ver>\nvilleneuve <ver>\n…. - versions
- Per-crate version strings for the empyrean stack.
- write_
ephemeris_ csv - Write ephemeris entries to CSV.
- write_
ephemeris_ json - Write ephemeris entries to JSON.
- write_
ephemeris_ parquet - Write ephemeris entries to a parquet file.
- write_
events_ csv - Write events to CSV.
- write_
events_ json - Write events to JSON.
- write_
events_ parquet - Write events to a parquet file.
- write_
fit_ summary_ csv - Write the per-object fit summary to CSV.
- write_
fit_ summary_ json - Write the per-object fit summary to JSON.
- write_
fit_ summary_ parquet - Write the per-object fit summary to a parquet file.
- write_
orbits_ csv - Write an orbit batch to CSV.
- write_
orbits_ json - Write an orbit batch to JSON.
- write_
orbits_ parquet - Write an orbit batch to a parquet file.
- write_
residuals_ csv - Write OD residuals to CSV.
- write_
residuals_ json - Write OD residuals to JSON.
- write_
residuals_ parquet - Write OD residuals to a parquet file.
Type Aliases§
- Result
- Result type for empyrean FFI calls.