CalcBinnedCompletenessAction

class lsst.analysis.tools.actions.keyedData.CalcBinnedCompletenessAction(*args, **kw)

Bases: KeyedDataAction

Calculate completeness and purity in a single magnitude bin.

Completeness is the fraction of matched objects with reference magnitudes within the bin limits, while purity is the fraction of matched objects with measured magnitudes within the bin limits.

Both statistics are also computed separately for objects that are considered “good” and “bad” matches, given a boolean field key.

Attributes Summary

key_mask_ref

Key for mask to apply for reference objects in completeness (str, default None)

key_mask_target

Key for mask to apply for target objects in purity (str, default None)

key_match_distance

Key for column with distance between matched objects (str, default 'match_distance')

key_matched_class

Key for boolean vector (True if matched objects have the same class as their ref match) (str, default 'matched_class')

name_completeness

name_completeness_bad_match

name_completeness_good_match

name_count

name_count_ref

name_count_target

name_mask_ref

name_mask_target

name_prefix

Field name to append statistic names to (str, default '')

name_purity

name_purity_bad_match

name_purity_good_match

name_range_maximum

name_range_minimum

name_suffix

Field name to append to statistic names (str, default '')

selector_range_ref

Range selector for reference objects (RangeSelector, default <class 'lsst.analysis.tools.actions.vector.selectors.RangeSelector'>)

selector_range_target

Range selector for measured objects (RangeSelector, default <class 'lsst.analysis.tools.actions.vector.selectors.RangeSelector'>)

Methods Summary

__call__(data[, band, mask])

Compute completeness and purity metrics.

getFormattedOutputKeys([band])

Return the mapping from unformatted output schema keys to formatted.

getInputSchema(**kwargs)

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

getOutputSchema()

Return the schema an AnalysisAction will produce, if the __call__ method returns KeyedData, otherwise this may return None.

name_mag_completeness(name_threshold)

validate()

Validate the Config, raising an exception if invalid.

Attributes Documentation

key_mask_ref

Key for mask to apply for reference objects in completeness (str, default None)

key_mask_target

Key for mask to apply for target objects in purity (str, default None)

key_match_distance

Key for column with distance between matched objects (str, default 'match_distance')

key_matched_class

Key for boolean vector (True if matched objects have the same class as their ref match) (str, default 'matched_class')

name_completeness
name_completeness_bad_match
name_completeness_good_match
name_count
name_count_ref
name_count_target
name_mask_ref
name_mask_target
name_prefix

Field name to append statistic names to (str, default '')

name_purity
name_purity_bad_match
name_purity_good_match
name_range_maximum
name_range_minimum
name_suffix

Field name to append to statistic names (str, default '')

selector_range_ref

Range selector for reference objects (RangeSelector, default <class 'lsst.analysis.tools.actions.vector.selectors.RangeSelector'>)

selector_range_target

Range selector for measured objects (RangeSelector, default <class 'lsst.analysis.tools.actions.vector.selectors.RangeSelector'>)

Methods Documentation

__call__(data: MutableMapping[str, ndarray[Any, dtype[_ScalarType_co]] | Scalar | HealSparseMap | Tensor | Mapping], band: str | None = None, mask=None, **kwargs: Any) MutableMapping[str, ndarray[Any, dtype[_ScalarType_co]] | Scalar | HealSparseMap | Tensor | Mapping]

Compute completeness and purity metrics.

Parameters:
data

Input data to read form.

band

The name of the band, if any.

mask

An additional mask to select on before computing statistics.

kwargs

Additional keyword arguments that are unused.

Returns:
data

Dictionary with formatted keys:

"name_count"

The number of objects of either type (reference or target) within the bin (and mask).

"name_count_ref"

The number of reference objects within the bin (and mask).

"name_count_target"

The number of target (measured) objects within the bin (and mask).

"name_completeness"

The completeness within the bin.

"name_completeness_bad_match"

The completeness of objects considered bad matches.

"name_completeness_good_match"

The completeness of objects considered good matches.

"name_purity"

The purity within the bin.

"name_purity_bad_match"

The purity of objects considered bad matches.

"name_purity_good_match"

The purity of objects considered good matches.

"name_range_maximum"

The maximum magnitude of the bin selector.

"name_range_minimum"

The minimum magnitude of the bin selector.

getFormattedOutputKeys(band: str | None = None, **kwargs: Any) dict[str, str]

Return the mapping from unformatted output schema keys to formatted.

Parameters:
band

The name of the band, if any.

kwargs

Additional keyword arguments that are unused.

Returns:
resultdict[str, str]

A dict with formatted key values for unformatted keys.

getInputSchema(**kwargs) Mapping]]]

Return the schema an AnalysisAction expects to be present in the arguments supplied to the __call__ method.

Returns:
resultKeyedDataSchema

The schema this action requires to be present when calling this action, keys are unformatted.

getOutputSchema() Mapping]]]

Return the schema an AnalysisAction will produce, if the __call__ method returns KeyedData, otherwise this may return None.

Returns:
resultKeyedDataSchema or None

The schema this action will produce when returning from call. This will be unformatted if any templates are present. Should return None if action does not return KeyedData.

name_mag_completeness(name_threshold: str)
validate()

Validate the Config, raising an exception if invalid.

Raises:
lsst.pex.config.FieldValidationError

Raised if verification fails.

Notes

The base class implementation performs type checks on all fields by calling their validate methods.

Complex single-field validation can be defined by deriving new Field types. For convenience, some derived lsst.pex.config.Field-types (ConfigField and ConfigChoiceField) are defined in lsst.pex.config that handle recursing into subconfigs.

Inter-field relationships should only be checked in derived Config classes after calling this method, and base validation is complete.