stilt.Footprint.calculate#
- classmethod Footprint.calculate(particles, receptor, config, name='', context=None)[source]#
Calculate a footprint from particles.
The particle transforms in
config.transformsare applied first, in order, so the footprint records exactly the transforms it was made with. The rest follows STILT-R’scalc_footprint. Near the receptor, particle tracks are interpolated to finer times when particles cross more than a grid cell per step. Each particle’sfootis 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, unlessconfig.time_integrateis set.- Parameters:
particles (
DataFrame) – Particle table, such asTrajectories.data, with columnsindx,time(minutes since release),long,lati, andfoot.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 holdingreceptorandname, with no project store.
- Returns:
The footprint.
- Return type:
Self- Raises:
ImportError – If a transform in
configis a settings mapping that could not be imported (as read back byfrom_netcdf()).EmptyFootprintError – If no particle is over the grid.
reasonis"no_particles"when the table is empty and"outside_domain"otherwise.