Skip to content
IPython notebooks and associated material for SWC-style workshop in Freiburg.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Freiburg OpenAstronomy Workshop 21st-22nd February 2017


This repository contains the material taught at the OpenAstronomy workshop at Freiburg in February 2017. The first day is an introduction to Python for scientists already familiar with programming concepts, and the second day covers Astropy and SunPy.

The introductory Python lessons and the setup instructions below are adapted from the excellent Software Carpentry material.

If you have any questions about this workshop or its contents, or if you would like to arrange a similar workshop, feel free to contact Stuart Mumford or Drew Leonard.


Day 1 Day 2
09:00 Introduction and software setup --
09:30 Version Control with Git Intro to SunPy
10:50 Coffee Coffee
11:10 An Introduction to Python Images in Solar Astronomy
12:30 Lunch break Lunch break
13:30 Units and Plotting Obtaining Solar Data
14:50 Coffee Coffee
15:10 Exercise: Approximating Pi (end 16:30) Exercise: Inspecting Spectral Data (end 16:00)

Installation and setup

To participate in the workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.


Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on You will need a supported web browser (current versions of Chrome, Firefox or Safari, or Internet Explorer version 9 or above).


Download the Git for Windows installer. Run the installer and follow the steps below:

  1. Click on "Next".
  2. Click on "Next".
  3. Click on "Next".
  4. Click on "Next".
  5. Click on "Next".
  6. Select "Use Git from the Windows Command Prompt" and click on "Next". If you forgot to do this programs that you need for the workshop will not work properly. If this happens rerun the installer and select the appropriate option.
  7. Click on "Next". Keep "Checkout Windows-style, commit Unix-style line endings" selected.
  8. Select "Use Windows' default console window" and click on "Next".
  9. Click on "Next".
  10. Click on "Finish".

This will provide you with both Git and Bash in the Git Bash program.

Mac OS X

For OS X 10.9 and higher, install Git for Mac by downloading and running the most recent "mavericks" installer from this list. After installing Git, there will not be anything in your /Applications folder, as Git is a command line program. For older versions of OS X (10.5-10.8) use the most recent available installer labelled "snow-leopard" available here.


If Git is not already available on your machine you can try to install it via your distro's package manager. For Debian/Ubuntu run sudo apt-get install git and for Fedora run sudo yum install git.


Python is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.

We will teach Python using the Jupyter (IPython) notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).


  1. Open with your web browser.
  2. Download the Python 3.5 installer for Windows.
  3. Install Python 3.5 using all of the defaults for installation except make sure to check Make Anaconda the default Python.

Mac OS X

  1. Open with your web browser.
  2. Download the Python 3.5 installer for OS X.
  3. Install Python 3.5 using all of the defaults for installation.


  1. Open with your web browser.
  2. Download the Python 3.5 installer for Linux.
  3. Install Python 3.5 using all of the defaults for installation. (Installation requires using the shell. If you aren't comfortable doing the installation yourself stop here and request help at the workshop.)
  4. Open a terminal window.
  5. Type bash Anaconda and then press tab. The name of the file you just downloaded should appear.
  6. Press enter. You will follow the text-only prompts. When there is a colon at the bottom of the screen press the down arrow to move down through the text. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).


Given that you have installed Python using Anaconda, we can use the Anaconda environment to install SunPy too.

  1. To install SunPy launch a system command prompt or the 'Anaconda Command Prompt' (under Windows).
  2. Configure conda for sunpy downloads:

conda config --add channels conda-forge --add channels astropy

Then to install SunPy

conda install sunpy astroquery

You can’t perform that action at this time.