get_data

sherpa.ui.get_data(id=None)

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 or str, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.
Returns:An instance of a sherpa.Data.Data-derived class.
Return type:instance
Raises:sherpa.utils.err.IdentifierErr – If no model expression has been set for the data set (with set_model or set_source).

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