Skip to main content

PoppinGW

Population Inference for GW detection

Installation

pip install poppingw

Usage

The whole workflow includes generating mock GW events, calculating likelihood $\mathcal{L}(\kappa,\iota|d)$ for each events ${d_i}$, and perform population inference on events with SNR larger than a certain threshold value $\rho_{\rm thr}$. An example script total_workflow.sh is provided to perform this whole procedure.

Preparation

Before run total_workflow.sh, you need to prepare the following npz files (generate them with numpy.savez):

  • result/pop.npz: defines parameterization for $\log\kappa$ distribution. We fit $p(\log\kappa)$ with spline interpolation funtion, the corresponding configurations should be stored in this file containing following keys:
    • control: $\log\kappa$ values on control points of interpolation, size $(L,)$ ($L$ is defined by user).
    • p_control: truth values of $p(\log\kappa)$ on control points, size $(L,)$.
    • range: lower and upper limit of $\log\kappa$, size $(2,)$.
  • result/likelihood/range.npz: defines limits of $\log\kappa$ and $\cos\iota$ grid for calculating likelihood. Should contain following keys:
    • log_kappa: limits of $\log\kappa$, size $(N,2)$, where $N$ is number of total events to calculate likelihood for.
    • cos_iota: limits of $\cos\iota$, size $(N,2)$.

Generate events

See sample_events.py. After running this script, one h5 file will be generated, which is the generated GW catalog.

Two independent catalogs are needed for population inference, one catalog "infer" as mocked observations, the other catalog "select" used for calculating detection rate during the inference. The two catalogs should have all parameters except $\kappa$ follwing the same distribution. Number of the "select" catalog should be at least four times of the "infer" catalog.

Calculate Likelihood

See match_filter_likelihood.py. Provide the "infer" catalog and configurations of the detector network (see detectors/ET_2CE_gwfast.json for an example) and $\log\kappa$ - $\cos\iota$ 2D grid, this script will calculate and store 2D log-likelihood $\log\mathcal{L}(\kappa,\iota|d)$ and 1D likelihood $\mathcal{L}(\kappa|d)$ for each event.

If range.npz is provided with argument --range-path, the log-likelihood is calculated on uniformly separated $\log\kappa,\cos\iota$ 2D grid. The grid size is defined by values of the arguments --dL-shape and --iota-shape, default to be $100\times 100$. Insteadly, you can also provide grid.npz through argument --grid-path, which defines $P\times Q$ grid for the events. grid.npz also contains keys log_kappa and cos_iota, shape os both are $(N,P,Q)$. If provided, the arguments --range-path, --dL-shape and --iota-shape will be ignored.

Population Inference

See infer_spl.py. "Infer" and "select" catalog, pop.npz, 1D kappa likelihood are needed.

You can pass the argument -disable-select to disable selection effect, letting all of the events to be included in the poopulation inference and the detection rate in the inference becomes constant unity.

Citation

Cite our work:

Improving the detection sensitivity to primordial stochastic gravitational waves with reduced astrophysical foregrounds. II. Subthreshold binary neutron stars, Arxiv:2403.01846 PhysRevD.111.023009

if you find this code useful to you.

Metadata

Release files for poppingw 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poppingw 0.1.0
File Size Uploaded
poppingw-0.1.0.tar.gz 10.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poppingw 0.1.0
File Interpreter ABI Platform
poppingw-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / poppingw-0.1.0.tar.gz

Download URL poppingw-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c99561bfe9be274079a048dbc00c8c4d2366b610040f1f52234cda59dd250556
BLAKE2b-256 checksum
How to use checksums
1fd783cf576271375ea4dc03a7af70763569ae0763153eac99f9ffa1dee657f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.10.0 Linux/3.10.0-862.el7.x86_64

Release files / poppingw-0.1.0-py3-none-any.whl

Download URL poppingw-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65c5bb3383b545f9841651e7303be511095c1e64a4ddf64e948058ccd68d6f18
BLAKE2b-256 checksum
How to use checksums
7f5fabd8ab7081efae1f751b67798552cf636c9b39397051d8f5484c92a614bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.10.0 Linux/3.10.0-862.el7.x86_64

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page