DataND

class sherpa.data.DataND(name, indep, dep, staterror=None, syserror=None)[source]

Bases: sherpa.data.Data

Base class for Data1D, Data2D, etc.

Attributes Summary

filter Filter for dependent variable
mask Mask array for dependent variable

Methods Summary

apply_filter(data)
eval_model(modelfunc)
eval_model_to_fit(modelfunc)
get_dep([filter])
get_dims()
get_error([filter, staterrfunc]) Return the total error on the dependent variable.
get_img([yfunc]) Return dependent variable as an image
get_imgerr([yfunc]) Return total error in dependent variable as an image
get_indep([filter]) Return the independent axes of a data set.
get_staterror([filter, staterrfunc]) Return the statistical error on the dependent axis of a data set.
get_syserror([filter]) Return the statistical error on the dependent axis of a data set.
get_x([filter]) Return linear view of independent axis/axes
get_x0([filter]) Return first dimension in 2-D view of independent axis/axes
get_x0label() Return label for first dimension in 2-D view of independent axis/axes
get_x1([filter]) Return second dimension in 2-D view of independent axis/axes
get_x1label() Return label for second dimension in 2-D view of independent axis/axes
get_xerr([filter]) Return linear view of bin size in independent axis/axes
get_xlabel() Return label for linear view of independent axis/axes
get_y([filter, yfunc]) Return dependent axis in N-D view of dependent variable
get_yerr([filter, staterrfunc]) Return errors in dependent axis in N-D view of dependent variable
get_ylabel([yfunc]) Return label for dependent axis in N-D view of dependent variable
ignore(\*args, \*\*kwargs)
notice(mins, maxes, axislist[, ignore])
set_dep(val) Set the dependent variable values
to_contour([yfunc])
to_fit([staterrfunc])
to_guess()
to_plot([yfunc, staterrfunc])

Attributes Documentation

filter

Filter for dependent variable

mask

Mask array for dependent variable

Methods Documentation

apply_filter(data)
eval_model(modelfunc)
eval_model_to_fit(modelfunc)
get_dep(filter=False)[source]
get_dims()
get_error(filter=False, staterrfunc=None)

Return the total error on the dependent variable.

Parameters:
  • filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is False.
  • staterrfunc (function) – If no statistical error has been set, the errors will be calculated by applying this function to the dependent axis of the data set.
Returns:

axis – The error for each data point, formed by adding the statistical and systematic errors in quadrature.

Return type:

array or None

See also

get_dep()
Return the independent axis of a data set.
get_staterror()
Return the statistical errors on the dependent axis of a data set.
get_syserror()
Return the systematic errors on the dependent axis of a data set.
get_img(yfunc=None)

Return dependent variable as an image

get_imgerr(yfunc=None)

Return total error in dependent variable as an image

get_indep(filter=False)

Return the independent axes of a data set.

Parameters:filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is False.
Returns:axis – The independent axis values for the data set. This gives the coordinates of each point in the data set.
Return type:tuple of arrays

See also

get_dep()
Return the dependent axis of a data set.
get_staterror(filter=False, staterrfunc=None)

Return the statistical error on the dependent axis of a data set.

Parameters:
  • filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is False.
  • staterrfunc (function) – If no statistical error has been set, the errors will be calculated by applying this function to the dependent axis of the data set.
Returns:

axis – The statistical error for each data point. A value of None is returned if the data set has no statistical error array and staterrfunc is None.

Return type:

array or None

See also

get_error()
Return the errors on the dependent axis of a data set.
get_indep()
Return the independent axis of a data set.
get_syserror()
Return the systematic errors on the dependent axis of a data set.
get_syserror(filter=False)

Return the statistical error on the dependent axis of a data set.

Parameters:filter (bool, optional) – Should the filter attached to the data set be applied to the return value or not. The default is False.
Returns:axis – The systematic error for each data point. A value of None is returned if the data set has no systematic errors.
Return type:array or None

See also

get_error()
Return the errors on the dependent axis of a data set.
get_indep()
Return the independent axis of a data set.
get_staterror()
Return the statistical errors on the dependent axis of a data set.
get_x(filter=False)

Return linear view of independent axis/axes

get_x0(filter=False)

Return first dimension in 2-D view of independent axis/axes

get_x0label()

Return label for first dimension in 2-D view of independent axis/axes

get_x1(filter=False)

Return second dimension in 2-D view of independent axis/axes

get_x1label()

Return label for second dimension in 2-D view of independent axis/axes

get_xerr(filter=False)

Return linear view of bin size in independent axis/axes

get_xlabel()

Return label for linear view of independent axis/axes

get_y(filter=False, yfunc=None)

Return dependent axis in N-D view of dependent variable

get_yerr(filter=False, staterrfunc=None)

Return errors in dependent axis in N-D view of dependent variable

get_ylabel(yfunc=None)

Return label for dependent axis in N-D view of dependent variable

ignore(*args, **kwargs)
notice(mins, maxes, axislist, ignore=False)
set_dep(val)[source]

Set the dependent variable values

to_contour(yfunc=None)
to_fit(staterrfunc=None)
to_guess()
to_plot(yfunc=None, staterrfunc=None)