Skip to content

scalar_correction_filter

ScalarCorrectionFilter

Bases: DataFilter

A data filter to make values smaller than a certain threshold larger than said threshold. This is done by adding a correction value (often the period) to each scalar until its value is above the threshold.

This can be used to make negative scalar values positive.

correction_value = correction_value instance-attribute

threshold = threshold instance-attribute

__init__(threshold, correction_value)

Parameters:

Name Type Description Default
threshold float

The threshold under which all values are corrected.

required
correction_value float

The value added N times to each scalar under the threshold.

required

apply(scalars)

Moves values below the threshold to above the threshold by adding the correction value N times.

Parameters:

Name Type Description Default
scalars ndarray

array of scalars

required

Returns:

Name Type Description
scalars ndarray

updated array of scalars