runtraj.transforms.Oxidation#
- class runtraj.transforms.Oxidation(*, kind: Literal['oxidation'] = 'oxidation', a: Annotated[float, Gt(gt=0)], e_over_r: float = 0.0, oxidant: float | str, variable: str | None = None, coordinate: str = 'pres') None[source]#
Transform that weighs each row by the tracer that survives a reaction with an oxidant.
Use it for a species lost mainly to one reaction whose rate you know, such as CO, ethane, or methane with OH. The rate at each row is
k(T) [X], with the rate constantk = a exp(-e_over_r / T)and the oxidant’s number density[X], and each row’sweightis multiplied bysurvival()of it. Give[X]as a constant or as a gridded field in a netCDF file, sampled at each row’s longitude, latitude, time andcoordinate.The loss must not depend on the tracer itself. Methane’s lifetime against OH is about nine years, so over a few days of trajectory it changes a weight by less than 0.1 %; the transform matters for shorter lived species and long trajectories.
Methods#
|
Return the particles with |
|
Return what is wrong with the oxidant file, for a stage's check to report. |
|
Return the oxidant field, read from its file. |
|
Return the loss rate at each row, in s⁻¹. |