schechter_lf_magnitude¶
-
skypy.galaxy.luminosity.schechter_lf_magnitude(redshift, M_star, alpha, m_lim, cosmology, size=None, x_max=1000.0, resolution=1000)[source] [edit on github]¶ Sample magnitudes from a Schechter luminosity function.
Given a list of galaxy redshifts, and an apparent magnitude limit, sample galaxy absolute magnitudes from a Schechter luminosity function.
- Parameters
- redshiftarray_like
Galaxy redshifts for which to sample magnitudes.
- M_stararray_like or function
Characteristic absolute magnitude, either constant, or an array with values for each galaxy, or a function of galaxy redshift.
- alphaarray_like or function
Schechter function index, either a constant, or an array of values for each galaxy, or a function of galaxy redshift.
- m_limfloat
Apparent magnitude limit.
- cosmologyCosmology, optional
Cosmology object for converting apparent and absolute magnitudes. If no cosmology is given, the default cosmology is used.
- sizeint, optional
Explicit size for the sampling. If not given, one magnitude is sampled for each redshift.
- Returns
- magnitudearray_like
Absolute magnitude sampled from a Schechter luminosity function for each input galaxy redshift.
Examples
Sample a number of blue (alpha = -1.3, M_star = -20.5) galaxy magnitudes brighter than m = 22.0 around redshift 0.5.
>>> import numpy as np >>> from skypy.galaxy.luminosity import schechter_lf_magnitude >>> z = np.random.uniform(4.9, 5.1, size=20) >>> M = schechter_lf_magnitude(z, -20.5, -1.3, 22.0)