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 the parameter-maps dict, optionally trimmed for mono pixels, in the solver's convention: |
Classes
|
Shared |
|
Shared |
- class BaseContinuousSimulator(irf_data, sensor_type='continuous', **cfg)[source]#
Bases:
objectShared
__call__pipeline for MacroSimulator/ContinuousSimulator: samples lifetime parameters, scales the expected decay (the engine’sexpected_decay(), i.e. the solver’s forward model, circular forpileup_mode="wrap") to a Beta-sampled peak intensity, then applies, in the order of a camera, QE, jitter, shot noise on the signal, dark counts, read noise, rounding and clipping.fit_mapis the expectation of the result before read noise, rounding and clipping (signal + dark counts).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 un-convolved decay (the pipeline itself uses the engine’s
expected_decay).- mono_only_mapsbool
Whether
p["mono"]trims the returned maps dict down to{tau_map, photon_count_map, mono_map}(True, as inContinuousSimulator) or the full map set is always returned regardless of mono status (False, as inMacroSimulator).
- class BaseDiscreteSimulator(irf_data, sensor_type='discrete', **cfg)[source]#
Bases:
objectShared
__call__pipeline for TCSPCSimulator/PhotonCountSimulator: samples lifetime parameters, runs a TCSPC photon-by-photon histogram (with the timing jitter applied to the photons), and adds dark counts and counter clipping.fit_mapis the exact expectation of the histogram, the engine’sexpected_decay()(the solver’s forward model, circular forpileup_mode="wrap") plus the dark counts.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 un-convolved decay (the pipeline itself uses the engine’s
expected_decay).- simulate_tcspc_namestr
Name of the engine method that runs the TCSPC photon histogram.
- mono_only_mapsbool
As in
BaseContinuousSimulator.