redshifts_from_comoving_density¶
-
skypy.galaxy.redshift.redshifts_from_comoving_density(redshift, density, fsky, cosmology, noise=True)[source] [edit on github]¶ Sample redshifts from a comoving density function.
Sample galaxy redshifts such that the resulting distribution matches a past lightcone with comoving galaxy number density
densityat redshiftsredshift. The comoving volume sampled corresponds to a sky fractionfskyand transverse comoving distance given by the cosmologycosmology.If the
noiseparameter is set to true, the number of galaxies has Poisson noise. Ifnoiseis false, the expected number of galaxies is used.- Parameters
- redshiftarray_like
Redshifts at which comoving number densities are provided.
- densityarray_like
Comoving galaxy number density at each redshift in Mpc-3.
- fskyarray_like
Sky fraction over which galaxies are sampled.
- cosmologyCosmology, optional
Cosmology object for conversion to comoving volume. If not given, the default cosmology is used.
- noisebool, optional
Poisson-sample the number of galaxies. Default is
True.
- Returns
- redshiftsarray_like
Sampled redshifts such that the comoving number density of galaxies corresponds to the input distribution.
Examples
Sample redshifts with a constant comoving number density 1e-3/Mpc3 up to redshift 1 for a survey of 1 square degree = 1/41253 of the sky.
>>> from skypy.galaxy.redshift import redshifts_from_comoving_density >>> z_range = np.arange(0, 1.01, 0.1) >>> z_gal = redshifts_from_comoving_density(z_range, 1e-3, 1/41253)