Skip to content

Commit

Permalink
DOC: Inverse transform sampling accuracy warning (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrjbca authored Jul 13, 2021
1 parent 15e1ded commit cea1f02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions skypy/galaxies/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def redshifts_from_comoving_density(redshift, density, sky_area, cosmology, nois
Sampled redshifts such that the comoving number density of galaxies
corresponds to the input distribution.
Warnings
--------
The inverse cumulative distribution function is approximated from the
number density and comoving volume calculated at the given `redshift`
values. The user must choose suitable `redshift` values to satisfy their
desired numerical accuracy.
'''

# redshift number density
Expand Down
7 changes: 7 additions & 0 deletions skypy/utils/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def schechter(alpha, x_min, x_max, resolution=100, size=None, scale=1.):
x_sample : array_like
Samples drawn from the Schechter function.
Warnings
--------
The inverse cumulative distribution function is approximated from the
Schechter function evaluated on a logarithmically-spaced grid. The user
must choose the `resolution` of this grid to satisfy their desired
numerical accuracy.
References
----------
.. [1] https://en.wikipedia.org/wiki/Luminosity_function_(astronomy)
Expand Down

0 comments on commit cea1f02

Please sign in to comment.