silmarel.utils.gw_lensing module¶
Tools to lens gravitational wave using Lenstronomy setup/models.
- silmarel.utils.gw_lensing.dummy_array(shape, likelihood)¶
Return an array of -inf using jax.numpy or numpy depending on likelihood.
- silmarel.utils.gw_lensing.lens_gw(pointmodel: Any | None, pointkwargs: list[dict], massmodel: Any, lenskwargs: list[dict], z_l: float, z_s: float, H0: float = 70, n_images: float | None = None, likelihood: str = 'lenstronomy') dict¶
Function to simulate a lensed gravitational wave.
- Parameters:
pointmodel (Any) – Herculens PointSource model for GW.
pointkwargs (list) – List-wrapped dictionary with GW ra, dec.
massmodel (Any) – Herculens MassModel/Lenstronomy LensModel object.
lenskwargs (list) – Herculens/Lenstronomy lens parameters.
z_l (float) – Lens redshift.
z_s (float) – Source redshift.
H0 (float, optional) – Hubble constant (default is 70)
n_images (int or float or None, optional) –
Number of images to compare against. - If None: returns the normal GW dictionary. - If float: checks if length of GW parameters matches data.
If not, returns a dummy dictionary without values.
likelihood (str, optional) – If ‘herculens’, uses Herculens; else uses Lenstronomy.
- Returns:
Dictionary with time delays, relative magnifications, image positions, source position, effective luminosity distance.
- Return type:
dict
- silmarel.utils.gw_lensing.tdd(z_l: float, z_s: float, cosmo: Any) Any¶
Obtain time delay distance constant for given parameters.
- Parameters:
z_lens (float) – Lens redshift
z_source (float) – Source redshift
H0 (float) – Hubble constant for chosen cosmology
- Returns:
Time delay distance value.
- Return type:
float