get_data

sherpa.astro.ui.get_data(id: IdType | None = None) Data

Return the data set by identifier.

The object returned by the call can be used to query and change properties of the data set.

Parameters:

id (int, str, or None, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.

Returns:

instance – The data instance.

Return type:

sherpa.data.Data

Raises:

sherpa.utils.err.IdentifierErr – No data has been loaded for this data set.

See also

copy_data

Copy a data set to a new identifier.

delete_data

Delete a data set by identifier.

load_data

Create a data set from a file.

set_data

Set a data set.

Examples

>>> d = get_data()
>>> dimg = get_data('img')
>>> load_arrays('tst', [10, 20, 30], [5.4, 2.3, 9.8])
>>> print(get_data('tst'))
name      =
x         = Int64[3]
y         = Float64[3]
staterror = None
syserror  = None