Skip to main content

build_centric_observer_cache

Function build_centric_observer_cache 

Source
pub fn build_centric_observer_cache(
    jpl: &JPLEphem,
    ut1_provider: &Ut1Provider,
    obs_dataset: &ObsDataset,
    observer_fixed_cache: &BodyFixedObserverCache,
    cache_velocity: bool,
) -> Result<CentricObserverCache, OutfitError>
Expand description

Builds the CentricObserverCache for every observation in a dataset.

Iterates over all observations in obs_dataset, looks up the pre-built body-fixed cache entry for the corresponding observer, and computes the epoch-dependent geocentric and heliocentric state via ObserverCentricCache::new.

§Arguments

  • jpl — JPL planetary ephemeris used to compute Earth’s heliocentric position.
  • ut1_provider — UT1 time scale data for Earth rotation at each epoch.
  • obs_dataset — the full observation dataset to process.
  • observer_fixed_cache — pre-built map from photom::observer::dataset::ObserverId to body-fixed observer state (see BodyFixedObserverCache).
  • cache_velocity — whether to compute and cache the velocity components in the resulting ObserverCentricCache. If false, the velocity fields will be set to None to save computation time and memory.

§Errors

Returns OutfitError if:

§Examples

let centric_cache = build_centric_observer_cache(
    &jpl,
    &ut1_provider,
    &obs_dataset,
    &fixed_cache,
)?;