pyfli.simulator.main_common#

Shared engine-wrapping pipelines for the continuous (ICCD-style) and discrete (TCSPC-style) simulator pairs.

combined/main_factory.py (MacroSimulator, TCSPCSimulator, wrapping FLIEngine) and separate/main_factory_gen.py (ContinuousSimulator, PhotonCountSimulator, wrapping FLIModelSimulator) implement the identical noise/scaling pipeline; they differ only in which engine class they wrap, the names of a few methods on that engine, and whether the “mono” branch trims the returned maps dict. Subclasses declare those differences as class attributes; this module owns the actual pipeline math so it is defined exactly once.

Functions

_build_maps(p, photon_count, mono_only_maps, ...)

Build the parameter-maps dict, optionally trimmed for mono pixels.

Classes

BaseContinuousSimulator(irf_data[, sensor_type])

Shared __call__ pipeline for MacroSimulator/ContinuousSimulator: samples lifetime parameters, scales an IRF-convolved analytical decay to a Beta-sampled peak intensity, and applies the jitter/QE/DCR/read-noise/Poisson/quantization pipeline.

BaseDiscreteSimulator(irf_data[, sensor_type])

Shared __call__ pipeline for TCSPCSimulator/PhotonCountSimulator: samples lifetime parameters, runs a TCSPC photon-by-photon histogram, and applies the jitter/DCR/quantization pipeline.

class BaseContinuousSimulator(irf_data, sensor_type='continuous', **cfg)[source]#

Bases: object

Shared __call__ pipeline for MacroSimulator/ContinuousSimulator: samples lifetime parameters, scales an IRF-convolved analytical decay to a Beta-sampled peak intensity, and applies the jitter/QE/DCR/read-noise/Poisson/quantization pipeline.

Subclasses set the following class attributes:

engine_clstype

The engine class to wrap (FLIEngine / FLIModelSimulator).

sample_params_namestr

Name of the engine method that samples lifetime parameters.

analytical_decay_namestr

Name of the engine method that returns the clean analytical decay.

mono_only_mapsbool

Whether p["mono"] trims the returned maps dict down to {tau_map, photon_count_map, mono_map} (True, as in ContinuousSimulator) or the full map set is always returned regardless of mono status (False, as in MacroSimulator).

Parameters:
engine_cls: type#
sample_params_name: str#
analytical_decay_name: str#
mono_only_maps: bool = False#
class BaseDiscreteSimulator(irf_data, sensor_type='discrete', **cfg)[source]#

Bases: object

Shared __call__ pipeline for TCSPCSimulator/PhotonCountSimulator: samples lifetime parameters, runs a TCSPC photon-by-photon histogram, and applies the jitter/DCR/quantization pipeline.

Subclasses set the following class attributes:

engine_clstype

The engine class to wrap (FLIEngine / FLIModelSimulator).

sample_params_namestr

Name of the engine method that samples lifetime parameters.

analytical_decay_namestr

Name of the engine method that returns the clean analytical decay.

simulate_tcspc_namestr

Name of the engine method that runs the TCSPC photon histogram.

mono_only_mapsbool

As in BaseContinuousSimulator.

Parameters:
engine_cls: type#
sample_params_name: str#
analytical_decay_name: str#
simulate_tcspc_name: str#
mono_only_maps: bool = False#