stilt.footprint.add_foot#

stilt.footprint.add_foot(particles, met_files, footprint_depth, pbl_height=None, pbl_height_min=0.0, z_top=None)[source]#

Add foot, each particle’s sensitivity to surface fluxes, for a transport model that writes only positions.

A particle below the depth surface fluxes are mixed through, footprint_depth times mlht (or footprint_depth meters when it is above 1), takes up the flux for the time it spends there. Its foot for one output step is that time divided by the air in the layer, STILT’s footprint (Lin et al., 2003):

foot = M · t / (ρ̄ · depth)

in ppm per (µmol m⁻² s⁻¹), with M = 0.02897 kg mol⁻¹, the molar mass of dry air, t the time in seconds, and ρ̄ the mean air density below the depth. ρ̄ · depth, the mass of air in the layer, is the drop in pressure from the ground to the depth over g, from the met files under the particle. The time is samt when the table has it. Otherwise the particle counts for the whole step when it is below the depth at the end of the step, and not at all when it is above. A step is the time since the particle’s previous row, or since its release for its first row, so a release row at age = 0 gets zero.

The mixed-layer height comes from pbl_height. Unset, a mlht column is used as it is, with samt; without one, the met’s boundary-layer height is sampled. Set, mlht is replaced with the height it names, and samt, which counts the minutes below the model’s own layer, is not used. Every model moved its particles with its own mixed layer, so a height found here can differ from the one the particles were moved with.

HYSPLIT computes foot itself in STILT mode, the same way in its turbulence steps. Validation says how far a footprint made from this foot is from one made from HYSPLIT’s. The footprint stage calls it when it needs a foot the particles do not have (stilt.footprint.footprint_particles()), and stores it nowhere.

Parameters:
  • particles (DataFrame) – Particle table with time, the release time plus age minutes. A mlht column (m above ground) is used as it is unless pbl_height is set.

  • met_files (Iterable[str | PathLike[str]]) – ARL met files that cover the particles’ times, such as the files the run read. They are read on their own levels, which start at the ground.

  • footprint_depth (float) – Height that surface fluxes are mixed through (VEGHT in HYSPLIT and STILT-R): a fraction of the mixed-layer height when 1 or less, else meters above ground.

  • pbl_height (str | float | None) – The mixed-layer height: "met" samples the met’s PBLH (stilt.sampling.sample_met()), "richardson" finds it from the met’s profile as HYSPLIT’s kmixd: 3 does (stilt.sampling.calc_pbl_height()), and a number is a fixed height in meters. None uses the particles’ mlht, or the met’s PBLH when they have none.

  • pbl_height_min (float) – Lowest mixed-layer height in meters, for a height found here rather than the particles’ own, as kmix0 is for HYSPLIT.

  • z_top (float | None) – The top of a HYSPLIT run’s domain in meters, which sets the internal levels "richardson" works on, as in that run. None uses HYSPLIT’s default, 25000 m. Only "richardson" reads it.

Returns:

A copy of particles with foot, and mlht when it was found here. A row off the met’s grid gets NaN, which no footprint counts.

Return type:

DataFrame

Raises:

ValueError – If particles has a foot column already, has no time column, or has a row outside the files’ times.

Examples

>>> particles = sim.particles.drop(columns="foot")
>>> meta = runtraj.particles.particles_metadata(
...     sim.particles_path
... )
>>> stilt.footprint.add_foot(
...     particles, meta.met_files, footprint_depth=0.5
... )