Skip to the navigation links
Last modified: 24 October 2023

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

Python Resources


Sherpa is an importable module for the dynamic, object-oriented Python programming language, which means you can write your own Python scripts for use in Sherpa. This easily allows for creating complex analysis and modeling functions, building batch-mode analysis, and extending the provided functionality to meet required needs. Below is a list of Python resources which you may find helpful as you conduct your scientific analysis in Sherpa. To learn about the key features of Python, refer to the official Python website.

[NOTE]
Python version

The Python version used in CIAO 4.15 is Python 3.9 - when using ciao-install - or your choice of Python 3.8, 3.9, or 3.10 when using the conda installation.

Tutorials

The Python Tutorial

Comprehensive documentation provided by the official Python website.

Practical Python for Astronomers

A series of hands-on workshops to explore the Python language and the analysis tools it provides. The emphasis is on using Python to solve real-world problems that astronomers are likely to encounter in research.

Practical Python for Astronomers: Matplotlib

A guide to using Matplotlib.

Matplotlib tutorial

The Matplotlib tutorial.

Astronomy Software

AstroPy

A community Python library for Astronomy. See also the associated paper Astropy: A community Python package for astronomy by the AstroPy collaboration.

AstroML: Machine Learning and Data Mining for Astronomy

The astroML project accompanies the book "Statistics, Data Mining, and Machine Learning in Astronomy".

User Blogs

Sherpa Blog

Includes useful tips and tricks on using Python in Sherpa.

Python Perambulations

A wide-ranging look at data analysis with Python.

Plumber Jack

Documents miscellaneous items relating to the Python logging package.

Doug Hellmann

The "Python Module of the Week" series provides examples of usage of the various modules contained in the Python standard library.

Books

Beginning Python: From Novice to Professional, by Magnus Lie Hetland
A Primer on Scientific Programming with Python, by Hans Petter Langtangen
Python Scripting for Computational Science, Hans Petter Langtangen
Beginning Python Visualization: Crafting Visual Transformation Scripts, by Shai Vaingast
Statistics, Data Mining, and Machine Learning in Astronomy by Zeljko Ivezic, Andrew Connolly, Jacob VanderPlas, and Alex Gray