Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poppingw-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poppingw-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file poppingw-0.1.0.tar.gz.

File metadata

  • Download URL: poppingw-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.10.0 Linux/3.10.0-862.el7.x86_64

File hashes

Hashes for poppingw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c99561bfe9be274079a048dbc00c8c4d2366b610040f1f52234cda59dd250556
MD5 c948af23dbd904d488cff3fb017dc469
BLAKE2b-256 1fd783cf576271375ea4dc03a7af70763569ae0763153eac99f9ffa1dee657f1

See more details on using hashes here.

File details

Details for the file poppingw-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: poppingw-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.10.0 Linux/3.10.0-862.el7.x86_64

File hashes

Hashes for poppingw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65c5bb3383b545f9841651e7303be511095c1e64a4ddf64e948058ccd68d6f18
MD5 8e9ce85d840628cb05fb42f8e4e33dc0
BLAKE2b-256 7f5fabd8ab7081efae1f751b67798552cf636c9b39397051d8f5484c92a614bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page