openghg_inversions.inversion_data.getters#

Functions for retrieving data from an OpenGHG store.

These functions customise the behavior of get_flux, get_footprint, etc.

  • get_flux_data calls get_flux after adjusting the start date to begin at the start of a year or month; if nothing is found, then the start date restriction is dropped and the most recent result found is used.

TODO: add more docs (and add more detailed docstrings)

openghg_inversions.inversion_data.getters.adjust_flux_start_date(start_date: str, species: str, source: str, domain: str, store: str | None = None) Timestamp#

Adjusts the flux start_date to align with the flux data’s temporal resolution.

openghg_inversions.inversion_data.getters.get_flux_data(sources: list[str], species: str, domain: str, start_date: str, end_date: str, store: str | None = None) dict[str, FluxData]#

Get flux data and add to dict.

openghg_inversions.inversion_data.getters.get_footprint_data(domain: str, start_date: str, end_date: str, model: str | None, met_model: str | None, fp_species: str | None, fp_height: str | None, site: str | None = None, platform: str | None = None, averaging_period: str | None = None, obs_data: ObsData | None = None, stores: str | None | Iterable[str | None] = None) FootprintData | None#

Try to retrieve Footprint data from given stores.

If fp_height is ‘auto’, then get_footprint_to_match is used to search for a footprint matching the given ObsData. Otherwise, get_footprint is used.

openghg_inversions.inversion_data.getters.get_footprint_to_match(obs: ObsData, domain: str, model: str | None = None, platform: str | None = None, start_date: str | None = None, end_date: str | None = None, met_model: str | None = None, fp_species: str | None = None, fp_height: str | None = None, store: str | None = None, averaging_period: str | None = None, tolerance: float = 10.0) FootprintData#
openghg_inversions.inversion_data.getters.get_fp_indexer(obs: Dataset, fp: Dataset, averaging_period: str)#
openghg_inversions.inversion_data.getters.get_obs_data(site: str, species: str, inlet: str | None, start_date: str, end_date: str, domain: str | None = None, platform: str | None = None, satellite: str | None = None, max_level: int | None = None, data_level: str | None = None, average: str | None = None, instrument: str | None = None, calibration_scale: str | None = None, stores: str | None | Iterable[str | None] = None, keep_variables: list | None = None) ObsData | None#

Try to retrieve obs. data from listed stores.