ess.reduce.live.roi.ROIFilter#

class ess.reduce.live.roi.ROIFilter(indices, norm=1.0)[source]#

Filter for selecting a region of interest (ROI).

__init__(indices, norm=1.0)[source]#

Create a new ROI filter.

Parameters:

indices (Variable | DataArray) – Variable with indices to filter. The indices facilitate selecting a 2-D ROI in a projection of a 3-D dataset. Typically the indices are given by a 2-D array. Each element in the array may correspond to a single index (when there is no projection) or a list of indices that were projected into an output pixel.

Methods

__init__(indices[, norm])

Create a new ROI filter.

apply(data)

Apply the ROI filter to data.

set_roi_from_intervals(intervals)

Set the ROI from (typically 1 or 2) intervals.

apply(data)[source]#

Apply the ROI filter to data.

The returned scale factor can be used to handle filtering via a projection, to take into account that fractions of source data point contribute to a data point in the projection.

Parameters:

data (TypeVar(T, DataArray, Variable)) – Data to filter.

Returns:

tuple[TypeVar(T, DataArray, Variable), Variable] – Filtered data and scale factor.

set_roi_from_intervals(intervals)[source]#

Set the ROI from (typically 1 or 2) intervals.

Return type:

None