DataSimulFit

class sherpa.data.DataSimulFit(name: str, datasets: Sequence[Data], numcores: int = 1)[source] [edit on github]

Bases: NoNewAttributesAfterInit

Store multiple data sets.

This class lets multiple data sets be treated as a single dataset by concatenation. That is, if two data sets have lengths n1 and n2 then they can be considered as a single data set of length n1 + n2.

Parameters:
  • name (str) – The name for the collection of data.

  • datasets (sequence of Data objects) – The datasets to be stored; there must be at least one. They are assumed to behave as sherpa.data.Data objects, but there is no check for this condition.

datasets
Type:

sequence of Data

Examples

>>> d1 = Data1D('d1', [1, 2, 3], [10, 12, 15])
>>> d2 = Data1D('d2', [1, 2, 5, 7], [4, 15, 9, 24])
>>> dall = DataSimulFit('comb', (d1, d2))
>>> yvals, _, _ = dall.to_fit()
>>> print(yvals)
[10 12 15  4 15  9 24]

Methods Summary

eval_model_to_fit(modelfuncs)

to_fit([staterrfunc])

to_plot([yfunc, staterrfunc])

Methods Documentation

eval_model_to_fit(modelfuncs: Sequence[Callable[[...], Sequence[float] | ndarray]]) ndarray[source] [edit on github]
to_fit(staterrfunc: Callable[[...], Sequence[float] | ndarray] | None = None) tuple[ndarray, ndarray | None, ndarray | None][source] [edit on github]
to_plot(yfunc=None, staterrfunc: Callable[[...], Sequence[float] | ndarray] | None = None)[source] [edit on github]