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 fromphotom::observer::dataset::ObserverIdto body-fixed observer state (seeBodyFixedObserverCache).cache_velocity— whether to compute and cache the velocity components in the resultingObserverCentricCache. Iffalse, the velocity fields will be set toNoneto save computation time and memory.
§Errors
Returns OutfitError if:
- any observation has no associated observer ID
(
OutfitError::ObserverIdIsNone), or - the observer ID is not found in
observer_fixed_cache, or ObserverCentricCache::newfails for any observation epoch.
§Examples
ⓘ
let centric_cache = build_centric_observer_cache(
&jpl,
&ut1_provider,
&obs_dataset,
&fixed_cache,
)?;