Skip to main content

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.13
source .venv/bin/activate  # Windows: .venv\Scripts\activate
uv pip install gwmock-noise

Optional extras (declared in pyproject.toml):

  • gwmock-noise[hdf5] — faster HDF5 through h5py; HDF5 files also work without it
  • gwmock-noise[gwpy] — GWpy-based helpers (for example GWpyAdapter)
  • gwmock-noise[frame] — GWF frame output (FrameWriter / GWpy GWF stack)
  • gwmock-noise[gengli] — gengli-backed blip glitches (GengliBlipGlitch)
  • gwmock-noise[deepextractor] — real O3 glitch reconstructions from HuggingFace (DeepExtractorGlitch)

CLI

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

gwmock-noise simulate examples/noise_config_example.toml

To turn a GravitySpy CSV export into a gengli population file:

gwmock-noise build-blip-glitch-table --gravity-spy-csv gravity_spy.csv --out glitches.h5

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.

The gengli backend plugs into the same glitches= surface:

from pathlib import Path

from gwmock_noise import (
    DefaultNoiseSimulator,
    GengliBlipGlitch,
    LogNormalAmplitudeDistribution,
    NoiseConfig,
    OutputConfig,
)

config = NoiseConfig(
    detectors=["L1"],
    duration=8.0,
    psd_file=Path("noise_psd.txt"),
    glitches=[
        GengliBlipGlitch.from_population_file(
            "glitches.h5",
            rate=0.25,
            psd_file=Path("noise_psd.txt"),
            amplitude_distribution=LogNormalAmplitudeDistribution(mean=1.0, std=0.0),
        )
    ],
    output=OutputConfig(directory=Path("output"), prefix="gengli"),
)
DefaultNoiseSimulator().run(config)

NoiseConfig.psd_file also accepts bundled PSD preset names, so you can use psd_file="ET_10_full_cryo_psd" without managing the PSD file yourself. Einstein Telescope presets are ET_D_psd, ET_10_HF_psd, ET_10_full_cryo_psd, ET_15_HF_psd, ET_15_full_cryo_psd, ET_20_HF_psd, and ET_20_full_cryo_psd. Advanced LIGO presets are aLIGO_O3_actual_H1_psd, aLIGO_O3_actual_L1_psd, aLIGO_O4_high_projected_psd, and aLIGO_O4_low_projected_psd — the O3 pair are measured representative spectra (lines included), the O4 pair are pre-run projections. src/gwmock_noise/data/psd/PROVENANCE.md records where each curve came from. Local paths and HTTP(S) URLs remain supported too (for remote sources, use .txt or .csv).

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.13 or higher
  • Operating System: Linux, macOS, or Windows

Note: The package is built and tested against Python 3.13–3.15. When creating a virtual environment with uv, specify the Python version to ensure compatibility: uv venv --python 3.13 (replace 3.13 with your preferred version in the 3.13–3.15 range). On Python 3.15, h5py publishes no wheel yet, so the hdf5 extra may not install there; HDF5 files still work without it.

Install from PyPI

The recommended way to install gwmock-noise is 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-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.13
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.13
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv sync --group dev --group docs

# Install pre-commit hooks
uv run prek 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.

Metadata

Release files for gwmock-noise 0.18.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwmock-noise 0.18.1
File Size Uploaded Provenance Actions
gwmock_noise-0.18.1.tar.gz 1.7 MB Without provenance Details for gwmock_noise-0.18.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gwmock-noise 0.18.1
File Interpreter ABI Platform Actions
gwmock_noise-0.18.1-py3-none-any.whl Python 3 none any Details for gwmock_noise-0.18.1-py3-none-any.whl

Total release size: 3.0 MB

Release files / gwmock_noise-0.18.1.tar.gz

Download URL gwmock_noise-0.18.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9222c27eef3076316499367039ae559026ebca13d6ab9547446f8c2ee1d19db9
BLAKE2b-256 checksum
How to use checksums
4016b200aae5b62bba0e7a5da1a19c94e1b4e8084361e7a8865d5bf704bffdae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Release files / gwmock_noise-0.18.1-py3-none-any.whl

Download URL gwmock_noise-0.18.1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c7e2799d67911157d2186452a0838f07e74c494d5b2d682a0d0e3f45c311f8ef
BLAKE2b-256 checksum
How to use checksums
70ab3c631cf04cbe8cdbc03488b7da15d701c5ad4ab82cbbec6d65273260f586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Security for gwmock-noise 0.18.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.18.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page