FracThreshold

class lsst.analysis.tools.actions.scalar.FracThreshold(*args, **kw)

Bases: ScalarFromVectorAction

Compute the fraction of a distribution above or below a threshold.

The operator is specified as a string, for example, “lt”, “le”, “ge”, “gt” for the mathematical operations <, <=, >=, >. To compute the fraction of elements with values less than a given threshold, use op=”le”.

Attributes Summary

op

Operator name string.

percent

Express result as percentage (bool, default False)

relative_to_median

Calculate threshold relative to the median? (bool, default False)

threshold

Threshold to apply.

use_absolute_value

Calculate threshold after taking absolute value.

vectorKey

Key of Vector to compute statistic from.

Methods Summary

__call__(data, **kwargs)

Compute a scalar value from keyed data.

Attributes Documentation

op

Operator name string. (str, default None)

Allowed values:

'lt'

less than threshold

'le'

less than or equal to threshold

'ge'

greater than or equal to threshold

'gt'

greater than threshold

'None'

Field is optional

percent

Express result as percentage (bool, default False)

relative_to_median

Calculate threshold relative to the median? (bool, default False)

threshold

Threshold to apply. (float)

use_absolute_value

Calculate threshold after taking absolute value. If relative_to_median is true the absolute value will be applied after the median is subtracted (bool, default False)

vectorKey

Key of Vector to compute statistic from. (str)

Methods Documentation

__call__(data: MutableMapping[str, ndarray[Any, dtype[ScalarType]] | Scalar | HealSparseMap | Tensor], **kwargs) Scalar

Compute a scalar value from keyed data.

Parameters:
data

Keyed data to compute a value from.

kwargs

Additional keyword arguments.

Returns:
A scalar value.