WeightedMeanAction#
- class lsst.analysis.tools.actions.scalar.WeightedMeanAction(*args, **kw)#
Bases:
ScalarActionCalculates the weighted mean of a vector using a second vector as weights.
Attributes Summary
Key of Vector of values to compute the weighted mean of.
Key of Vector of weights.
Methods Summary
__call__(data, **kwargs)Compute a scalar value from keyed data.
Return the schema an
AnalysisActionexpects to be present in the arguments supplied to the __call__ method.Attributes Documentation
- vectorKey#
Key of Vector of values to compute the weighted mean of. (
str)
- weightsKey#
Key of Vector of weights. (
str)
Methods Documentation
- __call__(data: MutableMapping[str, ndarray[tuple[Any, ...], dtype[_ScalarT]] | Scalar | HealSparseMap | Tensor | Mapping], **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.
- getInputSchema() Iterable[tuple[str, type[ndarray[tuple[Any, ...], dtype[_ScalarT]]] | type[Scalar] | type[HealSparseMap] | type[Tensor] | type[Mapping]]]#
Return the schema an
AnalysisActionexpects to be present in the arguments supplied to the __call__ method.Returns#
- result
KeyedDataSchema The schema this action requires to be present when calling this action, keys are unformatted.
- result