ITN45: Working with IRIS Level 2 data in Python#

Introduction#

ITN45 is intended to help the solar community to start working with IRIS Level 2 data using Python. It is especially oriented to those who have a limited knowledge of Python and want to start using this language to analyze IRIS data. This guide focuses on the first steps needed to start working with the IRIS Level 2 data:

  • How to download the data from the IRIS database on the internet

  • How to read the downloaded data and visualize them

  • How to save those variables that are of our interest.

In the chapters that follow, this guide demonstrates simple and efficient Python tools to download, read, visualize, and analyze IRIS data. This will use iris_lmsalpy, a Python package primarily developed by Alberto Sainz Dalda (asainz.solarphysics@gmail.com). We will also talk about the co-developed irispy-lmsal package as well as miscellaneous codes.

Further information for users interested in other Python packages can find them at:

  • irispy-lmsal: a former SunPy Project package, now under LMSAL stewardship, to work with IRIS data.

  • IRISreader: oriented to read IRIS data and prepare them for Machine Learning tasks developed by Cédric Huwyler.

Software requirements#

This guide uses the the following Python package: iris_lmsalpy. You can install this package using the following command in your shell session:

git clone 
https://gitlab.com/LMSAL_HUB/iris_hub/iris_lmsalpy.git
cd iris_lmsalpy
python setup.py install

A more detailed description of the installation can be found on the readme at iris_lmsalpy.

The iris_lmsalpy package uses standard Python packages that may need to be installed in your Python virtual environment. These packages are:

Thus, if an error is raised after executing any of the following lines:

>>> import astropy
>>> import matplotlib
>>> import numpy
>>> import requests
>>> import PyQt5
>>> import pyqtgraph

then you should install the missing package using one of these commands (use the one you have previously used in your virtual environment) in your shell session:

conda install <package-name>
# or
pip install <package-name>

The PDF version of this tutorial is available.

Note

Your comments and suggestions about the modules outlined here can be sent to Alberto Sainz Dalda (asainz.solarphysics@gmail.com).