stilt.observations.background#

stilt.observations.background(particles, field, *, transforms=(), context=None)[source]#

Return the background mole fraction at a receptor.

The background is the field at each particle’s endpoint, averaged over the particles with the footprint’s weights.

Parameters:
  • particles (DataFrame) – The simulation’s particle table (sim.trajectories.data).

  • field (DataArray | Series) – The background field (see particle_background() for its layout), or one value per particle that you sampled yourself, as a Series indexed by indx. For example, lair’s CarbonTracker.sample on sim.trajectories.endpoints().

  • transforms (Sequence[Any]) – The footprint’s particle transforms (sim.config.transforms), so the background is weighted like the footprint and adds to its enhancement. A tower receptor has none.

  • context (TransformContext | None) – Context to apply the transforms with (sim.transform_context()). Required by an averaging kernel read from a table.

Return type:

Background

Notes

Without transforms the value is the mean over particles. With pressure weighting the weights sum to the fraction of the atmosphere’s mass inside the column, (p_sfc - p_top) / p_sfc, the same fraction the enhancement covers. Add the part of the column above its top from the same field.