TteSourceSimulator

class gdt.core.simulate.tte.TteSourceSimulator(rsp, spec_func, spec_params, time_func, time_params, sample_period=0.001, deadtime=0.0, rng=None)[source]

Bases: object

Simulate TTE or EventList data for a source spectrum given a detector response, spectral model and time profile model. The spectral shape is fixed throughout the time profile of the signal, but the amplitude of the spectrum is time-dependent, set by the time profile function.

Parameters:
  • rsp (Rsp) – A detector response object

  • spec_func (Function) – A photon model function

  • spec_params (iterable) – The parameters for the function

  • 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 0.

Methods Summary

set_response(rsp)

Set/change the detector response.

set_rng(rng)

Set/change the generator.

set_spectrum(spec_func, spec_params)

Set/change the spectrum.

set_time_profile(time_func, time_params)

Set/change the time profile.

simulate(tstart, tstop)

Generate an EventList containing the individual counts from the simulation.

to_tte(tstart, tstop, **kwargs)

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

Methods Documentation

set_response(rsp)[source]

Set/change the detector response.

Parameters:

rsp (RSP) – A detector response object

set_rng(rng)[source]

Set/change the generator.

Parameters:

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

set_spectrum(spec_func, spec_params)[source]

Set/change the spectrum.

Parameters:
  • spec_func (Function) – A photon model function

  • spec_params (iterable) – The parameters for the function

set_time_profile(time_func, time_params)[source]

Set/change the time profile.

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

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

simulate(tstart, tstop)[source]

Generate an EventList containing the individual counts from the 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 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)