Gravitational Wave Open Science Center

Tutorial Step 0: Software Setup

Introduction

Many of the tutorials available through GWOSC are designed to be run using python, and jupyter notebooks provide a convienient interface. If you are new to python or jupyter notebooks, and want to try the tutorials, here are a few suggestions to help get running quickly.


Option 1: Run tutorials in your browser

  • No installation needed
Instructions:
  • Click the icons below to run tutorials in your browser with Microsoft Azure, Google Colaboratory, or mybinder
  • If you are stuck, try clicking the "video help".
Hint: Once you start a notebook, you can often install python packages with pip. For example, try starting a notebook with one of the above services, and run the command ! pip install gwpy

Reference:

Option 2: Use a conda enviornment (Apple or Linux computers)

  • Some installation required
  • Conda allows a complete LSC software stack to be installed your MacOS or Linux computer
Instructions:
  1. Install Miniconda (Download | Instructions)
    You may need to restart your computer after installation.

  2. Open a terminal window, and add the conda-forge channel:
    conda config --add channels conda-forge

  3. Download a YML file. E.g.:
    Download with browser: https://git.ligo.org/lscsoft/conda/raw/master/environment-py27.yml
    or
    type in terminal:
    curl https://git.ligo.org/lscsoft/conda/raw/master/environment-py27.yml -o environment-py27.yml

  4. Create the environment:
    conda env create -f environment-py27.yml

  5. Activate the environment:
    conda activate ligo-py27

  6. To start a jupyter notebook:
    jupyter notebook

  7. When you are finished, you can deactivate the enviornment:
    conda deactivate


Reference:

Option 3: Use conda on Windows (Windows computers)

  • Some installation required
  • Users of Windows computers can install a variety of packages, including gwpy, to work with GWOSC data.

Instructions:
  1. Install Miniconda (Download | Instructions)
    You may need to restart your computer after installation.

  2. From the start menu, open the Anaconda Powershell Prompt

  3. In the prompt, add the conda-forge channel:
    conda config --add channels conda-forge

  4. Create a conda enviornment (this will take some time to install)
    conda create --name lscsoft python=3.7 gwpy jupyter

  5. Activate the environment:
    conda activate lscsoft

  6. Start a jupyter notebook:
    jupyter notebook

Reference:

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.