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_depthloses tracer at the ratevelocity / 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:
- Returns:
The surviving fraction, between 0 and 1, aligned with
particles’ index.- Return type:
- Raises:
ValueError – If a column is missing or a particle’s rows are more than
MAX_STEP_MINUTESapart.
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]