Development Environment
Development Environment Setup
To ensure consistent results across gravitational wave research and data analysis, this bootcamp utilizes a standardized environment. We recommend using Docker for local development or accessing the course materials via our JupyterHub instance for a zero-install experience.
Environment Requirements
The bootcamp environment is built on a Python 3.x stack with a focus on deep learning and LIGO/Virgo/KAGRA (LVK) data processing. Key components include:
- Deep Learning: PyTorch (with CUDA support)
- Machine Learning: Scikit-learn
- Data Science: NumPy, SciPy, Matplotlib
- Domain Specific: LALSuite (LIGO Algorithm Library)
Using Docker (Recommended for Local Setup)
Docker provides a containerized environment that mirrors the production server, preventing "it works on my machine" issues.
1. Pull the Environment Image
We provide a pre-configured Docker image containing all scientific libraries, including the complex lalsuite dependencies.
docker pull autorelorg/gwdata-bootcamp:latest
2. Run the Container
To start a local Jupyter Lab instance inside the container, use the following command. This maps your local port 8888 to the container and mounts your current directory to /home/jovyan/work.
docker run -it --rm \
-p 8888:8888 \
-v "$(pwd)":/home/jovyan/work \
--name gw_bootcamp \
autorelorg/gwdata-bootcamp:latest
Note: If you have an NVIDIA GPU, add the --gpus all flag to enable hardware acceleration for the Deep Learning modules.
Using JupyterHub (For Bootcamp Participants)
Participants with access to the Sugon or institutional computing resources can use the hosted JupyterHub environment. This is the most efficient way to access high-performance GPUs and pre-loaded datasets.
- Login: Navigate to the provided JupyterHub URL.
- Server Options: Select the "Gravitational Wave Data Exploration" image from the dropdown menu.
- Resource Allocation: Choose a profile with at least 1 GPU for the Deep Learning sessions (refer to
2023/deep_learning/baseline/).
Manual Dependency Management
If you prefer to manage your own virtual environment (e.g., via Conda), you must install the specific LVK toolkits which are not available through standard pip install on all platforms.
1. Create a Conda Environment
conda create -n gw-bootcamp python=3.9
conda activate gw-bootcamp
2. Install Core Packages
# Standard Data Science stack
pip install numpy scipy matplotlib scikit-learn jupyterlab
# Machine Learning with GPU support
pip install torch torchvision torchaudio
3. Install Domain-Specific Libraries
The data preprocessing scripts (e.g., data_prep_bbh.py) require lal and lalsimulation. We recommend using the Conda Forge distribution:
conda install -c conda-forge lalsuite
Verifying Your Setup
Once your environment is active, run the following snippet in a Python shell or Jupyter cell to verify that the critical libraries are correctly linked:
import torch
import lal
import lalsimulation
print(f"PyTorch Version: {torch.__version__}")
print(f"GPU Available: {torch.cuda.is_available()}")
print(f"LAL Version: {lal.VCS_VERSION}")
# Test LALSimulation integration
m1 = 30 * lal.MSUN_SI
m2 = 30 * lal.MSUN_SI
print("Environment successfully verified for Gravitational Wave Analysis.")
Common Troubleshooting
- LALSuite Import Errors: If
import lalsimulationfails on macOS/Windows, ensure you are using a Conda environment, aslalsuitehas complex C-extensions that are difficult to build via rawpip. - GPU Not Found: Ensure your
NVIDIA Container Toolkitis installed if using Docker, or that your CUDA drivers match the version of PyTorch installed.