1. Introduction

This is a practical guide to using Python to read and analyse data from IRIS. It is meant to complement the existing IRIS documentation and, in particular, the Online Guide to IRIS Data Analysis (ITN 26).

1.1. Why low-level?

This guide focuses on using simple and efficient methods to read IRIS data, and does not make use of higher-level abstractions or IRIS-specific packages such as IRISpy or SunPy. The motivation is two-fold: to detail a “barebones” interface when no other packages are available or performance is the goal, and to provide a simple guide while IRISpy is not mature enough and its API changes quickly.

1.2. Requirements

To follow this guide only standard python scientific packages are necessary:

  • Numpy
  • Scipy
  • Matplotlib

In addition, Astropy is necessary for its FITS reader and WCS module.

The recommended way to install all these packages is through the Anaconda Python Distribution. Once you have Anaconda installed, you can make sure you have all you need by running:

conda install numpy scipy matplotlib astropy

If you want to follow this tutorial using Jupyter (optional), you should also include the packages jupyterlab and ipympl above, and build the Jupyter lab extensions with:

jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
This guide is written for Python 3. It may not work under Python 2.x.

1.3. How to use this guide

This guide is written in Jupyter notebook format. On the top right corner of each page you find a link “View page source”. If you save that file (and remove the last .txt extension), you can open the page in Jupyter and interact with the data. Alternatively, you can also type the commands here on the normal python console or in ipython. Some setup commands such as %matplotlib inline only make sense if you are running Jupyter.