get_analysis

sherpa.astro.ui.get_analysis(id: IdType | None = None) → str

Return the units used when fitting spectral data.

Parameters:
idint, str, or None, optional

The data set to query. If not given then the default identifier is used, as returned by get_default_id.

Returns:
setting{ ‘channel’, ‘energy’, ‘wavelength’ }

The analysis setting for the data set.

Raises:
sherpa.utils.err.ArgumentErr

If the data set does not contain PHA data.

sherpa.utils.err.IdentifierErr

If the id argument is not recognized.

See also

get_default_id

Return the default data set identifier.

set_analysis

Change the analysis setting.

Examples

Display the analysis setting for the default data set:

>>> print(get_analysis())

Check whether the data set labelled ‘SgrA’ is using the wavelength setting:

>>> is_wave = get_analysis('SgrA') == 'wavelength'