stilt.read_footprint#

stilt.read_footprint(path, *, chunks=None)[source]#

Read a footprint file, NetCDF or the Parquet files PYSTILT stores.

Each file holds its receptor and settings, so it needs nothing else.

Parameters:
  • path (str | Path | UPath) – A .nc file written by foot.stilt.to_netcdf, or a footprint file from an output directory.

  • chunks (Any | None) – For a NetCDF file, passed to xarray.open_dataset() to load the data lazily with dask.

Returns:

The footprint, or None for an empty one (no particle reached the grid). A footprint from an output directory also says which PYSTILT version made it (attrs["stilt_version"]) and the settings hash of the particles it was made from (attrs["stilt_particles_hash"]), which foot.stilt.to_netcdf keeps.

Return type:

DataArray | None

Examples

>>> foot = stilt.read_footprint(sim.footprint_path)
>>> foot.stilt.receptor