Skip to main content

A small jax package for differentiable and fast gravitational wave data analysis.

Project description

Ripple :ocean:

A small jax package for differentiable and fast gravitational wave data analysis.

Getting Started

Installation

Both waveforms have been tested extensively and match lalsuite implementations to machine precision across all the parameter space.

Ripple can be installed using

pip3 install ripplegw

Supported waveforms

  • IMRPhenomXAS (aligned spin)
  • IMRPhenomD (aligned spin)

Generating a waveform and its derivative

Generating a waveform is increadibly easy. Below is an example of calling the PhenomXAS waveform model to get the h_+ and h_x polarizations of the waveform model

We start with some basic imports:

import jax.numpy as jnp

from ripple.waveforms import IMRPhenomXAS
from ripple import ms_to_Mc_eta

And now we can just set the parameters and call the waveform!

# Get a frequency domain waveform
# source parameters

m1_msun = 20.0 # In solar masses
m2_msun = 19.0
chi1 = 0.5 # Dimensionless spin
chi2 = -0.5
tc = 0.0 # Time of coalescence in seconds
phic = 0.0 # Time of coalescence
dist_mpc = 440 # Distance to source in Mpc
inclination = 0.0 # Inclination Angle

# The PhenomD waveform model is parameterized with the chirp mass and symmetric mass ratio
Mc, eta = ms_to_Mc_eta(jnp.array([m1_msun, m2_msun]))

# These are the parametrs that go into the waveform generator
# Note that JAX does not give index errors, so if you pass in the
# the wrong array it will behave strangely
theta_ripple = jnp.array([Mc, eta, chi1, chi2, dist_mpc, tc, phic, inclination])

# Now we need to generate the frequency grid
f_l = 24
f_u = 512
del_f = 0.01
fs = jnp.arange(f_l, f_u, del_f)
f_ref = f_l

# And finally lets generate the waveform!
hp_ripple, hc_ripple = IMRPhenomXAS.gen_IMRPhenomXAS_polar(fs, theta_ripple, f_ref)

# Note that we have not internally jitted the functions since this would
# introduce an annoying overhead each time the user evaluated the function with a different length frequency array
# We therefore recommend that the user jit the function themselves to accelerate evaluations. For example:

import jax

@jax.jit
def waveform(theta):
    return IMRPhenomXAS.gen_IMRPhenomXAS_polar(fs, theta)

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

ripplegw-0.0.2.tar.gz (441.8 kB view details)

Uploaded Source

Built Distribution

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

ripplegw-0.0.2-py3-none-any.whl (436.6 kB view details)

Uploaded Python 3

File details

Details for the file ripplegw-0.0.2.tar.gz.

File metadata

  • Download URL: ripplegw-0.0.2.tar.gz
  • Upload date:
  • Size: 441.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for ripplegw-0.0.2.tar.gz
Algorithm Hash digest
SHA256 568c577448f8a62c6b05ac9a07afb8cab9c0d7d96dbfb117cd97f7e511d9a16c
MD5 bcf72db31df7fbfce5ad4dd59d4c3452
BLAKE2b-256 ef9875034940c3b44a813a814026550058b4b4730afb3254393359eb17a8abd5

See more details on using hashes here.

File details

Details for the file ripplegw-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ripplegw-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 436.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for ripplegw-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56e64c08cb27c4b311b6dbb08403feda10bcb928cd598ff13f547ac0db092467
MD5 c01997478ae5b0bd5e0545b68c7f9621
BLAKE2b-256 7cd4611a72ce33ed7d899337b6cb6b5d03b334b9fac1e6dae7328e319237e860

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