dsigma.precompute module¶
Module for pre-computing lensing results.
- dsigma.precompute.mean_photo_z_offset(z_l, table_c, cosmology=None, weighting=-2)[source]¶
Calculate the mean offset of source photometric redshifts.
- Parameters:
- z_l
floatornumpy.ndarray Redshift(s) of the lens.
- table_c
astropy.table.Table Photometric redshift calibration catalog.
- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- weighting
float,optional The exponent of weighting of each lens-source pair by the critical surface density. A natural choice is -2 which minimizes shape noise. Default is -2.
- z_l
- Returns:
- dz
floatornumpy.ndarray The mean source redshift offset for the lens redshift(s).
- dz
- dsigma.precompute.photo_z_dilution_factor(z_l, table_c, cosmology=None, weighting=-2)[source]¶
Calculate the photo-z delta sigma bias as a function of lens redshift.
- Parameters:
- z_l
floatornumpy.ndarray Redshift(s) of the lens.
- table_c
astropy.table.Table Photometric redshift calibration catalog.
- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- weighting
float,optional The exponent of weighting of each lens-source pair by the critical surface density. A natural choice is -2 which minimizes shape noise. Default is -2.
- z_l
- Returns:
- f_bias
floatornumpy.ndarray The photo-z bias factor, \(f_{\rm bias}\), for the lens redshift(s).
- f_bias
- dsigma.precompute.precompute(table_l, table_s, bins, table_c=None, table_n=None, cosmology=None, comoving=True, weighting=-2, nside=256, n_jobs=1, progress_bar=False)[source]¶
For all lenses in the catalog, precompute the lensing statistics.
- Parameters:
- table_l
astropy.table.Table Catalog of lenses.
- table_s
astropy.table.Table Catalog of sources.
- bins
numpy.ndarrayorastropy.units.quantity.Quantity Bins in radius to use for the stacking. If a numpy array, bins are assumed to be in Mpc/h. If an astropy quantity, one can pass both length units, e.g. Mpc and Mpc/h, as well as angular units, i.e. deg and rad.
- table_c
astropy.table.Table,optional Additional photometric redshift calibration catalog. If provided, this will be used to statistically correct the photometric source redshifts and critical surface densities. Default is
None.- table_n
astropy.table.Table,optional Source redshift distributions. If provided, this will be used to compute mean source redshifts and critical surface densities. These mean quantities would be used instead the individual photometric redshift estimates. The table needs to have a z column giving the redshift and a n column with the \(n(z)\) for all samples. Default is
None.- cosmology
astropy.cosmologyorNone,optional Cosmology to assume for calculations. If
None, usedsigma.default_cosmology. Default isNone.- comovingbool,
optional Whether to use comoving or physical quantities for radial bins (if given in physical units) and the excess surface density. Default is
True.- weighting
float,optional The exponent of weighting of each lens-source pair by the critical surface density. A natural choice is -2 which minimizes shape noise. Default is -2.
- nside
int,optional dsigma uses pixelization to group nearby lenses together and process them simultaneously. This parameter determines the number of pixels. It has to be a power of 2. May impact performance. Default is 256.
- n_jobs
int,optional Number of jobs to run at the same time. Default is 1.
- progress_barbool,
optional Whether to show a progress bar for the main loop over lens pixels. Default is
False.
- table_l
- Returns:
- table_l
astropy.table.Table Lens catalog with the pre-computation results attached to the table.
- table_l
- Raises:
ValueErrorIf there are problems in the input.