Find one-dimensional intensity centre of mass#
Summary#
Find a masked, windowed intensity centroid without assuming a peak shape.
Metadata#
Import path:
modacor.modules.base_modules.find_center_of_mass_1d.FindCenterOfMass1DSource:
src/modacor/modules/base_modules/find_center_of_mass_1d.pyModule ID: FindCenterOfMass1D
Module version: 20260929.1
Keywords: centroid, center of mass, peak, beam centre, 1D
Required data keys#
signal
Modifies#
beam_center: signal, uncertainties, units
centroid_count: signal
centroid_converged: signal
centroid_window_min: signal, units
centroid_window_max: signal, units
Required arguments#
with_processing_keys
Default configuration#
{
"axis_key": "yaw",
"baseline": 0.0,
"baseline_units": null,
"convergence_tolerance": 0.0,
"diagnostic_prefix": "centroid",
"half_width": null,
"mask_key": null,
"maximum_iterations": 5,
"output_key": "beam_center",
"signal_key": "signal",
"width_units": null,
"with_processing_keys": null
}
Argument specification#
Argument |
Type |
Required |
Default |
Dependency role |
Description |
|---|---|---|---|---|---|
|
str |
No |
yaw |
- |
One-dimensional coordinate BaseData key. |
|
float or int |
No |
0.0 |
- |
Scalar baseline in baseline_units, subtracted before clipping negative weights. |
|
str or NoneType |
No |
- |
- |
Units for baseline; defaults to signal units. |
|
float or int |
No |
0.0 |
- |
Absolute centre-change tolerance in width_units. |
|
str |
No |
centroid |
- |
Prefix for count, convergence, and window-bound diagnostic keys. |
|
float or int or NoneType |
No |
- |
- |
Optional physical half-width around the iterated centre. |
|
str or NoneType |
No |
- |
- |
Optional mask key; nonzero values are excluded. |
|
int |
No |
5 |
- |
Maximum number of window-recentring iterations. |
|
str |
No |
beam_center |
- |
Scalar centroid output key. |
|
str |
No |
signal |
- |
Intensity BaseData key. |
|
str or NoneType |
No |
- |
- |
Units for half_width and convergence_tolerance; defaults to axis units. |
|
str or list or NoneType |
Yes |
- |
- |
DataBundle key or keys containing peaks to centre. |
Notes#
The coarse maximum selects a contiguous valid peak region. After optional baseline subtraction, negative intensities are clipped to zero. Signal and coordinate uncertainty components are propagated separately to the scalar centre.