stilt.footprint.footprint_particles#

stilt.footprint.footprint_particles(particles, config, met_files, *, z_top=None)[source]#

Return the particles a footprint under config is made from, with the foot it uses.

The particles are returned as they are when they have foot and pbl_height is unset: the transport model’s own foot, such as HYSPLIT’s. Otherwise PYSTILT computes foot with footprint_depth, pbl_height and pbl_height_min (stilt.footprint.add_foot()), in place of the model’s, and returns a copy with it. The particles passed in are not changed, and the computed foot is stored nowhere: each footprint computes it again.

Parameters:
  • particles (DataFrame) – A particle table, such as sim.particles.

  • config (FootprintConfig) – The footprint settings.

  • met_files (Iterable[str | PathLike[str]]) – The met files the run read, which a particle file records (runtraj.particles.particles_metadata()). They are read only when foot is computed, and must still be at those paths then.

  • z_top (float | None) – The top of the run’s domain, HYSPLIT’s z_top, which pbl_height: richardson reads.

Returns:

The particles, with foot.

Return type:

DataFrame

Raises:

FileNotFoundError – If foot is computed and the run named no met files, or one of them is no longer there.

Examples

>>> meta = runtraj.particles.particles_metadata(
...     sim.particles_path
... )
>>> config = stilt.FootprintConfig(
...     grid=grid, pbl_height="richardson"
... )
>>> particles = stilt.footprint.footprint_particles(
...     sim.particles, config, meta.met_files
... )