arpes.fits.utilities.broadcast_model
- arpes.fits.utilities.broadcast_model(model_cls: Union[type, List[type], Tuple[type]], data: Union[xarray.core.dataarray.DataArray, xarray.core.dataset.Dataset], broadcast_dims, params=None, progress=True, weights=None, safe=False, prefixes=None, window=None, parallelize=None, trace: Callable = None)[source]
Perform a fit across a number of dimensions.
Allows composite models as well as models defined and compiled through strings.
- Parameters
model_cls – The model specification
data – The data to curve fit
broadcast_dims – Which dimensions of the input should be iterated across as opposed to fit across
params – Parameter hints, consisting of plain values or arrays for interpolation
progress – Whether to show a progress bar
weights – Weights to apply when curve fitting. Should have the same shape as the input data
safe – Whether to mask out nan values
window – A specification of cuts/windows to apply to each curve fit
parallelize – Whether to parallelize curve fits, defaults to True if unspecified and more than 20 fits were requested
trace – Controls whether execution tracing/timestamping is used for performance investigation
- Returns
“results”: Containing an xr.DataArray of the lmfit.model.ModelResult instances
”residual”: The residual array, with the same shape as the input
”data”: The original data used for fitting
”norm_residual”: The residual array normalized by the data, i.e. the fractional error
- Return type
An xr.Dataset containing the curve fitting results. These are data vars