Galaxies (glass.galaxies)#
The glass.galaxies module provides functionality for simulating galaxies
as typically observed in a cosmological galaxy survey.
Functions#
- glass.galaxies.redshifts_from_nz(size, z, nz, *, rng=None)#
Generate galaxy redshifts from a source distribution.
- Parameters:
- sizeint
Number of redshifts to sample.
- z, nzarray_like
Source distribution. Leading axes are treated as different galaxy populations.
- rng
Generator, optional Random number generator. If not given, a default RNG will be used.
- Returns:
- zarray_like
Redshifts sampled from the given source distribution.
- poparray_like or None
Index of the galaxy population from the leading axes of
nz; orNoneif there are no galaxy populations.
- glass.galaxies.galaxy_shear(lon, lat, eps, kappa, gamma1, gamma2, *, reduced_shear=True)#
Observed galaxy shears from weak lensing.
Takes lensing maps for convergence and shear and produces a lensed ellipticity (shear) for each intrinsic galaxy ellipticity.
- Parameters:
- lon, latarray_like
Arrays for galaxy longitudes and latitudes.
- epsarray_like
Array of galaxy ellipticity.
- kappa, gamma1, gamma2array_like
HEALPix maps for convergence and two components of shear.
- reduced_shearbool, optional
If
False, galaxy shears are not reduced by the convergence. Default isTrue.
- Returns:
- shearray_like
Array of complex-valued observed galaxy shears (lensed ellipticities).
- glass.galaxies.gaussian_phz(z, sigma_0, rng=None)#
Photometric redshifts assuming a Gaussian error.
A simple toy model of photometric redshift errors that assumes a Gaussian error with redshift-dependent standard deviation \(\sigma(z) = (1 + z) \sigma_0\) [1].
- Parameters:
- zarray_like
True redshifts.
- sigma_0float
Redshift error in the tomographic binning at zero redshift.
- rng
Generator, optional Random number generator. If not given, a default RNG will be used.
- Returns:
- phzarray_like
Photometric redshifts assuming Gaussian errors, of the same shape as
z.
See also
glass.observations.tomo_nz_gausserrCreate tomographic redshift distributions assuming the same model.
References
[1]Amara A., Réfrégier A., 2007, MNRAS, 381, 1018. doi:10.1111/j.1365-2966.2007.12271.x
Examples
See the Photometric redshifts example.