clmm.support.mock_data module

Functions to generate mock source galaxy distributions to demo lensing code

clmm.support.mock_data.generate_galaxy_catalog(cluster_m, cluster_z, cluster_c, cosmo, zsrc, cluster_ra=0.0, cluster_dec=0.0, delta_so=200, massdef='mean', halo_profile_model='nfw', zsrc_min=None, zsrc_max=7.0, field_size=8.0, shapenoise=None, mean_e_err=None, photoz_sigma_unscaled=None, nretry=5, ngals=None, ngal_density=None, pz_bins=101, pzpdf_type='shared_bins', validate_input=True)[source]

Generates a mock dataset of sheared background galaxies.

We build galaxy catalogs following a series of steps.

1. Draw true redshifts of the source galaxy population. This step is described by the parameters zsrc and zsrc_max. zsrc can be a float in which case every source is at the given redshift or a str describing a specific model to use for the source distribution. Currently, the only supported model for source galaxy distribution is that of Chang et al. 2013 arXiv:1305.0793. When a model is used to describe the distribution, zsrc_max is the maximum allowed redshift of a source galaxy.

2. Apply photometric redshift errors to the source galaxy population. This step is described by the parameter photoz_sigma_unscaled. If this parameter is set to a float, we add Gaussian uncertainty to the source redshift

\[z \sim \mathcal{N}\left(z^{\rm true}, \sigma_{\rm photo-z}^{\rm unscaled}(1+z^{\rm true}) \right)\]

We additionally include two columns in the output catalog, pzbins and pzpdf which desribe the photo-z distribution as a Gaussian centered at \(z^{\rm true}\) with a width \(\sigma_{\rm photo-z} = \sigma_{\rm photo-z}^{\rm unscaled}(1+z^{\rm true})\)

If photoz_sigma_unscaled is None, the z column in the output catalog is the true redshift.

3. Draw galaxy positions. Positions are drawn in a square box around the lens position (with a default side length of 8 Mpc) at the lens redhsift. We then convert to right ascension and declination using the cosmology defined in cosmo.

4. We predict the reduced tangential shear of each using the radial distances of each source from the lens, the source redshifts, and the lens mass, concentration, and redshift. In the given cosmology for an NFW halo. The reduced tangential shear is then transformed into g1 and g2 components.

5. If the shapenoise=True, intrinsic ellipticities (1,2) components are drawn from a Gaussian distribution of width of shapenoise. These ellipticities components are then combined with g1 and g2 to provide lensed ellipticies e1 and e2. If shapenoise=False, g1 and g2 are directly used as ellipticity components.

If the shape noise parameter is high, we may draw nonsensical values for ellipticities. We ensure that we does not return any nonsensical values for derived properties. We re-draw all galaxies with e1 or e2 outside the bounds of [-1, 1]. After 5 (default) attempts to re-draw these properties, we return the catalog as is and throw a warning.

Parameters:
  • cluster_m (float) -- Cluster mass in Msun

  • cluster_z (float) -- Cluster redshift

  • cluster_c (float) -- Cluster concentration in the same mass definition as delta_so

  • cosmo (clmm.Cosmology, optional) -- Cosmology object.

  • zsrc (float or str) --

    Choose the source galaxy distribution to be fixed or drawn from a predefined distribution.

    • float : All sources galaxies at this fixed redshift;

    • str : Draws individual source gal redshifts from predefined distribution. Options are:

      • chang13 - Chang et al. 2013 (arXiv:1305.0793);

      • desc_srd - LSST/DESC Science Requirement Document (arxiv:1809.01669);

  • delta_so (float, optional) -- Overdensity density contrast used to compute the cluster mass and concentration. The spherical overdensity mass is computed as the mass enclosed within the radius \(R_{\Delta{\rm SO}}\) where the mean matter density is \(\Delta_{\rm SO}\) times the mean (or critical, depending on the massdef keyword) density of the Universe at the cluster redshift \(M_{\Delta{\rm SO}}=4/3\pi\Delta_{\rm SO}\rho_{m}(z_{\rm lens})R_{\Delta{\rm SO}}^3\)

  • massdef (string, optional) -- Definition the mass overdensity with respect to the 'mean' or 'critical' density of the universe. Default is 'mean' as it works for all theory backends. The NumCosmo and CCL backends also allow the use of 'critical'. (letter case independent)

  • halo_profile_model (string, optional) -- Halo density profile. Default is 'nfw', which works for all theory backends. The NumCosmo backend allow for more options, e.g. 'einasto' or 'burkert' profiles (letter case independent).

  • zsrc_min (float, optional) -- The minimum true redshift of the sources. If photoz errors are included, the observed redshift may be smaller than zsrc_min.

  • zsrc_max (float, optional) -- The maximum true redshift of the sources, apllied when galaxy redshifts are drawn from a redshift distribution. If photoz errors are included, the observed redshift may be larger than zsrc_max.

  • field_size (float, optional) -- The size of the field (field_size x field_size) to be simulated. Proper distance in Mpc at the cluster redshift.

  • shapenoise (float, optional) -- If set, applies Gaussian shape noise to the galaxy shapes with a width set by shapenoise

  • mean_e_err (float, optional) -- Mean per-component ellipticity uncertainty. Currently, individual uncertainties are drawn from a uniform distribution in the range [0.9,1.1]*mean_e_err. If not provided, the output table will not include this column.

  • photoz_sigma_unscaled (float, optional) -- If set, applies photo-z errors to source redshifts

  • pz_bins (int, array) -- Photo-z pdf bins in the given range. If int, the limits are set automatically. If is array, must be the bin edges.

  • pzpdf_type (str, None) --

    Type of photo-z pdf to be stored, options are:

    None - does not store PDFs; 'shared_bins' - single binning for all galaxies 'individual_bins' - individual binning for each galaxy 'quantiles' - quantiles of PDF (not implemented yet)

  • nretry (int, optional) -- The number of times that we re-draw each galaxy with non-sensical derived properties

  • ngals (float, optional) -- Number of galaxies to generate

  • ngal_density (float, optional) -- The number density of galaxies (in galaxies per square arcminute, from z=0 to z=infty). The number of galaxies to be drawn will then depend on the redshift distribution and user-defined redshift range. If specified, the ngals argument will be ignored.

  • validate_input (bool) -- Validade each input argument

Returns:

galaxy_catalog -- Table of source galaxies with drawn and derived properties required for lensing studies

Return type:

clmm.GCData

Notes

Much of this code in this function was adapted from the Dallas group