hmf.core.fits.evaluate_fsigma¶
- hmf.core.fits.evaluate_fsigma(model: FittingFunction, inputs: FitInputs, *, policy: Literal['ignore', 'warn', 'mask', 'raise'] = 'ignore', owner: object | None = None) FSigmaResult[source]¶
Evaluate a fit, applying a domain policy to its calibration domain.
The inputs are a
FitInputs: plain arrays in canonical units, built byFittingFunction.inputs_from_arrays()(by code such as a mass-functionStage, which already has them) or byFittingFunction.inputs()from Quantities. See “Evaluating a fit” in themodule documentation.The valid domain always raises (see
FittingFunction.fsigma()); the policy applies to the calibration domain only:"ignore"return \(f(\sigma)\) everywhere;
"warn"also emit an
HMFExtrapolationWarningif any value is outside: once perowner(seewarn_once()), e.g. theStagethat evaluates the fit;"mask"return NaN outside;
"raise"raise
DomainErrorif any value is outside.
- Parameters:
model – The fit.
inputs – The inputs. Those needed to check the calibration domain (see
FittingFunction.domain_inputs()) must be given.policy – What to do outside the calibration domain.
owner – The object the
"warn"policy warns once for (seeapply_domain_policy()). IfNone, the fitmodel.
- Returns:
\(f(\sigma)\) and the calibration mask.
- Return type:
- Raises:
ValueError – If an input needed by the fit or by either domain is missing.
DomainError – If any input is outside the valid domain (whatever the policy), or outside the calibration domain with
policy="raise".