4. Scientific Programming

Welcome to the Scientific Programming chapter of SPIRL. In this section we will explore some useful science packages in Python.

As an open source programming language, Python is freely available and developed by hundreds of contributors around the globe. Coming out of this open community, many of the additional packages which extend Python’s functionality are also developed in an open source format and the most common packages have been written, tested and used by thousands of developers, lending credibility to their effectiveness.

The main packages we will learn are the core of the scientific computing stack:

  • numpy

  • matplotlib

  • scipy

  • pandas

The packages above have all been extensively developed because of how central they are to data science, and provide the basis of most data analysis you will do in Python.

Additionally, we will introduce the science-specific package, astropy which was built by astronomers for astronomers and bundles many tools for working with astronomical data in Python.

We will begin this chapter with a short intro to the Jupyter notebook, a useful document that combines text, code, and plots into one interactive document. The tutorials in this section are built as Jupyter notebooks and can be worked through interactively. Let’s try it on the next page!