Skip to main content

A Python package for simulating gravitational wave detector noise.

Project description

gwmock-noise

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License Security: bandit DOI SPEC 0 — Minimum Supported Dependencies

A Python package for simulating gravitational-wave detector instrumental noise (colored and correlated models, lines, glitches, optional Schumann-resonance coupling, and CLI-driven batch runs).

Documentation

Published docs (user guide and API reference):

https://leuven-gravity-institute.github.io/gwmock-noise/

To build and preview locally (requires the docs dependency group):

uv sync --group docs
uv run zensical serve

Then open http://127.0.0.1:8000.

Quick start

Install

uv venv --python 3.12
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install gwmock-noise

Optional extras (declared in pyproject.toml):

  • gwmock-noise[gwpy] — GWpy-based helpers (for example GWpyAdapter)
  • gwmock-noise[frame] — GWF frame output (FrameWriter / GWpy GWF stack)

CLI

Create a TOML (or YAML/JSON) config and run:

gwmock-noise simulate examples/noise_config_example.toml

See examples/noise_config_example.toml and the noise simulation guide for fields and output layout.

Python API

from pathlib import Path

from gwmock_noise import DefaultNoiseSimulator, NoiseConfig, OutputConfig

config = NoiseConfig(
    detectors=["H1", "L1"],
    duration=4.0,
    sampling_frequency=4096.0,
    output=OutputConfig(directory=Path("output"), prefix="noise"),
    seed=42,
)
result = DefaultNoiseSimulator().run(config)
for detector, path in result.output_paths.items():
    print(detector, "->", path)

For PSD/CSD-driven colored noise, spectral lines, glitches, and streaming behavior, use the same NoiseConfig fields described in the user guide and API reference. For stateful continuation across chunk boundaries, prefer the public open_stream(...) helper over reseeding separate runs.

Installation

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

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

Requirements

  • Python 3.12 or higher
  • Operating System: Linux, macOS, or Windows

Note: The package is built and tested against Python 3.12–3.14. 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.14 range). This avoids potential issues with unsupported Python versions.

Install from PyPI

The recommended way to install gwmock-noise is from PyPI:

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

Install from Source

For the latest development version:

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

Development Installation

To set up for development (linting, tests, and docs tooling live in uv dependency groups, not [project.optional-dependencies]):

git clone git@github.com:Leuven-Gravity-Institute/gwmock-noise.git
cd gwmock-noise

# Create a virtual environment (recommended with uv)
uv venv --python 3.12
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv sync --group dev --group docs

# Install pre-commit hooks
uv run pre-commit install

Verify Installation

Check that gwmock-noise is installed correctly:

gwmock-noise --help
python -c "import gwmock_noise; print(gwmock_noise.__version__)"

Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull 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 the 3-Clause BSD License - see the LICENSE file for details.

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_noise-0.1.3.tar.gz (238.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_noise-0.1.3-py3-none-any.whl (56.8 kB view details)

Uploaded Python 3

File details

Details for the file gwmock_noise-0.1.3.tar.gz.

File metadata

  • Download URL: gwmock_noise-0.1.3.tar.gz
  • Upload date:
  • Size: 238.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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_noise-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5cf4dbc18e53d62ccd2d17cc84ce4841449ee6dbfc408aa42f519fa65cea3f47
MD5 2ac3947f9d1e4519aa37aeffb1c71a31
BLAKE2b-256 bdc64a85431f59393e1a45caad653449c32ffcb6bf5b71a5e5015b18db30801c

See more details on using hashes here.

File details

Details for the file gwmock_noise-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gwmock_noise-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 56.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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_noise-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1707daab47cb08639839432c6d91de8be6c2f6fe825ac4bc61a44e17d96c55f5
MD5 f039734c1554e0de9384e54162f79de3
BLAKE2b-256 d6e59d5678a9ccc34b2517dce7226c020a00cbaec7cc09b6cbf2d7eb52e5ae75

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