Skip to the navigation links
Last modified: 11 December 2024

URL: https://cxc.cfa.harvard.edu/sherpa/index.html

CIAO's modeling and fitting package


Sherpa is the CIAO modeling and fitting application. It enables the user to construct complex models from simple definitions and fit those models to data, using a variety of statistics and optimization methods (see the Gallery of Examples).

CIAO 4.17

Sherpa version for CIAO 4.17 was released on December 17, 2024. Sherpa in CIAO runs under Python 3.11 (whether installed using the conda package manager or with ciao-install). The full list of the Sherpa updates compared to 4.16.0 is given in the 4.17.0 and 4.16.1 release notes on GitHub. The major updates were made to plotting, adding the 50 new models in XSPEC 12.14.0, improvements to including linked parameters in fits and the guess routine, fixes for support for 1D data with asymmetric errors, updates for the experimental bokeh plotting backend, and bug fixes.

More information on this release can be found on the Sherpa updates page.

Sherpa lets you:
  • fit 1-D data sets (simultaneously or individually), including:
    spectra, surface brightness profiles, light curves, general ASCII arrays;

  • fit 2-D images/surfaces in the Poisson/Gaussian regime;

  • visualize the data with Matplotlib and DS9;

  • access the internal data arrays;

  • build complex model expressions;

  • import and use your own models;

  • choose appropriate statistics for modeling Poisson or Gaussian data;

  • import new statistics, with priors if required by analysis;

  • visualize a parameter space with simulations or using 1-D/2-D cuts of
    the parameter space;

  • calculate confidence levels on the best-fit model parameters;

  • choose a robust optimization method for the fit: Levenberg-Marquardt,
    Nelder-Mead Simplex or Monte Carlo/Differential Evolution;

  • perform Bayesian analysis with Poisson Likelihood and priors, using
    Metropolis or Metropolis-Hastings algorithm in the MCMC (Markov-Chain Monte Carlo);

  • and use Python to create complex analysis and modeling functions,
    build the batch mode analysis or extend the provided functionality
    to meet the required needs.

[Thumbnail image: Two plots, vertically aligned. The top plot, which covers about two thirds of the height, shows a radial profile of the surface brightness, along with a model fit. The bottom plot shows the residuals (in units of "sigma").]

[Version: full-size]

[Print media version: Two plots, vertically aligned. The top plot, which covers about two thirds of the height, shows a radial profile of the surface brightness, along with a model fit. The bottom plot shows the residuals (in units of "sigma").]
[Thumbnail image: A DS9 image showing a two by two grid where the top-left area shows the data, the top-right the model, the bottom-left the residuals, and the bottom-right area is empty. The model is circularly symmetric and the residual image shows there's small scall differences in the code (looks like two jets) and some large scale correlated differences.]

[Version: full-size]

[Print media version: A DS9 image showing a two by two grid where the top-left area shows the data, the top-right the model, the bottom-left the residuals, and the bottom-right area is empty. The model is circularly symmetric and the residual image shows there's small scall differences in the code (looks like two jets) and some large scale correlated differences.]
[Thumbnail image: A confidence plot showing the nH (X axis) and gamma (Y axis) values. The best-fit location and three contours (representing 1, 2, and 3 sigma) are displayed.]

[Version: full-size]

[Print media version: A confidence plot showing the nH (X axis) and gamma (Y axis) values. The best-fit location and three contours (representing 1, 2, and 3 sigma) are displayed.]

The Sherpa infrastructure greatly enhances the default Sherpa functions, and provides users with an environment for developing complex and sophisticated analysis.

Sherpa is designed for use in a variety of modes: as a user-interactive application and in batch mode. Sherpa is an importable module for the Python the scripting language. In addition, users may write their own Python scripts for use in Sherpa.

The About Sherpa page outlines key features of the software, and the Latest Updates page describes new functionality and recent changes. See also the Siemiginowska et al. (2024) paper for detailed information about Sherpa's capabilities.

If you have ideas about how to enhance or improve Sherpa, please contribute ideas (and code) to the Sherpa GitHub repository.

Please send feedback and questions on Sherpa to the CXC Helpdesk or the Sherpa Issues list on GitHub.


Citing Sherpa in a Publication

The sherpa.citation method will return infromation from the latest release on Zenodo:

sherpa> sherpa.citation('latest')

If you are writing a paper and would like to cite Sherpa, we recommend the following papers and presentations. The specific version of CIAO and CALDB (if applicable) used for the analysis should be mentioned as well.

Sherpa: An Open-source Python Fitting Package (ADS) [New]

Siemiginowska, Aneta, Burke, Douglas, Günther, Hans Moritz, Lee, Nicholas P., McLaughlin, Warren, Principe, David A., Cheer, Harlan, Fruscione, Antonella, Laurino, Omar, McDowell, Jonathan, Terrell, Marie
The Astrophysical Journal Supplement Series, Volume 274, Issue 2, id. 43.

\bibitem[Siemiginowska et al.(2024)]{2024ApJS..274...43S} Siemiginowska, A.,
Burke, D., G{\"u}nther, H.~M., et al.\ 2024, \apjs, 274, 43.
doi:10.3847/1538-4365/ad7bab
Sherpa: a mission-independent data analysis application (ADS)

P. E. Freeman, S. Doe, A. Siemiginowska
SPIE Proceedings, Vol. 4477, p.76, 2001

\bibitem[Freeman et al.(2001)]{2001SPIE.4477...76F} Freeman, P., Doe, S., 
\& Siemiginowska, A.\ 2001, \procspie, 4477, 76
Developing Sherpa with Python (ADS)

S. Doe, et al.
Astronomical Data Analysis Software and Systems XVI, 376, 543

\bibitem[Doe et al.(2007)]{2007ASPC..376..543D} Doe, S., et al.\ 2007, 
Astronomical Data Analysis Software and Systems XVI, 376, 543

A reference for the Python interface to Sherpa.

Sherpa: 1D/2D modeling and fitting in Python (SciPy 2009)

B. Refsdal, S. Doe, D. Nguyen, A. Siemiginowska, N. Bonaventura, D. Burke, I. Evans, J. Evans, A. Fruscione, E. Galle, J. Houck, M. Karovska, N. Lee, M. Nowak
Proceedings of the 8th Python in Science Conference (SciPy 2009), G. Varoquaux, S. van der Walt, J. Millman (Eds.), pp. 51-57 2009

Fitting and Estimating Parameter Confidence Limits with Sherpa (SciPy 2011)

B. Refsdal, S. Doe, D. Nguyen, A. Siemiginowska, V. Kashyap
Proceedings of the 19th Python in Science Conference (SciPy 2011), S. van der Walt, J. Millman (Eds.), pp. 4-10 2011

Further guidelines are available from the Acknowledgment of Use of Chandra Resources.