dsigma.stacking module

Module for stacking lensing results after pre-computation.

dsigma.stacking.boost_factor(table_l, table_r)

Compute the boost factor.

Boost factor is computed by comparing the number of lens-source pairs in real lenses and random lenses.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

table_rastropy.table.Table, optional

Precompute results for random lenses.

Returns
bnumpy.ndarray

Boost factor in each radial bin.

dsigma.stacking.excess_surface_density(table_l, table_r=None, photo_z_dilution_correction=False, boost_correction=False, scalar_shear_response_correction=False, matrix_shear_response_correction=False, shear_responsivity_correction=False, hsc_selection_bias_correction=False, random_subtraction=False, return_table=False)

Compute the mean excess surface density with corrections, if applicable.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

table_rastropy.table.Table, optional

Precompute results for random lenses. Default is None.

photo_z_dilution_correctionboolean, optional

If True, correct for photo-z biases. This can only be done if a calibration catalog has been provided in the Precomputation phase. Default is False.

boost_correctionboolean, optional

If true, calculate and apply a boost factor correction. This can only be done if a random catalog is provided. Default is False.

scalar_shear_response_correctionboolean or string, optional

Whether to correct for the multiplicative shear bias (scalar form). Default is False.

matrix_shear_response_correctionboolean or string, optional

Whether to correct for the multiplicative shear bias (tensor form). Default is False.

shear_responsivity_correctionboolean, optional

If True, correct for the shear responsivity. Default is False.

hsc_selection_bias_correctionboolean, optional

If True, correct for the multiplicative selection bias in HSC. Default is False.

random_subtractionboolean, optional

If True, subtract the signal around randoms. This can only be done if a random catalog is provided. Default is False.

return_tableboolean, optional

If True, return a table with many intermediate steps of the computation. Otherwise, a simple array with just the final excess surface density is returned. Default is False.

Returns
delta_sigmanumpy.ndarray or astropy.table.Table

The excess surface density in each radial bin specified in the precomputation phase. If return_table is True, will return a table with detailed information for each radial bin. The final result is in the column ds.

Raises
ValueError

If boost or random subtraction correction are requested but no random catalog is provided.

dsigma.stacking.matrix_shear_response_factor(table_l)

Compute the mean tangential response.

The tangential shear response factor:math:R_t is defined such that \(\gamma_{\mathrm obs} = R_t \gamma_{\mathrm intrinsic}\).

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
r_tnumpy.ndarray

Tangential shear response factor in each radial bin.

dsigma.stacking.mean_lens_redshift(table_l)

Compute the weighted-average lens redshift.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
z_lnumpy.ndarray

Mean lens redshift in each bin.

dsigma.stacking.mean_source_redshift(table_l)

Compute the weighted-average source redshift.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
z_snumpy.ndarray

Mean source redshift in each bin.

dsigma.stacking.number_of_pairs(table_l)

Compute the number of lens-source pairs per bin.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
n_pairsnumpy.ndarray

The number of lens-source pairs in each radial bin.

dsigma.stacking.photo_z_dilution_factor(table_l)

Compute the photometric redshift bias averaged over the entire catalog.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
f_biasfloat

Photometric redshift bias \(f_{\mathrm{bias}}\).

dsigma.stacking.raw_excess_surface_density(table_l)

Compute the raw, uncorrected excess surface density for a catalog.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
delta_sigmanumpy.ndarray

The raw, uncorrected excess surface density in each radial bin.

dsigma.stacking.raw_tangential_shear(table_l)

Compute the average tangential shear for a catalog.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
delta_sigmanumpy.ndarray

The raw, uncorrected tangential shear in each radial bin.

dsigma.stacking.scalar_shear_response_factor(table_l)

Compute the mean shear response.

The shear response factor \(m\) is defined such that \(\gamma_{\mathrm obs} = (1 + m) \gamma_{\mathrm intrinsic}\).

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
mnumpy.ndarray

Multiplicative shear bias in each radial bin.

dsigma.stacking.shear_responsivity_factor(table_l)

Compute the shear responsitivity factor.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

Returns
rnumpy.ndarray

Shear responsitivity factor in each radial bin.

dsigma.stacking.tangential_shear(table_l, table_r=None, boost_correction=False, scalar_shear_response_correction=False, matrix_shear_response_correction=False, shear_responsivity_correction=False, hsc_selection_bias_correction=False, random_subtraction=False, return_table=False)

Compute the mean tangential shear with corrections, if applicable.

Parameters
table_lastropy.table.Table

Precompute results for the lenses.

table_rastropy.table.Table, optional

Precompute results for random lenses. Default is None.

boost_correctionboolean, optional

If True, calculate and apply a boost factor correction. This can only be done if a random catalog is provided. Default is False.

scalar_shear_response_correctionboolean or string, optional

Whether to correct for the multiplicative shear bias (scalar form). Default is False.

matrix_shear_response_correctionboolean or string, optional

Whether to correct for the multiplicative shear bias (tensor form). Default is False.

shear_responsivity_correctionboolean, optional

If True, correct for the shear responsivity. Default is False.

hsc_selection_bias_correctionboolean, optional

If True, correct for the multiplicative selection bias in HSC. Default is False.

random_subtractionboolean, optional

If True, subtract the signal around randoms. This can only be done if a random catalog is provided. Default is False.

return_tableboolean, optional

If True, return a table with many intermediate steps of the computation. Otherwise, a simple array with just the final tangential shearis returned. Default is False.

Returns
e_tnumpy.ndarray or astropy.table.Table

The tangential shear in each radial bin specified in the precomputation phase. If return_table is True, will return a table with detailed information for each radial bin. The final result is in the column et.

Raises
ValueError

If boost or random subtraction correction are requested but no random catalog is provided.