get_error
- sherpa.ui.get_error(id: IdType | None = None, filter=False)
Return the errors on the dependent axis of a data set.
The function returns the total errors (a quadrature addition of the statistical and systematic errors) on the values (dependent axis) of a data set. The individual components can be retrieved with the
get_staterrorandget_syserrorfunctions.- Parameters:
id (int, str, or None, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by
get_default_id.filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is
False.
- Returns:
errors – The error for each data point, formed by adding the statistical and systematic errors in quadrature. The size of this array depends on the
filterargument.- Return type:
array
- Raises:
sherpa.utils.err.IdentifierErr – If the data set does not exist.
See also
get_errorReturn the errors on the dependent axis of a data set.
get_indepReturn the independent axis of a data set.
get_staterrorReturn the statistical errors on the dependent axis of a data set.
get_syserrorReturn the systematic errors on the dependent axis of a data set.
list_data_idsList the identifiers for the loaded data sets.
Notes
The default behavior is to not apply any filter defined on the independent axes to the results, so that the return value is for all points (or bins) in the data set. Set the
filterargument toTrueto apply this filter.Examples
Return the error values for the default data set, ignoring any filter applied to it:
>>> err = get_error()
Ensure that the return values are for the selected (filtered) points in the default data set (the return array may be smaller than in the previous example):
>>> err = get_error(filter=True)
Find the errors for the “core” data set:
>>> err = get_error('core', filter=True)