Transforms#

Particle transforms rescale each particle’s foot before a footprint is rasterized (see Particle Weighting (Transforms)). A transform is any object with apply(particles, context); the built-ins are pydantic models whose fields are their config.yaml keys.

Interface#

stilt.ParticleTransform

Anything with apply(particles, context) -> DataFrame.

stilt.TransformContext

What a transform may know about the footprint it is applied for.

Built-in transforms#

stilt.transforms.AveragingKernel

Weight each particle's foot by an averaging kernel at its release coordinate.

stilt.transforms.PressureWeighting

Weight each particle by the fraction of the column's air mass it represents.

stilt.transforms.FirstOrderLifetime

Decay each particle's foot by exp(-age / lifetime).

stilt.transforms.UnresolvedTransform

A transform whose class could not be imported.

Science helpers#

stilt.transforms.release_coordinate

Return each particle's release value of coordinate, indexed by indx.

stilt.transforms.particle_pwf

Derive each particle's release pressure and pressure weight.

stilt.transforms.ak_weights

Interpolate an averaging kernel to each row's particle release coordinate.

Loading and dumping#

stilt.transforms.load_transform

Return a transform for one config entry.

stilt.transforms.dump_transform

Return the config mapping for one transform (inverse of load_transform()).

stilt.transforms.apply_transforms

Apply transforms in order; returns particles itself when there are none.