stilt.footprint.open_footprints#

stilt.footprint.open_footprints(paths, *, workers=None)[source]#

Open stored footprints as one dataset, stacked on the hour from each receptor’s time.

Footprints of many receptors are stacked by their hour offset rather than by absolute time, so receptors at different times share one hour axis. Only the files’ metadata is read here. The values are read with dask when they are used, a block of receptors from one date folder at a time. stilt.Project.footprints() opens a selection of a project’s footprints this way.

Parameters:
  • paths (Iterable[str | Path | UPath]) – Footprint files from an output directory, all made with the same settings (one variant’s). URLs read from an object store.

  • workers (int | None) – Threads that read the files’ metadata. Defaults to the CPUs this process may use, at most 8.

Returns:

foot with dims (receptor, hour, lat, lon) (y and x on a projected grid), as float32 like the stored values. hour is the start of each layer, in hours after the receptor time, so a backward run’s first hour is -1. The time coordinate, with dims (receptor, hour), is that start as a date and time. A receptor whose footprint is empty has no row; attrs["empty"] lists them.

Return type:

Dataset

Raises:

ValueError – If there are no files, or they were made with different settings.

Examples

>>> ds = open_footprints(
...     sorted(folder.glob("date=2024-07-*/*.parquet"))
... )
>>> ds.foot.sum("hour").mean("receptor").plot()