bornraytrace package
bornraytrace.intrinsic_alignments module
- bornraytrace.intrinsic_alignments.D_1(z, om0)[source]
Normalised linear growth factor (D_plus)
- Parameters:
z – single redshift value or array values
om0 – matter density
- Returns:
normalised linear growth factor
- bornraytrace.intrinsic_alignments.D_single(z, om0)[source]
Provides the normalised linear growth factor
- Parameters:
z – single redshift value
om0 – matter density
- Returns:
normalised linear growth factor
- bornraytrace.intrinsic_alignments.E_sq(z, om0)[source]
A function giving Hubble’s law for flat cosmology
- Parameters:
z – redshift value
om0 – matter density
- Returns:
A value for the Hubble parameter
- bornraytrace.intrinsic_alignments.F_nla(z, om0, A_ia, rho_c1, eta=0.0, z0=0.0, lbar=0.0, l0=1e-09, beta=0.0)[source]
NLA intrinsic alignment amplitude
- Parameters:
z – redshift value
om0 – matter density
A_ia – amplitude parameter
rho_c1 – rho_crit x C1 (C1 approx 1.508e+27 cm3 / g)
eta – redshift dependence
z0 – arbitrary redshift pivot parameter
lbar – average luminosity of source galaxy population
l0 – arbitrary luminosity pivot parameter
beta – luminosity dependence
- Returns:
NLA F(z) amplitude
bornraytrace.lensing module
- bornraytrace.lensing.W_kernel(r_array, z_array, nz, simpsons=False)[source]
lensing kernel W s.t. kappa = prefactor * integral W(r) * overdensity(r) dr
- Parameters:
r_array – comoving distances array
z_array – redshift array matching r_array (cosmology dependent)
nz – source redshift distribution
simpsons – boolean to use simpsons integratio
- Returns:
W = r * q /r
- bornraytrace.lensing.get_neighbour_array(nside)[source]
array of indices labelling the 8 neighbouring pixels for each pixel
- Parameters:
nside – nside of map
- Returns:
neighbour indices array
- bornraytrace.lensing.kappa2shear(kappa_map, lmax, downsample_nside=None)[source]
Performs inverse Kaiser-Squires on the sphere with healpy spherical harmonics
- Parameters:
kappa_map – healpix format complex convergence (kappa) map
lmax – maximum multipole
downsample – option to downsample map output. A good compromise choice to reduce nside by half is: lmax=nside*2, downsample_nside=nside/2
- Returns:
complex shear map (gamma1 + 1j * gamma2)
- bornraytrace.lensing.kappa_prefactor(H0, om0, length_unit='Mpc')[source]
Gives prefactor (3 H_0^2 Om0)/2
- Parameters:
H0 – Hubble parameter with astropy units
om0 – Omega matter
length_unit – for H0 (default Mpc)
- Returns:
prefactor for lensing
- bornraytrace.lensing.peak_find(map_input, nside, neighbour_array=None)[source]
Find peaks (local maxima) for a given input map
- Parameters:
map_input – input map
nside – nside of map
neighbour_array – optional array of indices labelling the 8 neighbouring pixels for each pixel
- Returns:
list of pixel indices for the peaks
- bornraytrace.lensing.raytrace(H0, om0, overdensity_array, a_centre, comoving_edges, mask=None, Hubble_length_unit='Mpc')[source]
Evaluate weak lensing convergence map using Born approximation
- Parameters:
H0 – Hubble parameter with astropy units
om0 – Omega matter
overdensity_array – an 2D array of overdensity healpix maps in radial shells
a_centre – scale factor at comoving centre of shells
comoving_edges – comoving distance to edges of shells
mask – healpix map where 1 is observed and 0 is mask
length_unit – for H0 (default Mpc)
- Returns:
convergence kappa map
- bornraytrace.lensing.raytrace_integration(kappa_prefactor, overdensity_array, a_centre, comoving_edges, mask=None)[source]
This function evaluates the Born weak lensing integral
- Parameters:
kappa_prefactor – defined as the output of the function kappa_prefactor
overdensity_array – an 2D array of overdensity healpix maps in radial shells
a_centre – scale factor at comoving centre of shells
comoving_edges – comoving distance to edges of shells
mask – healpix map where 1 is observed and 0 is mask
- Returns:
convergence kappa map
- bornraytrace.lensing.recentre_nz(z_sim_edges, z_samp_centre, nz_input)[source]
Takes input n(z) sampled at z_samp_centre and evaluates interpolated n(z) at new z values to match a simulation at z_sim_edges
- Parameters:
z_sim_edges – new z values for n(z)
z_samp_centre – original z values for n(z)
nz_input – original n(z)
- Returns:
new n(z)
- bornraytrace.lensing.rotate_mask_approx(mask, rot_angles, flip=False)[source]
rotate healpix mask on sphere
- Parameters:
mask – healpix map of ones and zeros
rot_angles – rotation on the sphere (e.g. [ 45.91405291 ,150.72092269 , 46.34505909])
flip – boolean, mirror the mask
- Returns:
rotated map
- bornraytrace.lensing.shear2kappa(shear_map, lmax, upsample=False)[source]
Performs Kaiser-Squires on the sphere with healpy spherical harmonics
- Parameters:
shear_map – healpix format complex shear map
lmax – maximum ell multipole
upsample – option to upsample map for transforms to mitigate numerical errors
- Returns:
kappa map