Metadata-Version: 2.5
Name: ringdown
Version: 1.1.0
Summary: Bayesian analysis of black hole ringdowns in gravitational-wave data.
Project-URL: Homepage, https://github.com/maxisi/ringdown
Project-URL: Documentation, https://ringdown.readthedocs.io
Project-URL: Issues, https://github.com/maxisi/ringdown/issues
Author-email: Maximiliano Isi <max.isi@ligo.org>, "Will M. Farr" <will.farr@stonybrook.edu>
License: MIT License
        
        Copyright (c) 2021 Maximiliano Isi <max.isi@ligo.org>, Will M. Farr <will.farr@stonybrook.edu>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: <3.13,>=3.11
Requires-Dist: arviz~=0.19
Requires-Dist: h5py~=3.11
Requires-Dist: jax<0.6.1,>=0.4.25
Requires-Dist: jaxlib==0.4.38; sys_platform == 'darwin' and platform_machine == 'x86_64'
Requires-Dist: lalsuite==7.26.4
Requires-Dist: numpy==2.2.6
Requires-Dist: numpyro==0.19.0
Requires-Dist: pandas~=2.2
Requires-Dist: parse>=1.20
Requires-Dist: qnm==0.4.4
Requires-Dist: scipy<1.16,>=1.15
Requires-Dist: seaborn~=0.13
Requires-Dist: tables~=3.10
Provides-Extra: extra
Requires-Dist: gwpy==3.0.10; extra == 'extra'
Description-Content-Type: text/markdown

# ringdown

[![PyPI version](https://badge.fury.io/py/ringdown.svg)](https://badge.fury.io/py/ringdown)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/maxisi/ringdown/HEAD)
[![DOI](https://zenodo.org/badge/368680640.svg)](https://zenodo.org/badge/latestdoi/368680640)
![pytest](https://github.com/maxisi/ringdown/actions/workflows/python-app.yml/badge.svg?event=push)
[![Documentation Status](https://readthedocs.org/projects/ringdown/badge/?version=latest)](https://ringdown.readthedocs.io/en/latest/?badge=latest)

Bayesian analysis of black hole ringdowns.  The original paper that inspired this code package is [Isi, et al. (2019)](https://arxiv.org/abs/1905.00869); a full description of the code and method can be found in [Isi & Farr (2021)](https://arxiv.org/abs/2107.05609).

## Installation

This package is pip installable:

```shell
pip install ringdown
```

For the latest and greatest version, you can install directly from the git repo:

```shell
pip install git+https://github.com/maxisi/ringdown.git
```

Additionally, you may follow the [JAX documentation](https://jax.readthedocs.io/en/latest/installation.html) to install JAX with GPU support.

### Complete Environments

A complete [conda](https://docs.conda.io/en/latest/) environment that includes all the prerequisites (and more!) to install `ringdown` can be found in  `environment.yml` in the current directory:

```shell
conda env create -f environment.yml
conda activate ringdown
pip install ringdown
```

will leave the shell in an environment that includes `jupyterlab` ready to explore the `ringdown` package.  

The `environment.yml` file enables running `ringdown` in JupyterHub services like [MyBinder](https://mybinder.org/) by pointing MyBinder at this repository or clicking the button at the top of this README.

## Examples and tips

See the [example gallery](https://ringdown.readthedocs.io/en/latest/gallery.html) in the docs for several examples. You can download the Jupyter notebooks featured in the docs from the `docs/examples`.

### Performance notes

In order to run Jax on a CPU with four cores and use double precision, you can do the following at the top of your script:
```python
# disable numpy multithreading to avoid conflicts
# with jax multiprocessing in numpyro
import os
os.environ["OMP_NUM_THREADS"] = "1"

# set jax up to use double precision
from jax import config
config.update("jax_enable_x64", True)

# import numpyro and set it up to use 4 CPU devices
import numpyro
numpyro.set_host_device_count(4)
numpyro.set_platform('cpu')
```

To run on a GPU with single precision you can instead do:
```python
# set jax to use single precision (this is the default so no need to run the lines below)
# from jax import config
# config.update("jax_enable_x64", False)

# import numpyro and set it up to use 4 CPU devices
import numpyro
numpyro.set_platform('gpu')
```

You will see significant performance enhancements when running ona GPU with 32-bit precision. If you have multiple GPUs, `numpyro` can use them in parallel to run different chains, just as with CPUs. Sampling one chain for a GW150914-like system takes O(s) on an Nvidia A100 GPU.

⚠️ _Caveat emptor:_ depending on the autocovariance function (ACF), using `float32` can cause numerical problems when computing the likelihood; _ringdown_ will automatically rescale the strain in an attempt to prevent this, but you should use this feature at your own risk.

## Citations

We ask that scientific users of this code cite the corresponding Zenodo entry (see blue DOI badge above), as well as [Isi & Farr (2021)](https://arxiv.org/abs/2107.05609):

```bibtex
@article{Isi:2021iql,
    author = "Isi, Maximiliano and Farr, Will M.",
    title = "{Analyzing black-hole ringdowns}",
    eprint = "2107.05609",
    archivePrefix = "arXiv",
    primaryClass = "gr-qc",
    reportNumber = "LIGO-P2100227",
    month = "7",
    year = "2021"
}
```
