mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-02-22 17:47:11 +00:00
Merge pull request #13 from DifferentiableUniverseInitiative/u/EiffL/lensing
U/eiff l/lensing
This commit is contained in:
commit
20fc4a5562
1 changed files with 4 additions and 5 deletions
|
@ -44,16 +44,13 @@ def density_plane(positions,
|
||||||
|
|
||||||
def convergence_Born(cosmo,
|
def convergence_Born(cosmo,
|
||||||
density_planes,
|
density_planes,
|
||||||
dx, dz,
|
|
||||||
coords,
|
coords,
|
||||||
z_source):
|
z_source):
|
||||||
"""
|
"""
|
||||||
Compute the Born convergence
|
Compute the Born convergence
|
||||||
Args:
|
Args:
|
||||||
cosmo: `Cosmology`, cosmology object.
|
cosmo: `Cosmology`, cosmology object.
|
||||||
density_planes: list of tuples (r, a, density_plane), lens planes to use
|
density_planes: list of dictionaries (r, a, density_plane, dx, dz), lens planes to use
|
||||||
dx: float, transverse pixel resolution of the density planes [Mpc/h]
|
|
||||||
dz: float, width of the density planes [Mpc/h]
|
|
||||||
coords: a 3-D array of angular coordinates in radians of N points with shape [batch, N, 2].
|
coords: a 3-D array of angular coordinates in radians of N points with shape [batch, N, 2].
|
||||||
z_source: 1-D `Tensor` of source redshifts with shape [Nz] .
|
z_source: 1-D `Tensor` of source redshifts with shape [Nz] .
|
||||||
name: `string`, name of the operation.
|
name: `string`, name of the operation.
|
||||||
|
@ -66,7 +63,9 @@ def convergence_Born(cosmo,
|
||||||
r_s = jax_cosmo.background.radial_comoving_distance(cosmo, 1 / (1 + z_source))
|
r_s = jax_cosmo.background.radial_comoving_distance(cosmo, 1 / (1 + z_source))
|
||||||
|
|
||||||
convergence = 0
|
convergence = 0
|
||||||
for r, a, p in density_planes:
|
for entry in density_planes:
|
||||||
|
r = entry['r']; a = entry['a']; p = entry['plane']
|
||||||
|
dx = entry['dx']; dz = entry['dz']
|
||||||
# Normalize density planes
|
# Normalize density planes
|
||||||
density_normalization = dz * r / a
|
density_normalization = dz * r / a
|
||||||
p = (p - p.mean()) * constant_factor * density_normalization
|
p = (p - p.mean()) * constant_factor * density_normalization
|
||||||
|
|
Loading…
Add table
Reference in a new issue