Data1D

class sherpa.data.Data1D(name, x, y, staterror=None, syserror=None)[source] [edit on github]

Bases: sherpa.data.Data

Attributes Summary

dep

Left for compatibility with older versions

indep

Return the grid of the data space associated with this data set.

mask

Mask array for dependent variable

x

Used for compatibility, in particular for __str__ and __repr__

Methods Summary

apply_filter(data)

eval_model(modelfunc)

eval_model_to_fit(modelfunc)

get_bounding_mask()

get_dep([filter])

Return the dependent axis of a data set.

get_dims([filter])

Return the dimensions of this data space as a tuple of tuples.

get_error([filter, staterrfunc])

Return the total error on the dependent variable.

get_evaluation_indep([filter, model, ...])

get_filter([format, delim])

get_filter_expr()

get_img([yfunc])

Return 1D dependent variable as a 1 x N image

get_imgerr()

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, model, use_evaluation_space])

get_xerr([filter, yfunc])

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, use_evaluation_space])

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([xlo, xhi, ignore])

set_dep(val)

Set the dependent variable values"

set_indep(val)

to_component_plot([yfunc, staterrfunc])

to_fit([staterrfunc])

to_guess()

to_plot([yfunc, staterrfunc])

Attributes Documentation

dep

Left for compatibility with older versions

indep

Return the grid of the data space associated with this data set. :returns: :rtype: tuple of array_like

mask

Mask array for dependent variable

Returns

mask

Return type

bool or numpy.ndarray

x

Used for compatibility, in particular for __str__ and __repr__

Methods Documentation

apply_filter(data) [edit on github]
eval_model(modelfunc) [edit on github]
eval_model_to_fit(modelfunc) [edit on github]
get_bounding_mask()[source] [edit on github]
get_dep(filter=False) [edit on github]

Return 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 dependent axis values for the data set. This gives the value of each point in the data set.

Return type

array

See also

get_indep

Return the independent axis of a data set.

get_error

Return the errors on the dependent 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_dims(filter=False)[source] [edit on github]

Return the dimensions of this data space as a tuple of tuples. The first element in the tuple is a tuple with the dimensions of the data space, while the second element provides the size of the dependent array. :returns: :rtype: tuple

get_error(filter=False, staterrfunc=None) [edit on github]

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_evaluation_indep(filter=False, model=None, use_evaluation_space=False)[source] [edit on github]
get_filter(format='%.4f', delim=':')[source] [edit on github]
get_filter_expr()[source] [edit on github]
get_img(yfunc=None)[source] [edit on github]

Return 1D dependent variable as a 1 x N image

Parameters

yfunc

get_imgerr()[source] [edit on github]
get_indep(filter=False) [edit on github]

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) [edit on github]

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) [edit on github]

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, model=None, use_evaluation_space=False)[source] [edit on github]
get_xerr(filter=False, yfunc=None)[source] [edit on github]

Return linear view of bin size in independent axis/axes”

Parameters
  • filter

  • yfunc

get_xlabel()[source] [edit on github]

Return label for linear view of independent axis/axes

get_y(filter=False, yfunc=None, use_evaluation_space=False)[source] [edit on github]

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

Parameters
  • filter

  • yfunc

  • use_evaluation_space

get_yerr(filter=False, staterrfunc=None) [edit on github]

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

Parameters
  • filter

  • staterrfunc

get_ylabel(yfunc=None) [edit on github]

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

Parameters

yfunc

ignore(*args, **kwargs) [edit on github]
notice(xlo=None, xhi=None, ignore=False)[source] [edit on github]
set_dep(val) [edit on github]

Set the dependent variable values”

Parameters

val

set_indep(val) [edit on github]
to_component_plot(yfunc=None, staterrfunc=None)[source] [edit on github]
to_fit(staterrfunc=None) [edit on github]
to_guess() [edit on github]
to_plot(yfunc=None, staterrfunc=None)[source] [edit on github]