The sherpa.data module

Tools for creating, storing, inspecting, and manipulating data sets.

The main classes for representing data sets are Data1D, Data1DInt, and Data2D, to handle (x, y), (xlo, xhi, y), and (x1, x2, y) data, although there are also more-specialized cases, such as Data1DAsymmetricErrs. These classes build on the Data class, which supports dynamic filtering of data - to select a subset of the data range - as well as data access and model evaluation to match the data range.

The Filter class is used to handle data filtering - that is, to combine filters such as selecting the range a to b (notice) and hiding the range c to d (ignore). This is used with the DataSpace1D and DataSpace2D classes to handle evaluating models on different grids to the data, and then converting back to the data space, whether by rebinnig or interpolation.

Notebook support

The Data objects support the rich display protocol of IPython, with HTML display of a table of information highlighting the relevant data. Examples can be found at [NoteBook].

References

NoteBook

https://sherpa.readthedocs.io/en/latest/NotebookSupport.html

Examples

Create a data set representing the independent axis (x) and dependent axis (y) then filter to select only those values between 500-520 and 530-700:

>>> d1 = Data1D('example', x, y)
>>> d1.notice(500, 700)
>>> d1.ignore(520, 530)

Classes

Data(name, indep, y[, staterror, syserror])

Generic, N-Dimensional data sets.

Data1D(name, x, y[, staterror, syserror])

Data1DAsymmetricErrs(name, x, y, elo, ehi[, ...])

1-D data set with asymmetric errors

Data1DInt(name, xlo, xhi, y[, staterror, ...])

1-D integrated data set

Data2D(name, x0, x1, y[, shape, staterror, ...])

Data2DInt(name, x0lo, x1lo, x0hi, x1hi, y[, ...])

2-D integrated data set

DataSimulFit(name, datasets[, numcores])

Store multiple data sets.

BaseData()

Base class for all data classes.

DataSpace1D(filter, x)

Class for representing 1-D Data Space.

DataSpace2D(filter, x0, x1)

Class for representing 2-D Data Spaces.

DataSpaceND(filter, indep)

Class for representing arbitray N-Dimensional data domains

Filter()

A class for representing filters of N-Dimentional datasets.

IntegratedDataSpace1D(filter, xlo, xhi)

Same as DataSpace1D, but for supporting integrated data sets.

IntegratedDataSpace2D(filter, x0lo, x1lo, ...)

Same as DataSpace2D, but for supporting integrated data sets.

Class Inheritance Diagram

Inheritance diagram of BaseData, Data, Data1D, Data1DAsymmetricErrs, Data1DInt, Data2D, Data2DInt, DataSimulFit

Inheritance diagram of DataSpace1D, DataSpace2D, DataSpaceND, IntegratedDataSpace1D, IntegratedDataSpace2D