Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Rename keyword argument noise to shot_noise #479

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions skypy/galaxies/_schechter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
-----
Expand All @@ -61,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, 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:
Expand Down