Subtract remapped one-dimensional background#
Summary#
Remap a 1D background by nearest neighbour or linear interpolation, then subtract it.
Metadata#
Import path:
modacor.modules.base_modules.subtract_interpolated_1d.SubtractInterpolated1DSource:
src/modacor/modules/base_modules/subtract_interpolated_1d.pyModule ID: SubtractInterpolated1D
Module version: 20260929.1
Keywords: subtract, background, nearest, linear, remap, 1D
Required data keys#
signal
Q
Modifies#
signal: signal, uncertainties, weights, units
remap_mask: signal
Required arguments#
with_processing_keys
Default configuration#
{
"axis_key": "Q",
"mask_key": null,
"max_gap": null,
"max_gap_units": null,
"mode": "nearest",
"output_mask_key": "remap_mask",
"output_signal_key": "signal",
"remapped_background_key": null,
"signal_key": "signal",
"with_processing_keys": null
}
Argument specification#
Argument |
Type |
Required |
Default |
Dependency role |
Description |
|---|---|---|---|---|---|
|
str |
No |
Q |
- |
One-dimensional coordinate key in both bundles. |
|
str or NoneType |
No |
- |
- |
Optional input mask key used in both bundles; nonzero means invalid. |
|
float or int or NoneType |
No |
- |
- |
Optional maximum linear-interpolation bracket width; unsupported in nearest mode. |
|
str or NoneType |
No |
- |
- |
Units of max_gap; defaults to the sample axis units. |
|
str |
No |
nearest |
- |
Remapping mode: nearest or linear. |
|
str or NoneType |
No |
remap_mask |
- |
Optional output key marking targets invalid for subtraction. |
|
str |
No |
signal |
- |
Sample-bundle key receiving the subtracted signal. |
|
str or NoneType |
No |
- |
- |
Optional sample-bundle key receiving the remapped background. |
|
str |
No |
signal |
- |
BaseData signal key in both bundles. |
|
list |
Yes |
- |
- |
Two processing keys: sample/minuend then background/subtrahend. |
Notes#
Nearest mode always chooses the nearest valid background coordinate and has no tolerance setting. Neither mode extrapolates: sample points outside the background domain are invalidated. max_gap applies only to linear bracket width. Linear uncertainties are propagated from interpolation coefficients before BaseData subtraction.