zlw — Zero‑Latency Whitening utilities
zlw is a focused package for zero‑latency whitening in gravitational‑wave data analysis. It provides rigorous tools for:
- Whitening Kernels: Computing Minimum‑Phase (MP) filters that whiten data without introducing acausal latency.
- Perturbative Corrections: Geometric drift correction terms for the MP–MP scheme. These calculate the precise timing ($dt$) and phase ($d\phi$) biases introduced when the template PSD differs slightly from the real noise PSD.
Installation
pip install zlw
Structure
zlw.kernels: Construction of MP whitening filters and frequency response utilities.zlw.corrections: Perturbative MP–MP correction terms (PerturbativeMPCorrection).zlw.fourier,zlw.window: FFT and windowing backend helpers.zlw.bin: Simulation and QA scripts.
Part 3: Example 1 (Whitening Filters)
Quick Examples
1. Computing a Whitening Filter
from zlw.kernels import MPWhiteningFilter
# psd: One‑sided PSD array (Hz^-1)
# fs: Sampling rate (Hz)
# n_fft: FFT length (e.g., 4 * fs)
wf = MPWhiteningFilter(psd, fs, n_fft)
# Get the one‑sided complex frequency response
# This response is minimum-phase (causal)
Wf = wf.frequency_response()
2. Computing Perturbative Corrections
If your template PSD (psd2) differs from the actual noise PSD (psd1), you can calculate the resulting geometric
drift corrections.
import numpy as np
from zlw.corrections import PrtPsdDriftCorrection
# freqs: One‑sided frequency grid
# psd1: Realization/Noise PSD (The truth)
# psd2: Template PSD (The model)
# htilde: Template waveform (frequency domain)
corr = PrtPsdDriftCorrection(
freqs=freqs,
psd1=psd1,
psd2=psd2,
htilde=htilde,
fs=4096.0
)
# Calculate first-order geometric corrections
results = corr.correction()
print(f"Time Drift: {results.dt1:.4e} s")
print(f"SNR Loss: {results.dsnr1:.4f}")
Development
To install development dependencies and run the test suite (requires lalsuite):
# Install in editable mode with dev dependencies
pip install -e .[dev]
# Run tests
pytest
Metadata
Release files for zlw 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zlw-0.2.1.tar.gz | 73.8 kB | Without provenance | Details for zlw-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zlw-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for zlw-0.2.1-py3-none-any.whl |
Total release size: 127.6 kB
Release files / zlw-0.2.1.tar.gz
| Download URL | zlw-0.2.1.tar.gz |
|---|---|
| Size | 73.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4b26e88d6bf1cc7a5378ea62cc8cf19bdc52ff6652d601e357c34098dd53523
|
|
BLAKE2b-256 checksum How to use checksums |
f5533ccf3e96c6fe91d04292f0979eff23aede462d0a1a549d2b57017f5933e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.12
|
Release files / zlw-0.2.1-py3-none-any.whl
| Download URL | zlw-0.2.1-py3-none-any.whl |
|---|---|
| Size | 53.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df4bfb41071722da1cf5f993e28b633347a70a7bdd53c68796aec70bb18ecba6
|
|
BLAKE2b-256 checksum How to use checksums |
5fbb1a0ac8f6654b203a89e996cd69be872382fb217eac46c6993075010b71aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.12
|
Security for zlw 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.