Metadata-Version: 2.4
Name: wdm-wavelet
Version: 0.4.0
Summary: A Python package for Wilson-Daubechies-Meyer (WDM) wavelet from coherentWaveBurst
Home-page: https://git.ligo.org/yumeng.xu/wdm-wavelet
Author: Yumeng Xu
Author-email: The PycWB team <yumeng.xu@ligo.org>
Keywords: ligo,wavelet,gravitational waves,burst,DWT,WDM,Wilson-Daubechies-Meyer,cWB
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: numba
Requires-Dist: pyfftw
Requires-Dist: rocket-fft
Requires-Dist: gwpy
Requires-Dist: jax
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python

# WDM wavelet transform

This package hosts the python version of WDM wavelet used in coherentWaveBurst(cWB) search.

## Installation

```bash
pip install wdm-wavelet
```

## Example

Generate a timeseries waveform
```python
from pycbc.waveform import get_td_waveform
import matplotlib.pyplot as plt

hp, hc = get_td_waveform(approximant="IMRPhenomTPHM",
                         mass1=20,
                         mass2=20,
                         spin1z=0.9,
                         spin2z=0.4,
                         inclination=1.23,
                         coa_phase=2.45,
                         distance=100,
                         delta_t=1.0/2048,
                         f_lower=20)
```

Apply WDM wavelet transform
```python
from wdm_wavelet.wdm import WDM

wdm = WDM(32, 64, 6, 10, backend="jax")  # or backend="numba"

tf_map = wdm.t2w(hp)

tf_map.plot_energy()
```

Inverse WDM wavelet transform
```python
ts = wdm.w2t(tf_map)

plt.plot(ts)
```

Supported class backends: `"jax"` (default) and `"numba"`.
Both JAX and Numba are required installation dependencies.

For more examples, please refer to the [example notebook](https://git.ligo.org/yumeng.xu/wdm-wavelet/-/blob/main/notebook/transform_GW.ipynb).

## API docs

- [API usage guide](docs/api_usage_guide.md)
- [Explicit transform options](docs/execution_options.md)
- [Release integration assessment](docs/release_v1.0.0_review.md)

## Choosing a backend

```python
from wdm_wavelet.wdm import WDM

wdm = WDM(16, 16, 6, 10, backend="numba")  # or backend="jax"
```

The backend selects the forward and inverse transform kernels for each instance.
Numba executes on the CPU; JAX uses its configured device. Both implementations
are installed together, so changing backend requires no dependency changes.
Missing dependencies fail at import rather than silently selecting slower kernels.

`WDM.filter` remains a float64 JAX array for both backends, as in v0.3.1.
Numba wrappers convert inputs to NumPy arrays at the kernel boundary. NumPy
remains a dependency for array storage and numerical operations; it is not a
separate execution backend. Class inverse methods return GWpy `TimeSeries`.
