Indexed Averager#
Summary#
Compute weighted group means from a precomputed integer index map.
Metadata#
Import path:
modacor.modules.base_modules.indexed_averager.IndexedAveragerSource:
src/modacor/modules/base_modules/indexed_averager.pyModule ID: IndexedAverager
Module version: 20261001.1
Keywords: indexed, grouped, weighted average, reduction
Required data keys#
None
Modifies#
configured value: signal, uncertainties, axes
configured axis: signal, uncertainties
bin_id: signal
bin_count: signal
positive_weight_count: signal
sum_weights: signal
effective_sample_size: signal
Required arguments#
None
Default configuration#
{
"axis_key": "Q",
"bin_id_key": "bin_id",
"index_key": "bin_index",
"mask_key": "Mask",
"output_processing_key": null,
"stats_keys": null,
"uncertainty_weight_key": null,
"use_value_uncertainty_weights": false,
"use_value_weights": true,
"value_key": "signal",
"with_processing_keys": null
}
Argument specification#
Argument |
Type |
Required |
Default |
Dependency role |
Description |
|---|---|---|---|---|---|
|
str or NoneType |
No |
Q |
- |
Optional BaseData to average over the same points and attach as the output axis. |
|
str |
No |
bin_id |
- |
Output BaseData key recording the original populated bin IDs. |
|
str |
No |
bin_index |
- |
BaseData containing precomputed integer group indices. |
|
str or NoneType |
No |
Mask |
- |
Optional mask BaseData; true values are excluded when the key is present. |
|
str or NoneType |
No |
- |
- |
Optional distinct output bundle; requires exactly one input bundle. |
|
list or str or NoneType |
No |
- |
- |
Value and/or axis keys receiving scatter-derived SEM and STD; None selects both. |
|
str or NoneType |
No |
- |
- |
Value uncertainty component used for inverse-variance weighting. |
|
bool |
No |
False |
- |
Also weight by inverse variance from one named value uncertainty. |
|
bool |
No |
True |
- |
Use the value BaseData weights for both the value and output axis. |
|
str |
No |
signal |
- |
BaseData value to average. |
|
str or list or NoneType |
No |
- |
- |
ProcessingData key(s) to reduce. |
Notes#
The index map alone determines membership. The optional axis is averaged over the same valid, unmasked observations and weights; bin edges are neither required nor read.