Last modified: December 2020

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_analysis.html
Jump to: Description · Examples · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.13 Sherpa v1

set_analysis

Context: utilities

Synopsis

Set the units used when fitting and displaying spectral data.

Syntax

set_analysis(id, quantity=None, type='rate', factor=0)

id - int or str
quantity - { 'channel', 'chan', 'bin', 'energy', 'ener', 'wavelength',
'wave' }
type - { 'rate', 'counts' }, optional
factor - int, optional

Description

The set_analysis command sets the units for spectral analysis. Note that in order to change the units of a data set from 'channel' to 'energy' or 'wavelength', the appropriate ARF and RMF instrument response files must be loaded for that data set. The type and factor arguments control how the data is plotted.


Examples

Example 1

Set all loaded data sets to use wavelength for any future fitting or display.

>>> set_analysis('wave')

Example 2

Set the data set with an identifier of 2 to use energy units.

>>> set_analysis(2, 'energy')

Example 3

Set data set 1 to use channel units. Plots will use a Y axis of count/bin rather than the default count/s/bin.

>>> set_analysis(1, 'bin', 'counts')

Example 4

Set data set 1 to use energy units. Plots of this data set will display keV on the X axis and counts keV (i.e. counts/keV * keV^2) in the Y axis.

>>> set_analysis(1, 'energy', 'counts', 2)

PARAMETERS

The parameters for this function are:

Parameter Definition
id If only one argument is given then this is taken to be the quantity argument (in which case, the change is made to all data sets). If multiple arguments are given then this is the identifier for the data set to change.
quantity The units to use for the analysis.
type The units to use on the Y axis of plots. The default is 'rate'.
factor The Y axis of plots is multiplied by Energy^factor or Wavelength^factor before display. The default is 0.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `quantity` parameter. If given two un-named arguments, then they are interpreted as the `id` and `quantity` parameters, respectively.


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
get_analysis, set_default_id
visualization
image_setregion