runtraj.transforms.dry_deposition_survival#

runtraj.transforms.dry_deposition_survival(particles, velocity, surface_layer_depth=50.0)[source]#

Return the fraction of a depositing tracer that survives from each row to the release.

A particle below surface_layer_depth loses tracer at the rate velocity / surface_layer_depth, HYSPLIT’s dry deposition rule. Each row stands for the time step that ends at it, so its fraction includes its own step and every step between it and the release.

Parameters:
  • particles (DataFrame) – The particle table, with particle, age (minutes) and zagl (m) columns and a row at every time step (outdt: 0).

  • velocity (float) – The dry deposition velocity, in m/s.

  • surface_layer_depth (float) – The depth of the layer the tracer deposits from, in meters above ground.

Returns:

The surviving fraction, between 0 and 1, aligned with particles’ index.

Return type:

Series

Raises:

ValueError – If a column is missing or a particle’s rows are more than MAX_STEP_MINUTES apart.

Notes

The fraction is \(\exp(-\sum v_d \, \Delta t / H)\) over the steps spent below \(H\), where a step’s height is its row’s zagl: survival() with the rate \(v_d / H\) below \(H\) and zero above. It works for any species with a constant deposition velocity; use it directly when you want the fraction itself, not a weight.

Examples

>>> import pandas as pd
>>> from runtraj.transforms import dry_deposition_survival
>>> p = pd.DataFrame(
...     {
...         "particle": [1, 1, 1],
...         "age": [-1.0, -2.0, -3.0],
...         "zagl": [10.0, 100.0, 10.0],
...     }
... )
>>> dry_deposition_survival(p, velocity=0.01).round(4).tolist()
[0.9881, 0.9881, 0.9763]