act.transform#

Description

QC-aware, bounds-aware transformations (bin-averaging, interpolation, and subsampling) for moving data between coordinate grids, e.g. resampling onto a different time base.

Every transform is available two ways: as a plain function (act.transform.bin_average(...)) that accepts and returns xarray.DataArray objects, and as an xarray.Dataset accessor method (ds.transform.bin_average(...)) that operates on a named variable of a Dataset. The accessor forwards to the plain functions; no logic is duplicated between the two.

The core numeric kernels are JIT-compiled with numba for performance. If numba is unavailable or fails to compile, each kernel transparently falls back to a slower pure-Python implementation and emits a warning; results are numerically equivalent either way.

Classes

Transform(ds)

Xarray Dataset accessor exposing the act.transform kernels.

Functions

bin_average(data, target, dim[, qc, ...])

Bin-average data onto target coordinate values along dim.

interpolate(data, target, dim[, qc, ...])

Bilinearly interpolate data onto target coordinate values along dim.

make_coord(start, stop, freq[, name])

Create a coordinate DataArray for datetimes or numeric steps.

subsample(data, target, dim[, qc, qc_mask, ...])

Nearest-neighbor subsample data onto target coordinate values along dim.

transform_dataset(ds[, target, dim, ...])

Apply a transform to every variable in ds that contains dim.