TteBackgroundSimulator

class gdt.core.simulate.tte.TteBackgroundSimulator(bkgd_spectrum, distrib, time_func, time_params, sample_period=0.001, deadtime=0.0, rng=None)[source]

Bases: object

Simulate TTE or EventList data given a modeled background spectrum and time profile model. The spectrum is fixed throughout the time profile of the background, but the amplitude of the background is time-dependent, set by the time profile function.

Parameters:
  • bkgd_spectrum (BackgroundSpectrum) – A modeled background spectrum

  • distrib (str) – The distribution from which the background is simulated; either ‘Poisson’ or ‘Gaussian’

  • time_func (<function>) – A time profile function

  • time_params (iterable) – Parameters for the time profile function

  • sample_period (float, optional) – The sampling period of the simulator in seconds. Default is 0.001. The simulator will produce arrival times consistent with a spectrum over a finite time slice. This time slice should be short enough to approximate a non-homogeneous Poisson process, but long enough to allow for a tractable computation time.

  • deadtime (float, optional) – The dead time in seconds for each recorded count during which another count cannot be recorded. Default is 0.

  • rng (numpy.random.Generator, optional) – random number generator

Methods Summary

set_background(bkgd_spectrum, distrib)

Set/change the spectrum.

set_rng(rng)

Set/change the generator.

simulate(tstart, tstop)

Generate an EventList containing the individual counts from the background simulation.

to_tte(tstart, tstop, **kwargs)

Generate a TTE object containing the individual counts from the background simulation.

Methods Documentation

set_background(bkgd_spectrum, distrib)[source]

Set/change the spectrum.

Parameters:
  • bkgd_spectrum (BackgroundSpectrum) – A modeled background spectrum

  • distrib (str) – The distribution from which the background is simulated; either ‘Poisson’ or ‘Gaussian’

set_rng(rng)[source]

Set/change the generator.

Parameters:

rng (numpy.random.Generator) – random number generator

simulate(tstart, tstop)[source]

Generate an EventList containing the individual counts from the background simulation.

Parameters:
  • tstart (float) – The start time of the simulation

  • tstop (float) – The stop time of the simulation

Returns:

(EventList)

to_tte(tstart, tstop, **kwargs)[source]

Generate a TTE object containing the individual counts from the background simulation.

Parameters:
  • tstart (float) – The start time of the simulation

  • tstop (float) – The stop time of the simulation

  • **kwargs – Options to pass to PhotonList

Returns:

(PhotonList)