Skip to main content

Parameter estimation of gravitational wave sources

Project description

cogwheel

cogwheel is a code for parameter estimation of gravitational wave sources. It implements a convenient system of coordinates for sampling, a "folding" algorithm to reduce the multimodality of posteriors, and the relative binning algorithm for fast likelihood evaluation (generalized to waveforms with higher modes). It supports likelihood marginalization over distance, as well as over all extrinsic parameters describing a merger. It interfaces with third-party routines for downloading public data (GWOSC, GWpy), generating waveforms (lalsuite) and sampling distributions (PyMultiNest, dynesty, zeus, nautilus).

References

Installation

conda install -c conda-forge cogwheel-pe

Crash course

Example: how to sample a gravitational wave source posterior using Nautilus:

from cogwheel import data
from cogwheel import sampling
from cogwheel.posterior import Posterior

parentdir = 'example'  # Directory that will contain parameter estimation runs

eventname, mchirp_guess = 'GW150914', 30
approximant = 'IMRPhenomXPHM'
prior_class = 'CartesianIntrinsicIASPrior'

filenames, detector_names, tgps = data.download_timeseries(eventname)
event_data = data.EventData.from_timeseries(
    filenames, eventname, detector_names, tgps)

post = Posterior.from_event(event_data, mchirp_guess, approximant, prior_class)

sampler = sampling.Nautilus(post, run_kwargs=dict(n_live=1000))

rundir = sampler.get_rundir(parentdir)
sampler.run(rundir)  # Will take a while

Load and plot the samples:

import matplotlib.pyplot as plt
import pandas as pd
from cogwheel import gw_plotting

samples = pd.read_feather(rundir/sampling.SAMPLES_FILENAME)
gw_plotting.CornerPlot(samples,
                       params=sampler.sampled_params,
                       tail_probability=1e-4).plot()
plt.savefig(rundir/f'{eventname}.pdf', bbox_inches='tight')

Documentation

https://cogwheel.readthedocs.io/en/latest/index.html

Acknowledgment

This package is based upon work supported by the National Science Foundation under PHY-2012086, and PHY-1748958.

Any opinions, findings, and conclusions or recommendations expressed in cogwheel are those of the authors and do not necessarily reflect the views of the National Science Foundation.

This research has made use of data or software obtained from the Gravitational Wave Open Science Center (gw-openscience.org), a service of LIGO Laboratory, the LIGO Scientific Collaboration, the Virgo Collaboration, and KAGRA. LIGO Laboratory and Advanced LIGO are funded by the United States National Science Foundation (NSF) as well as the Science and Technology Facilities Council (STFC) of the United Kingdom, the Max-Planck-Society (MPS), and the State of Niedersachsen/Germany for support of the construction of Advanced LIGO and construction and operation of the GEO600 detector. Additional support for Advanced LIGO was provided by the Australian Research Council. Virgo is funded, through the European Gravitational Observatory (EGO), by the French Centre National de Recherche Scientifique (CNRS), the Italian Istituto Nazionale di Fisica Nucleare (INFN) and the Dutch Nikhef, with contributions by institutions from Belgium, Germany, Greece, Hungary, Ireland, Japan, Monaco, Poland, Portugal, Spain. KAGRA is supported by Ministry of Education, Culture, Sports, Science and Technology (MEXT), Japan Society for the Promotion of Science (JSPS) in Japan; National Research Foundation (NRF) and Ministry of Science and ICT (MSIT) in Korea; Academia Sinica (AS) and National Science and Technology Council (NSTC) in Taiwan.

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

cogwheel_pe-1.5.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

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

cogwheel_pe-1.5.0-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file cogwheel_pe-1.5.0.tar.gz.

File metadata

  • Download URL: cogwheel_pe-1.5.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cogwheel_pe-1.5.0.tar.gz
Algorithm Hash digest
SHA256 0841e189b1d75dee2aa026401993e76c56e1bfffc7338f398e6f57659b42f974
MD5 297a5b14ba7750579f4d9d9206b6fb23
BLAKE2b-256 7af42cf97162f2b5a0c6a306a7c6641134244fa5d732d2fee040535fc4df287d

See more details on using hashes here.

File details

Details for the file cogwheel_pe-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: cogwheel_pe-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for cogwheel_pe-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 896925798dab4b4f141d6bb619910813491d5513e293e3e92365c22deff0bf8a
MD5 b25e28416d0259092a99795158b392c1
BLAKE2b-256 c40768569c10e34baaa425f248400afac286cd9a4e18bd0a9afb2d82cc984528

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