get_stat

sherpa.astro.ui.get_stat(name=None)

Return the fit statisic.

Parameters:

name (str, optional) – If not given, the current fit statistic is returned, otherwise it should be one of the names returned by the list_stats function.

Returns:

stat – An object representing the fit statistic.

Return type:

object

Raises:

sherpa.utils.err.ArgumentErr – If the name argument is not recognized.

See also

get_stat_name

Return the name of the current fit statistic.

list_stats

List the fit statistics.

set_stat

Change the fit statistic.

Examples

Return the currently-selected statistic, display its name, and read the help documentation for it:

>>> stat = get_stat()
>>> stat.name
'chi2gehrels'
>>> help(stat)

Read the help for the “wstat” statistic:

>>> help(get_stat('wstat'))