SourceSpectrumGenerator¶
- class gdt.core.simulate.generators.SourceSpectrumGenerator(rsp, function, params, exposure, rng=None)[source]¶
Bases:
SimGeneratorSimulation generator for a Poisson source spectrum.
Once initialized, a single deviate or many deviates can be generated:
gen = SourceSpectrumGenerator(rsp, function params, exposure) # generate a single deviate next(gen) # generate 10 deviates [next(gen) for i in range(10)]
- Parameters:
rsp (
Rsp) – A detector response objectfunction (
Function) – A photon model functionparams (iterable) – The parameters for the function
exposure (float) – The source exposure
seed (int, optional) – The RNG seed
- Yields:
(
EnergyBins) – A Poisson random deviate of the initialized source 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