Tutorial Step 0: Software Setup

Introduction

The data in the LIGO Open Science Center (LOSC) archive is in both HDF5 and gravitational wave frame (GWF) file formats.

Example software for HDF5 files is available in a variety of languages, including C, C++, Matlab, and Java. In tutorial will provide a walk-through only of how to install and use Python modules to work with LIGO data. However, if you prefer to work in another language, you may still find some parts of this tutorial useful for understanding the contents of a LIGO data file.

This tutorial will describe use of HDF5 files. To instead use GWF frame files, first follow the instructions for installing the Frame Library and LSC software. Note that the example example API, which is described in Tutorial 4, will work for both GWF and HDF5 files downloaded from the LIGO Open Science Center.
To work through this tutorial, you will need to first install the following packages on your computer:
  • HDF5
  • Python version 2.6 or 2.7, and the modules:
    • numpy
    • matplotlib
    • scipy
    • h5py

In addition, you may also want to install these optional packages:

  • iPython and iPython Notebook which provide more interactive interfaces to Python.
  • You may also like HDFView, which provides a graphical interface to HDF5 files.

If your computer already has all of these packages isntalled, then you should be able to move on to the next section of the tutorial. If not, here are some suggestions for how to install the needed software.

Option 1: Install Pre-compiled Software: Enthought

  • Easy Installation
  • Should work for Mac, Windows, and Linux
Enthought offers some pre-compiled versions of Python that will run with a simple point and click. The free distribution ('Canopy Express') does not include h5py by default, and so is not recommended for this tutorial. However, a free academic license is available to students, staff, and faculty at academic institutions, and this may provide an easy-to-install solution.
  1. Use your .edu e-mail address to request a free academic license
  2. Download and install Canopy Express
  3. Enter your license information to get the full version.

Option 2: Install Pre-compiled Software: Anaconda

  • Easy Installation
  • Should work for Mac, Windows, and Linux
A python distribution with the required packages included is also available for free from Continuum Analytics. Anaconda should be easy to install:
  1. Visit the Anaconda download page and follow instructions.

Option 3: Install with MacPorts

  • Installation requires some experience with command line interface
  • This solution is only for Macs
If you are working on a machine that runs Mac OS X, then MacPorts provides a way to install the needed software.

If you do not already have MacPorts installed, then follow the installation instructions provided by the MacPorts Project Official Home Page. Both to check if MacPorts is installed, and to update it if is, open a terminal window and type:

$ sudo port selfupdate
The port selfupdate command may take a few minutes or more to run. After MacPorts is installed and updated, you can run the following sequence of commands to both download and install the software we will use for this tutorial.
$ sudo port install python27
$ sudo port install py27-numpy
$ sudo port install py27-matplotlib
$ sudo port install py27-scipy
$ sudo port install py27-h5py
Then, you should be able to run python by typing
$ /opt/local/bin/python2.7

Option 4: Install Packages Individually

  • Experts only
  • Works for any operating system
All of the software for this tutorial is freely available. We recommend Python version 2.7. Download and install the following packages:
  1. HDF5 (Windows users can skip this step)
  2. Python
  3. NumPy
  4. matplotlib
  5. SciPy
  6. h5py

Verify Software Installation

Once you have installed the software, open the python interpreter, and type the following lines. If everything works, this should plot a parabola.
import numpy as np
import matplotlib.pyplot as plt
import h5py
vector=np.arange(20)
plt.plot(vector**2)
plt.show()

What's next?

Once you have all the needed software installed, it is time to learn how it works. If you are already have some experience with Python, you can go to the next step of this tutorial. However, if you are new to Python, you may want to look at some tutorials on numpy and matplotlib. After you are comfortable with Python's basic features, you can go to the next step of this tutorial.