stilt.Footprint.calculate#

classmethod Footprint.calculate(particles, receptor, config, name='', context=None)[source]#

Calculate a footprint from particles.

The particle transforms in config.transforms are applied first, in order, so the footprint records exactly the transforms it was made with. The rest follows STILT-R’s calc_footprint. Near the receptor, particle tracks are interpolated to finer times when particles cross more than a grid cell per step. Each particle’s foot is added to the cell it is in, and each time step is smoothed with a Gaussian kernel that widens with the particles’ spread and age. The sum is divided by the number of particles and binned by hour, unless config.time_integrate is set.

Parameters:
  • particles (DataFrame) – Particle table, such as Trajectories.data, with columns indx, time (minutes since release), long, lati, and foot.

  • receptor (Receptor) – Receptor the particles were released from.

  • config (FootprintConfig) – Grid, smoothing, and particle transforms.

  • name (str) – Name of the footprint, usually the variant name.

  • context (TransformContext | None) – Passed to every transform. Defaults to one holding receptor and name, with no project store.

Returns:

The footprint.

Return type:

Self

Raises:
  • ImportError – If a transform in config is a settings mapping that could not be imported (as read back by from_netcdf()).

  • EmptyFootprintError – If no particle is over the grid. reason is "no_particles" when the table is empty and "outside_domain" otherwise.