get_default_id

sherpa.astro.ui.get_default_id()

Return the default data set identifier.

The Sherpa data id ties data, model, fit, and plotting information into a data set easily referenced by id. The default identifier, used by many commands, is returned by this command and can be changed by set_default_id.

Returns:

id – The default data set identifier used by certain Sherpa functions when an identifier is not given, or set to None.

Return type:

int or str

See also

list_data_ids

List the identifiers for the loaded data sets.

set_default_id

Set the default data set identifier.

Notes

The default Sherpa data set identifier is the integer 1.

Examples

Display the default identifier:

>>> print(get_default_id())

Store the default identifier and use it as an argument to call another Sherpa routine:

>>> defid = get_default_id()
>>> load_arrays(defid, x, y)