Scale 1D curve to reference (compute-only)#
Summary#
Compute scale factor between two 1D curves using robust least squares.
Metadata#
Module ID: FindScaleFactor1D
Module path: /home/runner/work/MoDaCor/MoDaCor/src/modacor/modules/base_modules/find_scale_factor1d.py
Module version: 20251212.2
Keywords: scale, calibration, 1D
Required data keys#
signal
Modifies#
scale_factor: signal, uncertainties, units
scale_background: signal, uncertainties, units
Required arguments#
None
Default configuration#
{
"background_output_key": "scale_background",
"fit_background": false,
"fit_max_val": null,
"fit_min_val": null,
"fit_val_units": null,
"independent_axis_key": "Q",
"interpolation_kind": "linear",
"require_overlap": true,
"robust_fscale": 1.0,
"robust_loss": "huber",
"scale_output_key": "scale_factor",
"signal_key": "signal",
"use_basedata_weights": true
}
Argument specification#
Argument |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
str |
No |
scale_background |
BaseData key to store the fitted background output. |
|
bool |
No |
False |
Whether to fit a constant background offset. |
|
float or int or NoneType |
No |
- |
Maximum x-value for the fit (in fit_val_units). |
|
float or int or NoneType |
No |
- |
Minimum x-value for the fit (in fit_val_units). |
|
str or NoneType |
No |
- |
Units for fit_min_val/fit_max_val if provided. |
|
str |
No |
Q |
BaseData key for the independent axis. |
|
str |
No |
linear |
Interpolation kind passed to scipy/numpy interpolation. |
|
bool |
No |
True |
Require overlapping x-range between reference and work data. |
|
float or int |
No |
1.0 |
Robust loss scale parameter. |
|
str |
No |
huber |
Robust loss function name for the fit. |
|
str |
No |
scale_factor |
BaseData key to store the scale factor output. |
|
str |
No |
signal |
BaseData key for the dependent variable signal. |
|
bool |
No |
True |
Use BaseData weights when fitting. |