dsigma.precompute module

Module for pre-computing lensing results.

dsigma.precompute.mean_photo_z_offset(z_l, table_c, cosmology, weighting=- 2, lens_source_cut=0)

Calculate the mean offset of source photometric redshifts.

Parameters
z_lfloat or numpy.ndarray

Redshift(s) of the lens.

table_castropy.table.Table, optional

Photometric redshift calibration catalog.

cosmologyastropy.cosmology

Cosmology to assume for calculations.

weightingfloat, 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.

lens_source_cutNone, float or numpy.ndarray, optional

Determine the lens-source redshift separation cut. If None, no cut is applied. If a float, determines the minimum redshift separation between lens and source redshift for lens-source pairs to be used. If an array, it has to be the same length as the source table and determines the maximum lens redshift for a lens-source pair to be used. Default is 0.

Returns
dzfloat or numpy.ndarray

The mean source redshift offset for the lens redshift(s).

dsigma.precompute.photo_z_dilution_factor(z_l, table_c, cosmology, weighting=- 2, lens_source_cut=0)

Calculate the photo-z delta sigma bias as a function of lens redshift.

Parameters
z_lfloat or numpy.ndarray

Redshift(s) of the lens.

table_castropy.table.Table

Photometric redshift calibration catalog.

cosmologyastropy.cosmology

Cosmology to assume for calculations.

weightingfloat, 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.

lens_source_cutNone, float or numpy.ndarray, optional

Determine the lens-source redshift separation cut. If None, no cut is applied. If a float, determines the minimum redshift separation between lens and source redshift for lens-source pairs to be used. If an array, it has to be the same length as the source table and determines the maximum lens redshift for a lens-source pair to be used. Default is 0.

Returns
f_biasfloat or numpy.ndarray

The photo-z bias factor, f_bias, for the lens redshift(s).

dsigma.precompute.precompute(table_l, table_s, bins, table_c=None, table_n=None, cosmology=FlatLambdaCDM(H0=100.0 km / (Mpc s), Om0=0.3, Tcmb0=0.0 K, Neff=3.04, m_nu=None, Ob0=None), comoving=True, weighting=-2, lens_source_cut=0, nside=256, n_jobs=1, progress_bar=False)

For all lenses in the catalog, precompute the lensing statistics.

Parameters
table_lastropy.table.Table

Catalog of lenses.

table_sastropy.table.Table

Catalog of sources.

binsnumpy.ndarray or u.quantity.Quantity

Bins in radius to use for the stacking. If a numpy array, bins are assumed to be in Mpc. If an astropy quantity, one can pass both length units, e.g. kpc and Mpc, as well as angular units, i.e. deg and rad.

table_castropy.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_nastropy.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. Default is None.

cosmologyastropy.cosmology, optional

Cosmology to assume for calculations. Default is a flat LambdaCDM cosmology with h=1 and Om0=0.3.

comovingboolean, optional

Whether to use comoving or physical quantities for radial bins (if given in physical units) and the excess surface density. Default is True.

weightingfloat, 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.

lens_source_cutNone, float or numpy.ndarray, optional

Determine the lens-source redshift separation cut. If None, no cut is applied. If a float, determines the minimum redshift separation between lens and source redshift for lens-source pairs to be used. If an array, it has to be the same length as the source table and determines the maximum lens redshift for a lens-source pair to be used. Default is 0.

nsideint, 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_jobsint, optional

Number of jobs to run at the same time. Default is 1.

progress_barboolean, option

Whether to show a progress bar for the main loop over lens pixels. Default is False.

Returns
table_lastropy.table.Table

Lens catalog with the pre-computation results attached to the table.

Raises
ValueError

If there are problems in the input.