BAyesian HAmiltonian Montecarlo Analysis for Stochastic gravitational wave signal
Project description
BAHAMAS
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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a89fe4c2a5d670c9ac5042da965541de0247922daf4172ad8763d91e16e39f9f
|
|
| MD5 |
61c9843523a619155f544e6203e66fc4
|
|
| BLAKE2b-256 |
6d0403f69b3edf2a80b9a90f310e3bbe9e94e86739884ef6e85a0c503bb9a2a4
|
Provenance
The following attestation bundles were made for bahamas-0.1.2.tar.gz:
Publisher:
publish.yml on FedericoPozzoli/bahamas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bahamas-0.1.2.tar.gz -
Subject digest:
a89fe4c2a5d670c9ac5042da965541de0247922daf4172ad8763d91e16e39f9f - Sigstore transparency entry: 429735515
- Sigstore integration time:
-
Permalink:
FedericoPozzoli/bahamas@4e7d62454b7bdc388cc9fe929858411d060a1048 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/FedericoPozzoli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4e7d62454b7bdc388cc9fe929858411d060a1048 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7dda7df2518bd92dc275b75928bab2eef0ff7b669a5e02be9e00b29a0dabeb2
|
|
| MD5 |
8a1a34075b69a61b0bbd461c9bdf32ac
|
|
| BLAKE2b-256 |
cde3518964c9607e464621d7c576da08324b569cac06f08b60eb896e48efd9f2
|
Provenance
The following attestation bundles were made for bahamas-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on FedericoPozzoli/bahamas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bahamas-0.1.2-py3-none-any.whl -
Subject digest:
a7dda7df2518bd92dc275b75928bab2eef0ff7b669a5e02be9e00b29a0dabeb2 - Sigstore transparency entry: 429735538
- Sigstore integration time:
-
Permalink:
FedericoPozzoli/bahamas@4e7d62454b7bdc388cc9fe929858411d060a1048 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/FedericoPozzoli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4e7d62454b7bdc388cc9fe929858411d060a1048 -
Trigger Event:
push
-
Statement type: