Skip to main content

Tools for gravitational lensing and GW event analysis

Project description

GRaLE Gravitational-wave Lensing Explorer

IMG_3920

This package investigates whether gravitational wave events, such as GW170817 may have been gravitationally lensed by a foreground galaxy, by computing lensing-related quantities.


Requirements

  • Python 3.8+
  • numpy
  • matplotlib
  • astropy

What Problem the Project Aims to Solve

Gravitational wave signals, such as GW170817, may have been affected by gravitational lensing due to a nearby foreground galaxy (e.g., NGC 4993). Lensing could alter the apparent luminosity distance and energy signature of the event. This package aims to quantify and explore such effects and determine if the observed properties of GW170817 are consistent with a lensing scenario.


Expected Functionality

  • Calculate chirp mass from neutron star masses
  • Estimate true redshift from observed chirp mass
  • Compute luminosity distance from redshift using cosmology
  • Estimate magnification from true and observed distance
  • Compute Einstein radius from lens parameters
  • Estimate magnifying power of a galaxy
  • Provide visualizations for key lensing diagnostics

Why Each Piece of Functionality Is Needed

Function Purpose
chirp_mass() Calculates intrinsic property of the binary system
true_redshift() Infers redshift assuming lensing magnified the signal
luminosity_distance() Converts redshift to distance using cosmology
magnification() Determines how much brighter the event appears due to lensing
einstein_radius() Evaluates lens strength from velocity dispersion and geometry
magnifying_power() Calculates total lensing effect from galaxy-lens configuration

Expected Interfaces / Dependencies

GRaLE is a pure Python library that works in:

  • Jupyter notebooks
  • Python scripts
  • Scientific workflows or simulations

Dependencies:

  • numpy
  • matplotlib
  • astropy

🧑‍🚀 User Stories

Main Functionality

Story 1:
Will Robinson is lost in Space and needs to get to the origin of a Gravitational Wave Event, therefore he must calculate the true redshift of GW170817 using different combinations of neutron star masses, so he can explore if it was gravitationally lensed.

Story 2:
Robot is chasing after Will Robinson and to find him, he has to compute the Einstein radius and magnifying power of a potential lensing galaxy, so He can determine whether lensing is physically plausible in the case of GW170817 and find Will Robinson before he falls into a Wormhole._


⚠ Edge Cases

Story 3:
The Evil DR. Dofenschmirz also wants to catch Will and also calculates the lensing properties, but as he does encounter negative redshifts and infinite magnifications, the package raises a warning or an error, so he might get an advantage.

Story 4:
As a user, I want the lensing calculator to handle very small angular offsets and low velocity dispersions without crashing, so I can model weak lensing scenarios reliably.


Pseudocode Usage Examples

from grale import GWEvent, LensingCalculator
from astropy.cosmology import FlatLambdaCDM
import astropy.units as u

# SETUP
cosmo = FlatLambdaCDM(H0=67.9, Om0=0.3065)
z_lens = 0.0098
distance_mu1 = 40 * u.Mpc

# STEP 1: Create GWEvent with one m1, m2 pair (required)
event = GWEvent(m1=1.1, m2=1.5)

# Calculate chirp mass
chirp_mass = event.chirp_mass()
print(f"Chirp Mass: {chirp_mass:.3f} M_sun")

# Get M0 :
event.M0 


# Get redshift results over those mass ranges 
# Delta is the mass difference 
redshift_results = event.redshift_range(delta=0.5, step=0.01, z_lens=z_lens) 

z_lensed = redshift_results["plausible_redshifts_lensed"] #get an array of redshifts for later use

Documentation:

https://grale.readthedocs.io/en/main/index.html

License

This project is licensed under the MIT License. See the LICENSE file for more information.


Author

Shannon Schroeder

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

grale-1.0.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

grale-1.0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file grale-1.0.1.tar.gz.

File metadata

  • Download URL: grale-1.0.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for grale-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b4a83eac28b1770b59efefe56622a7c7a8022f516631c41bae62391b62f9a665
MD5 9140e7a49c4c033f83644dc57150eb26
BLAKE2b-256 3d8e0dce634af506bb806fff1885dee9feeea5a60d0f820b801642971543a811

See more details on using hashes here.

File details

Details for the file grale-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: grale-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for grale-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cc47cc728de18b7fca09246a88c0d720bfa44e2fb458f41e86f7a986ab7a697
MD5 0ed0035f70135f2bb4d53da496336f73
BLAKE2b-256 d68de55f53d64a96254b8817eea449090bc265190e917f65a41a6d268d49ad6b

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