Skip to main content

BAyesian HAmiltonian Montecarlo Analysis for Stochastic gravitational wave signal

Project description

BAHAMAS

JOSS draft Tests Documentation Status DOI

Bahamas: BAyesian inference with HAmiltonian Montecarlo for Astrophysical Stochastic background.

BAHAMAS is a Python package for the inference of stochastic gravitational wave background signals (SGWB) using Hamiltonian Markov Chain Monte Carlo (HMCMC) as implemented in NumPyro, which relies on JAX for automatic differentiation and JIT compilation to GPU/CPU.
BAHAMAS is under active development, so be aware of potential brittleness, bugs, and changes to the API as the design evolves. Documentation available at: Bahamas docs

Features

The package includes two main command-line interfaces:

  • bahamas_data: Data simulation and preprocessing.

  • bahamas_inference: Parameter estimation and minimal diagnostics

  • bahamas_input: From LISA data challange dataset (e.g. yorsh) to bahamas

Both scripts require two input files:

  • --config config.yaml: Specifies the simulation and inference settings, sampler configuration, and output paths.

  • --sources sources.yaml: Defines the sources to be injected and/or recovered. This includes the true physical parameters of the sources as well as the prior ranges used for inference.

The data consist of two datastreams—the A and E channels—which are specific combinations of Time-Delay Interferometry (TDI) variables. In bahamas, the data are generated in the frequency domain, chunk by chunk. This represents a simplification, as it neglects potential biases arising in the time domain, such as windowing effects and spectral leakage. The duration of each chunk—and consequently the frequency resolution—can be configured via config.yaml. However, we recommend not using time lengths shorter than $10^4 \mathrm{s}$, which corresponds to a frequency resolution of approximately $\Delta f \sim 0.1 \mathrm{mHz}$, below which the characterization of LISA's instrumental noise is not guaranteed.

The algorithm also allows for the analysis of stationary, isotropic, and Gaussian stochastic process (e.g., a signal characterized by a power-law power spectral density), enabling the evaluation of the impact of multiple overlapping sources.

We also provide the option to include data gaps, which represent periods during the mission when no useful data are available. These gaps can occur due to scheduled maintenance (scheduled gaps) or unforeseen hardware issues (unscheduled gaps). The goal is not to mitigate the impact of these interruptions but rather to characterize their effect on the reconstruction of stochastic signals.

The algorithm provides flexibility to perform analyses with either full-resolution data or coarse-grained data over different chunks. In the former case, the likelihood describing the data follows a Whittle distribution in each segment, while in the latter, it collapses to a Gamma distribution with degrees of freedom equal to the number of bins used in the averaging process.

Sources

This plot shows the types of signals you can simulate using bahamas. The galactic foreground can be generated and analyzed in both stationary and non-stationary assumption.

SGWB Landscape in bahamas

Notebooks

In the data folder, you can find two example notebooks:

  • example_bahamas: A minimal example demonstrating how to use bahamas.

  • example_modulation: This notebook shows how the modulation model implemented in bahamas accounts for the non-stationarity of the galactic foreground. Feel free to play with the parameters and observe how the modulation changes!

Installation

You can install BAHAMAS from source:

git clone https://github.com/fede121/bahamas.git
cd bahamas
pip install .

or directly from the PyPI package available here

pip install bahamas

License

This project is open-source and available under the Apache License 2.0.


For more information, examples, or to contribute, please visit the GitHub repository.

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

bahamas-0.1.2.tar.gz (42.6 kB view details)

Uploaded Source

Built Distribution

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

bahamas-0.1.2-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file bahamas-0.1.2.tar.gz.

File metadata

  • Download URL: bahamas-0.1.2.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bahamas-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a89fe4c2a5d670c9ac5042da965541de0247922daf4172ad8763d91e16e39f9f
MD5 61c9843523a619155f544e6203e66fc4
BLAKE2b-256 6d0403f69b3edf2a80b9a90f310e3bbe9e94e86739884ef6e85a0c503bb9a2a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bahamas-0.1.2.tar.gz:

Publisher: publish.yml on FedericoPozzoli/bahamas

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bahamas-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bahamas-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bahamas-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a7dda7df2518bd92dc275b75928bab2eef0ff7b669a5e02be9e00b29a0dabeb2
MD5 8a1a34075b69a61b0bbd461c9bdf32ac
BLAKE2b-256 cde3518964c9607e464621d7c576da08324b569cac06f08b60eb896e48efd9f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bahamas-0.1.2-py3-none-any.whl:

Publisher: publish.yml on FedericoPozzoli/bahamas

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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