stilt.footprint.write_footprint#
- stilt.footprint.write_footprint(path, foot, config=None, metadata=None, geometry_hash=None)[source]#
Write a footprint to a Parquet file that
read_footprint()reads alone.Only the non-zero cells are stored, as
hour(the offset of the time layer from the receptor time),yandx(the cell’s place on the grid), andfootin float32. Every layer is recorded in the metadata, so the dense array reads back with the same shape. The metadata also holds the receptor and the footprint settings.- Parameters:
foot (
DataArray) – The footprint, ascalc_footprint()returns it.config (
FootprintConfig|None) – Settings to record, whose grid the footprint must be on. Defaults to the footprint’s own,foot.stilt.config.metadata (
dict[bytes,bytes] |None) – More file metadata, such as the settings hash.geometry_hash (
str|None) – Hash of the geometry the grid was derived for. Defaults to the footprint’s own,foot.stilt.geometry_hash.
- Returns:
The path written to.
- Return type:
Path|UPath- Raises:
ValueError – If the footprint is not on the grid, the grid has more cells along an axis than
xandycan hold (32,767), or a time layer is not a whole number of hours from the receptor time.