ess.snspowder.powgen.peaks.fit_vanadium_peaks#

ess.snspowder.powgen.peaks.fit_vanadium_peaks(data, *, peak_estimates=None, windows=None, background=None, peak=None, fit_parameters=None, fit_requirements=None)[source]#

Fit coherent scattering peaks of vanadium.

This function wraps scippneutron.peaks.fit_peaks() and provides default parameters for vanadium at POWGEN.

Parameters:
  • data (DataArray) – A 1d data array where data.data is the dependent variable and data.coords[data.dim] is the independent variable for the fit. Must be 1-dimensional and not binned.

  • peak_estimates (Optional[Variable], default: None) – Initial estimates of peak locations. A peak will be fitted for each estimate. Must be a 1d variable with dimension data.dim. If None, estimates are derived using theoretical_vanadium_dspacing().

  • windows (Optional[Variable], default: None) –

    If a scalar, the size of fit windows. A window is constructed for each peak estimate centered on the estimate with a width equal to windows (adjusted to the data range and to maintain a separation between peaks, see scippneutron.peaks.FitParameters.neighbor_separation_factor).

    If a 2d array, the windows for each peak. Must have sizes {data.dim: len(data), 'range': 2} where windows['range', 0] and windows['range', 1] are the lower and upper bounds of the fit windows, respectively. The windows are not adjusted automatically in this case.

    Defaults to sc.scalar(0.02, unit='angstrom').

  • background (Union[Model, str, Iterable[Model], Iterable[str], None], default: None) – The background model or models. Defaults to ('linear', 'quadratic'). That is, a fit with a linear background is attempted, and if the fit fails, a quadratic background is tried.

  • peak (Union[Model, str, Iterable[Model], Iterable[str], None], default: None) – The peak model or models. Defaults to 'gaussian'.

  • fit_parameters (Optional[FitParameters], default: None) – Parameters for the fit not otherwise listed as function arguments.

  • fit_requirements (Optional[FitRequirements], default: None) – Constraints on the fit result.

Returns:

list[FitResult] – A FitResult for each peak.