asimov-bayeswave

BayesWave pipeline integration for Asimov

Maintained by the asimov team PyPI 0.2.0 Beta

asimov-bayeswave

Tests Documentation Status PyPI version License: MIT

BayesWave pipeline integration for Asimov.

This package provides a plugin for Asimov 0.7+ that enables integration with the BayesWave parameter estimation pipeline for gravitational wave data analysis.

Features

  • ๐Ÿ”Œ Plugin Architecture: Seamlessly integrates with Asimov via entry points
  • ๐Ÿ“Š PSD Generation: Automatic power spectral density estimation and collection
  • ๐Ÿ”„ Format Conversion: Converts PSDs to XML format for use with other pipelines (where convert_psd_ascii2xml is available โ€” see "Operational notes" below)
  • ๐Ÿš€ Scheduler-agnostic: Automated DAG generation and job submission via Asimov's HTCondor/Slurm scheduler API
  • ๐Ÿ“ˆ Result Collection: Automatic collection of megaplot outputs and visualizations
  • ๐ŸŽฏ PSD Suppression: Support for suppressing frequency bands in PSDs
  • ๐Ÿงช Well Tested: Unit tests plus a genuine end-to-end test (real bayeswave_pipe DAG generation and HTCondor execution โ€” BayesWave, BayesWavePost, megaplot.py โ€” against real GW150914 H1 GWOSC strain, waiting for a real, parseable glitch_median_PSD_forLI_H1.dat, not a smoke test)

Installation

Via Asimov (Recommended)

If you have asimov 0.7+, you can install gravitational wave pipelines including bayeswave with:

pip install asimov[gw]

This will automatically install asimov-bayeswave and other GW analysis plugins.

From PyPI (when released)

pip install asimov-bayeswave

From Source

git clone https://github.com/transientlunatic/asimov-bayeswave.git
cd asimov-bayeswave
pip install -e .

For Development

pip install -e ".[docs,test]"

Quick Start

Once installed, the BayesWave pipeline is automatically available in Asimov. To add a new bayeswave analysis you can create a blueprint YAML file like the following:

kind: analysis
pipeline: bayeswave
comment: PSD generation with BayesWave
likelihood:
  sample rate: 2048
  segment length: 8
data:
  channels:
    H1: H1:GDS-CALIB_STRAIN
    L1: L1:GDS-CALIB_STRAIN
quality:
  minimum frequency:
    H1: 20
    L1: 20

Usage

Via Asimov CLI

# Build the DAG
asimov manage build --production Prod0

# Submit the job
asimov manage submit --production Prod0

# Monitor progress
asimov manage monitor

Via Python API

from asimov_bayeswave import BayesWave

# Create pipeline instance
pipeline = BayesWave(production)

# Build and submit
pipeline.build_dag()
pipeline.submit_dag()

# Collect results after completion
assets = pipeline.collect_assets()
psds = assets["psds"]
xml_psds = assets["xml psds"]

Requirements

  • Python >= 3.9
  • asimov >= 0.7.0
  • numpy
  • BayesWave (must be installed separately) โ€” via conda-forge:
    conda install -c conda-forge bayeswave bayeswaveutils
    bayeswave ships the compiled samplers (BayesWave, BayesWavePost, ...); bayeswave_pipe (the DAG-generation script this plugin's build_dag() shells out to) and megaplot.py/megasky.py come from the separate bayeswaveutils package. Unlike the sibling asimov-lalinference plugin, no numpy<2 pin is needed โ€” the current conda-forge bayeswaveutils build's megaplot.py has already been patched for numpy 2.0.

Operational notes

convert_psd_ascii2xml is not available from public conda-forge packages

after_completion() tries to convert each ascii-format PSD to XML via a convert_psd_ascii2xml executable. As of this writing that tool is not shipped by any current public conda-forge package โ€” bayeswave, bayeswaveutils, lalinference and lalapps were all checked while building this plugin's end-to-end test, and none of them provide it (it may only exist in older or IGWN-internal environments). bayeswave does ship a BayesWaveToLALPSD executable that looks like a plausible modern replacement, but its calling convention (positional run name, requires --gnuplot output enabled during the original run, reads specific paths under waveforms/) is substantially different and has not been validated here.

This is handled gracefully rather than worked around: after_completion() catches the resulting PipelineException, logs it, and continues on to store the ascii-format PSD via store_assets() regardless (see collect_assets()["psds"]). If your environment does have a working convert_psd_ascii2xml, XML-format PSD conversion and storage will work as documented above with no changes needed. If not, downstream pipelines that specifically need an XML-format PSD (rather than the ascii format) won't get one from this plugin until someone wires up BayesWaveToLALPSD (or an equivalent) as a real replacement.

Documentation

Full documentation is available at asimov-bayeswave.readthedocs.io.

Building Documentation Locally

cd docs
make html

The built documentation will be in docs/build/html/.

Testing

Run the unit test suite with:

pytest

For coverage reporting:

pytest --cov=asimov_bayeswave --cov-report=html

End-to-end test

.github/workflows/e2e.yml runs a genuine end-to-end test on real GitHub Actions infrastructure: a real bayeswave_pipe DAG (BayesWave clean run -> BayesWavePost -> megaplot.py), submitted to and run by a real (disposable, in-container) HTCondor pool, against real (trimmed, ~32s) GW150914 H1 GWOSC strain vendored into tests/test_data/frames/. It waits for and validates a genuine, parseable glitch_median_PSD_forLI_H1.dat โ€” the same file detect_completion()/collect_assets() themselves look for โ€” not just "the DAG was submitted", and separately checks that a production reaches a genuinely finished/uploaded state and that the missing convert_psd_ascii2xml tool (see "Operational notes" above) is handled gracefully. It's what found several of the real bugs described in CHANGELOG.md.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • All tests pass
  • New features include tests
  • Documentation is updated
  • Code follows PEP 8 style guidelines

Migration from Asimov 0.6

If you're upgrading from Asimov 0.6 which included BayesWave support natively:

  1. Install this plugin: pip install asimov-bayeswave
  2. The plugin will be automatically discovered by Asimov 0.7+
  3. No changes to your configuration files are required

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors

Acknowledgments

  • The LIGO Scientific Collaboration
  • The BayesWave development team
  • The Asimov development team

Citation

If you use this software in your research, please cite:

@software{asimov_bayeswave,
  author = {Williams, Daniel},
  title = {asimov-bayeswave: BayesWave integration for Asimov},
  url = {https://github.com/transientlunatic/asimov-bayeswave},
  year = {2026}
}

Support

For issues, questions, or contributions, please use the GitHub issue tracker.

This page is generated from the package's own README and metadata. To change it, update the repository or the package's PyPI metadata.