read_arrays

sherpa.astro.io.read_arrays(*args)[source]

Create a dataset from multiple arrays.

The return value defaults to a sherpa.data.Data1D instance, but this can be changed by supplying the required class as the last argument (anything that is derived from sherpa.data.BaseData).

Parameters:*args – There must be at least one argument. The number of arguments depends on the data type being read in. The supported argument types depends on the I/O backend in use (as supported by the get_column_data routine provided by the backend).
Returns:data
Return type:a sherpa.data.BaseData derived object

Examples

The following examples do not contain argument types specific to a particular I/O backend.

Create a sherpa.data.Data1D instance from the data in the arrays x and y (taken to be the independent and dependent axes respectively):

>>> d = read_arrays(x, y)

As in the previous example, but explicitly declaring the data type:

>>> d = read_arrays(x, y, sherpa.data.Data1D)

Create a sherpa.data.Data2D instance with the independent axes x0 and x1, and dependent axis y:

>>> d = read_arrays(x0, x1, y, sherpa.data.Data2D)