read_arrays
- sherpa.astro.io.read_arrays(*args)[source] [edit on github]
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 fromsherpa.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 arraysx
andy
(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 axesx0
andx1
, and dependent axisy
:>>> d = read_arrays(x0, x1, y, sherpa.data.Data2D)