finam.adapters#

Adapters to transform or interpolate data when passed between components.

See also book chapter Known FINAM modules for a list of other adapters that are not included in the core package.

Base adapters#

Callback(callback[, units])

Transform data using a callback.

Scale(scale)

Scales the input.

ValueToGrid([grid, mask])

Convert a scalar value to a Matrix filled with that value.

GridToValue(func)

Convert a matrix to a scalar value using an aggregation function, e.g. numpy.mean.

Mask adapters#

Clip([xlim, ylim, zlim])

Clip grid to bounds.

Masking([mask, fill_value])

Mask data.

UnMasking([fill_value])

Unmask data.

Probe adapters#

CallbackProbe(callback)

Probe data by calling a callback.

Regridding adapters#

RegridNearest([in_grid, out_grid, out_mask, ...])

Regrid data between two grid specifications with nearest neighbour interpolation.

RegridLinear([in_grid, out_grid, out_mask, ...])

Regrid data between two grid specifications with linear interpolation.

ToCRS(crs[, axes_attributes, axes_names, ...])

Convert Grid to another CRS.

ToUnstructured()

Convert Grid to an unstructured one.

Statistics adapters#

Histogram(lower, upper[, bins, density])

Calculates a histogram over grid values.

Time adapters#

LinearTime()

Linear time interpolation.

NextTime()

Time interpolation providing the next future value.

PreviousTime()

Time interpolation providing the newest past value.

StackTime()

Stacks all incoming data since the last push.

StepTime([step])

Step-wise time interpolation.

AvgOverTime([step])

Aggregates data over time to form the temporal average over the last pull time step.

SumOverTime([step, per_time, initial_interval])

Aggregates data over time to form the temporal sum (area under curve) over the last pull time step.

DelayFixed(delay)

Delays/offsets the request time by subtracting a fixed offset.

DelayToPush()

Delays/offsets the request time to the last push time if out of range.

DelayToPull([steps, additional_delay])

Delays/offsets the request time to a previous pull time.

TimeCachingAdapter()

Abstract base class for time handling and caching adapters.