read_arrays
- sherpa.io.read_arrays(*args) Data[source] [edit on github]
Create a data object from arrays.
- Parameters:
- col1, … colnarray_like
The data columns.
- dstype
optional The data type to create. It must be a subclass of
sherpa.data.Dataand defaults tosherpa.data.Data1D
- Returns:
dataThe data object (created by calling the dstype constructor with the filename and then the data columns from the file).
- Raises:
sherpa.utils.err.IOErrRaised if no arrays are sent in.
See also
Examples
Create a 1D data object from the x and y arrays:
>>> dat = read_arrays(x, y)
Include a statistical error column:
>>> dat = read_arrays(x, y, dy)
Create an integrated (i.e. histogram) data set:
>>> dat = read_arrays(xlo, xhi, y, dstype=sherpa.data.Data1DInt)