PoissonBackgroundGenerator¶
- class gdt.core.simulate.generators.PoissonBackgroundGenerator(bkgd, rng=None)[source]¶
Bases:
SimGeneratorSimulation generator for Poisson Background.
Once initialized, a single deviate or many deviates can be generated:
gen = PoissonBackgroundGenerator(bkgd) # generate a single deviate next(gen) # generate 10 deviates [next(gen) for i in range(10)]
- Parameters:
bkgd (
BackgroundSpectrum) – A modeled background spectrumseed (int, optional) – The RNG seed
- Yields:
(
BackgroundSpectrum) – A Poisson random deviate of the initialized spectrum
Methods Summary
set_rng(rng)Set/change the generator.
Methods Documentation
- set_rng(rng)¶
Set/change the generator.
- Parameters:
rng (numpy.random.Generator) – random number generator