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, 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_correctionbool, 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_correctionbool, 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_correctionbool or string, optional
Whether to correct for the multiplicative shear bias (scalar form). Default is False.
- matrix_shear_response_correctionbool or string, optional
Whether to correct for the multiplicative shear bias (tensor form). Default is False.
- shear_responsivity_correctionbool, optional
If True, correct for the shear responsivity. Default is False.
- selection_bias_correctionbool, optional
If True, correct for the multiplicative selection bias in, e.g., HSC. Default is False.
- random_subtractionbool, optional
If True, subtract the signal around randoms. This can only be done if a random catalog is provided. Default is False.
- return_tablebool, 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.lens_magnification_bias(table_l, alpha_l, camb_results, photo_z_dilution_correction=False, shear=False)¶
Estimate the additive lens magnification bias.
- Parameters:
- table_lastropy.table.Table
Precompute results for the lenses.
- alpha_lfloat
The response of the lenses to magnification.
- camb_resultscamb.results.CAMBdata
CAMB results object that contains information on cosmology and the matter power spectrum.
- photo_z_dilution_correctionbool, optional
If True, correct the mean critical surface density for photo-z biases. Not used if shear is True. This should be consistent with what is used for calculating the total excess surface density. Default is False.
- shearbool, optional
If True, return bias of the mean tangential shear. Otherwise, return an estimate for the bias of the excess surface density. Default is False.
- Returns:
- ds_lmnumpy.ndarray
The lens magnification bias in each radial bin.
- 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_critical_surface_density(table_l, photo_z_dilution_correction=False)¶
Compute the weighted-average (effective) critical surface density.
- Parameters:
- table_lastropy.table.Table
Precompute results for the lenses.
- photo_z_dilution_correctionbool, 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.
- Returns:
- sigma_critnumpy.ndarray
Mean (effective) critical surface density.
- 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, selection_bias=False)¶
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.
- selection_biasbool
If True, calculate the selection bias \(m_\mathrm{sel}\), instead. Default is False.
- 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, 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_correctionbool, 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_correctionbool or string, optional
Whether to correct for the multiplicative shear bias (scalar form). Default is False.
- matrix_shear_response_correctionbool or string, optional
Whether to correct for the multiplicative shear bias (tensor form). Default is False.
- shear_responsivity_correctionbool, optional
If True, correct for the shear responsivity. Default is False.
- selection_bias_correctionbool, optional
If True, correct for the multiplicative selection bias in, e.g., HSC. Default is False.
- random_subtractionbool, optional
If True, subtract the signal around randoms. This can only be done if a random catalog is provided. Default is False.
- return_tablebool, 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.