cosmodc2_raytracer#

Raytracing module for CosmoDC2

Module Contents#

Classes#

CosmoDC2Raytracer

Raytracing tool for postprocessing the lensing distortion in CosmoDC2

class cosmodc2_raytracer.CosmoDC2Raytracer(in_dir, out_dir, fov, n_kappa_samples, healpix, seed, approx_z_src=2.0, mass_cut=11, n_sightlines=1000, kappa_sampling_dir=None, debug=False)[source]#

Bases: n2j.trainval_data.raytracers.base_raytracer.BaseRaytracer

Raytracing tool for postprocessing the lensing distortion in CosmoDC2

NSIDE = 32[source]#
LENSING_NSIDE = 4096[source]#
KAPPA_DIFF = 1.0[source]#
COLUMN_NAMING[source]#
TO_200C = 0.85[source]#
_set_column_names()[source]#

Set column names to be stored

get_pointings_iterator(columns=None, chunksize=100000)[source]#

Get an iterator over the galaxy catalog defining the pointings

get_halos_iterator(columns=None, chunksize=100000)[source]#

Get an iterator over the halo catalog defining our line-of-sight halos

_get_pointings()[source]#

Gather pointings defining our sightlines

_get_pointings_on_grid(dist_thres)[source]#

Get the pointings on a grid of healpixes

Parameters#

dist_thresfloat

matching threshold between gridpoints and halo positions, in deg

Notes#

Currently takes 1.2 min for 1000 sightlines. Doesn’t have to be so rigorous about finding sightlines closest to grid. Two requirements are that sightlines need to be dominated by cosmic variance (span a few degrees) and that each sightline has a galaxy.

get_los_halos(i, ra_los, dec_los, z_src, galaxy_id_los)[source]#

Compile halos in the line of sight of a given galaxy

single_raytrace(i)[source]#

Raytrace through a single sightline

sample_kappas(i, lens_model, halos)[source]#

Render the halos in uniformly random locations within the aperture to sample the kappas. The mean of sampled kappas will be used as an estimate of the additional average kappa contribution of our halos

parallel_raytrace(n_cores)[source]#

Raytrace through multiple sightlines in parallel