Skip to main content

A Python package for simulating gravitational wave detector data for mock data challenges.

Project description

gwmock

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License: GPL-3.0-or-later Ruff DOI

A Python package for generating Mock Data Challenge (MDC) datasets for the gravitational-wave (GW) community. It simulates strain data for detectors like Einstein Telescope, providing a unified interface for reproducible GW data generation.

Features

  • Modular Design: Uses mixins for flexible simulator composition
  • Detector Support: Built-in support for various GW detectors with custom configuration options
  • Waveform Generation: Integrates with PyCBC and LALSuite for accurate signal simulation
  • Noise Models: Supports colored and correlated noise generation (In-Progress)
  • Population Models: Handles injection populations for signals and glitches
  • Data Formats: Outputs in standard GW formats (GWF frames)
  • CLI: Command-line tools for easy simulation workflows

Installation

We recommend using uv to manage virtual environments for installing gwmock.

If you don't have uv installed, you can install it with pip. See the project pages for more details:

  • Install via pip: pip install --upgrade pip && pip install uv
  • Project pages: uv on PyPI | uv on GitHub
  • Full documentation and usage guide: uv docs

Note: The package is built and tested against Python 3.12-3.13. When creating a virtual environment with uv, specify the Python version to ensure compatibility: uv venv --python 3.12 (replace 3.12 with your preferred version in the 3.12-3.13 range). This avoids potential issues with unsupported Python versions.

From PyPI

# Create a virtual environment (recommended with uv)
uv venv --python 3.13
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install gwmock

From Source

git clone git@github.com:Leuven-Gravity-Institute/gwmock.git
cd gwmock
# Create a virtual environment (recommended with uv)
uv venv --python 3.13
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv sync

Quick Start

Command Line

# Generate simulated data
gwmock simulate config.yaml

Configuration

gwmock uses YAML configuration files for reproducible simulations. New runs use the adapter-backed orchestration surface, which keeps backend selection explicit and lets third-party packages plug in through public protocols.

Key configuration sections:

Section Purpose
globals Shared orchestration parameters such as sampling rate, segment duration, start time, and output roots
orchestration.population Public population backend, source type, sample count, and backend arguments
orchestration.signal Public signal backend, detector network, waveform model, and output settings
orchestration.noise Public noise backend, generation arguments, and output settings

Example:

globals:
    working-directory: .
    output-directory: output
    metadata-directory: metadata
    simulator-arguments:
        sampling-frequency: 4096
        duration: 1024
        start-time: 1577491218
        total-duration: 5 hours

orchestration:
    population:
        backend: FilePopulationLoader
        source-type: bbh
        n-samples: 1
        arguments:
            path: https://raw.githubusercontent.com/Leuven-Gravity-Institute/gwmock/main/examples/signal/bbh_population.csv
    signal:
        detectors:
            - H1
        waveform-model: IMRPhenomXPHM
        minimum-frequency: 20
        output:
            output_directory: signal
            file_name: signal-{{ counter }}.gwf
            arguments:
                channel: H1:STRAIN
    noise:
        output:
            output_directory: noise
            file_name: noise-{{ counter }}.gwf

Third-party backends can be exposed through an entry point or referenced directly as module:Class, as long as they satisfy the public protocol for the relevant section. See docs/user-guide/protocols.md, docs/user-guide/orchestration.md, and docs/user-guide/extensibility.md for the protocol model and integration details.

Documentation

Full documentation to be available at https://leuven-gravity-institute.github.io/gwmock.

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a merge request

Release Schedule

Releases follow a fixed schedule: every Tuesday at 00:00 UTC, unless an emergent bugfix is required. This ensures predictable updates while allowing flexibility for critical issues. Users can view upcoming changes in the draft release on the GitHub Releases page.

Testing

Run the test suite:

uv run pytest

License

This project is licensed under GPL-3.0-or-later. See the LICENSE file for the full license text.

Support

For questions or issues, please open an issue on GitHub or contact the maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwmock-0.5.1.tar.gz (169.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gwmock-0.5.1-py3-none-any.whl (153.9 kB view details)

Uploaded Python 3

File details

Details for the file gwmock-0.5.1.tar.gz.

File metadata

  • Download URL: gwmock-0.5.1.tar.gz
  • Upload date:
  • Size: 169.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gwmock-0.5.1.tar.gz
Algorithm Hash digest
SHA256 aabfd6768d275a1f7d58fe912d36277345390fae9bc70d6ccd1b0eef9995f345
MD5 3501f7f1f6d91f4b6a71e1babf6d5ab6
BLAKE2b-256 62a1a2c35310a819c5b0ff27dc990f3cf95f1253532f6e377bc08fb6bb6a2e83

See more details on using hashes here.

File details

Details for the file gwmock-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: gwmock-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 153.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gwmock-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55a5dd313cdc11354fcbb2942f6bfcede96ef7c474b30fdcf0014c74758fd8e0
MD5 b9e7637d23679ac1e9d0e3cccc2b7a09
BLAKE2b-256 3b60863baad9fe9de68cd3369916e4bbe0e9bca9302e4fb6fda1e16709f5e066

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page