Skip to content

Commit cea1f02

Browse files
authored
DOC: Inverse transform sampling accuracy warning (#472)
1 parent 15e1ded commit cea1f02

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

skypy/galaxies/redshift.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ def redshifts_from_comoving_density(redshift, density, sky_area, cosmology, nois
235235
Sampled redshifts such that the comoving number density of galaxies
236236
corresponds to the input distribution.
237237
238+
Warnings
239+
--------
240+
The inverse cumulative distribution function is approximated from the
241+
number density and comoving volume calculated at the given `redshift`
242+
values. The user must choose suitable `redshift` values to satisfy their
243+
desired numerical accuracy.
244+
238245
'''
239246

240247
# redshift number density

skypy/utils/random.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ def schechter(alpha, x_min, x_max, resolution=100, size=None, scale=1.):
4141
x_sample : array_like
4242
Samples drawn from the Schechter function.
4343
44+
Warnings
45+
--------
46+
The inverse cumulative distribution function is approximated from the
47+
Schechter function evaluated on a logarithmically-spaced grid. The user
48+
must choose the `resolution` of this grid to satisfy their desired
49+
numerical accuracy.
50+
4451
References
4552
----------
4653
.. [1] https://en.wikipedia.org/wiki/Luminosity_function_(astronomy)

0 commit comments

Comments
 (0)