This document highlights important changes and additions to Sherpa functionality in the CIAO 4.12 Sherpa release.
Sherpa version for CIAO 4.12 was released on December 17, 2019. Sherpa in CIAO runs under Python 3.5 (when installed with ciao-install) or Python 3.7, 3.6, or 3.5 (when installed using the conda package manager). The full list of the Sherpa updates is given in the Release Notes. The major updates in this release include:
Plotting is now handled by Matplotlib as ChIPS has been deprecated in CIAO 4.12. Please see the ChiPS to Matplotlib Conversion Guide for help converting from ChIPS, or contact the CXC Helpdesk if you need help.
The sherpa application will automatically convert to Matplotlib if you still have ChIPS as your preference setting, and you will see the following message displayed:
WARNING: chips is not supported in CIAO 4.12+, falling back to matplotlib. WARNING: Please consider updating your $HOME/.sherpa.rc file to suppress this warning.
As discussed in the Sherpa FAQ on the ChIPS warning, this warning can be stopped by changing the plot_pkg line in your $HOME/.sherpa.rc file so that it is set to pylab - for example:
unix% grep plot_pkg $HOME/.sherpa.rc plot_pkg : pylab
The use of the IPython magic command "%matplotlib" is no-longer needed in the Sherpa environment to see the plots on screen. Users who import Sherpa into IPython sessions or Jupyter notebooks will still need to set up the Matplotlib event loop to see the plots.
The plot_xxx family of routines - such as plot_data and plot_fit - can now accept plot settings as keyword arguments. The allowable keywords are the same as those returned by the get_xxx_plot_prefs routines, such as xlog, ylog, and color. This means that you can now say:
sherpa> plot_fit(ylog=True) sherpa> plot_model(2, overplot=True, color='gray', linestyle='dotted')
Two new routines have been added to display the current fit along with the ratio of the model to data: plot_fit_ratio() and plot_bkg_fit_ratio(). Please use help(plot_fit_ratio) from Sherpa for more information.
The number of warnings about displaying error bars in plots when error bars have been turned off has been decreased (in many cases you will no longer see this, but they can still occur for the combined fit-and-residual plot functions).
The plot_pvalue function has seen improvements when used with PHA spectra.
Sherpa now supports the use of a PSF image with a finer resolution than the resolution of 2D data images. 1D models can also be evaluated on a finer grid than the grid of the input data arrays. The models are evaluated on the resolution given by the PSF pixel scale or the 1D arbitrary grid. The evaluated models are rebin to match the original data scales for calculating the statistic during the fit.
Asymmetric errors are now supported for calculating parameter uncertainties via bootstrap. The data with asymmetric errors can be entered using a new 'load_ascii_with_errors' function or 'Data1DAsymmetricErrs' class.
The paging performed by the show_xxx set of commands - such as show_data and show_all - is now handled by Python rather than using an external command. This means that the output will now appear in Jupyter notebooks, and that the PAGER environment variable is no longer checked.
The update to version 12.10.1 of XSPEC has meant that the default cross-section table has changed: it now defaults to vern when it was bcmc in CIAO 4.11 and earlier. Note that this default setting is now read from your $HOME/.xspec/Xspec.init configuration file (if it exists), using the XSECT setting.
The default abundance table will now be set from your $HOME/.xspec/Xspec.init file, if the ABUND line is set.
The CIAO release of Sherpa is based on the GitHub-developed version of Sherpa. Please consider contributing to Sherpa development, whether by adding code, fixing bugs, or changing documentation. The updated documentation for this version of Sherpa contains information about new functions and might be useful, but is not aimed at CIAO users.
- Bug Fixes
Help can be found either via Python's native help function (that is, Python docstrings), or with the ahelp command (which can be used from both the command line and within the Sherpa interactive environment.
The Python docstrings are the preferred way to access help on the Sherpa functions and models, since the ahelp files may not have been updated either to add new functions or models, or to reflect recent improvements.
A recent development for "standalone Sherpa" is the creation of the Sherpa documentation website. This provides on-line access to the Python docstrings, as well as general documentation on how to use Sherpa. It is aimed at users who want to use the more object-orientated interface provided by Sherpa rather than the functions from the sherpa.astro.ui module documented on this site, as well as not being tailored to CIAO users, but it is useful for the more advanced Sherpa users who want to use Sherpa in complex Python pipelines.