From 97f8968ba10dab8b4119229b844b3bc0ff8927a6 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Tue, 31 Aug 2021 09:57:51 +0100 Subject: [PATCH 1/2] Rename noise to shot_noise --- skypy/galaxies/_schechter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/skypy/galaxies/_schechter.py b/skypy/galaxies/_schechter.py index 038e85581..5683480ed 100644 --- a/skypy/galaxies/_schechter.py +++ b/skypy/galaxies/_schechter.py @@ -14,7 +14,7 @@ @units.quantity_input(sky_area=units.sr) -def schechter_lf(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, noise=True): +def schechter_lf(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, shot_noise=True): r'''Sample redshifts and magnitudes from a Schechter luminosity function. Sample the redshifts and magnitudes of galaxies following a Schechter @@ -42,8 +42,9 @@ def schechter_lf(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, Sky area over which galaxies are sampled. Must be in units of solid angle. cosmology : Cosmology Cosmology object to convert apparent to absolute magnitudes. - noise : bool, optional - Poisson-sample the number of galaxies. Default is `True`. + shot_noise : bool, optional + Wether to Poisson-sample the number of galaxies, or else use the mean + number. Default is `True`. Notes ----- @@ -61,7 +62,7 @@ def schechter_lf(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, ''' # sample galaxy redshifts - z = schechter_lf_redshift(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, noise) + z = schechter_lf_redshift(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, shot_noise) # if a function is NOT given for M_star, phi_star, alpha, interpolate to z if not callable(M_star) and np.ndim(M_star) > 0: From 1669ed0b2fcfccf3e1408d23e9ba0834cbab7208 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Thu, 2 Sep 2021 20:35:46 +0100 Subject: [PATCH 2/2] flake8 --- skypy/galaxies/_schechter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/skypy/galaxies/_schechter.py b/skypy/galaxies/_schechter.py index 5683480ed..f007d43ad 100644 --- a/skypy/galaxies/_schechter.py +++ b/skypy/galaxies/_schechter.py @@ -62,7 +62,8 @@ def schechter_lf(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, ''' # sample galaxy redshifts - z = schechter_lf_redshift(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, shot_noise) + z = schechter_lf_redshift(redshift, M_star, phi_star, alpha, m_lim, sky_area, cosmology, + shot_noise) # if a function is NOT given for M_star, phi_star, alpha, interpolate to z if not callable(M_star) and np.ndim(M_star) > 0: