pyfli.simulator.irf_sim.irf_generator#
Generate synthetic instrument response function (IRF) traces for simulator and alignment testing.
This module belongs to pyfli.simulator.irf_sim and is part of PyFLI synthetic
FLI/FLIM data generation, hardware noise modeling, calibration, and validation tools.
Public API includes classes IRFGenerator.
Classes
Generate synthetic IRF traces for testing alignment, fitting, and simulation code without needing measured instrument data. |
- class IRFGenerator[source]#
Bases:
objectGenerate synthetic IRF traces for testing alignment, fitting, and simulation code without needing measured instrument data. Each method returns a 1D (num_bins,) trace, or a (H, W, num_bins) cube with the same trace broadcast to every pixel when H and W are both given.
- static gaussianIRF(mu, T=12.5, num_bins=256, sigma=0.1, H=None, W=None)[source]#
Generates a Gaussian-shaped IRF: a narrow pulse centered at bin mu, peak normalized to 1.
- Parameters:
mu (
float) – Bin index of the pulse peak (fractional values are supported).T (
float) – Laser period in nanoseconds.num_bins (
int) – Number of time bins spanning one laser period.sigma (
float) – Pulse spread, in nanoseconds. Converted to bins internally via gate_delay = T / num_bins.H (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.W (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.
- Return type:
- static expdecay(mu, T=12.5, num_bins=256, tau=0.1, H=None, W=None)[source]#
Generates a single-exponential-decay IRF: a Dirac delta at bin mu convolved with a very fast causal exponential decay, peak normalized to 1.
- Parameters:
mu (
float) – Bin index of the delta impulse (rounded to the nearest bin).T (
float) – Laser period in nanoseconds.num_bins (
int) – Number of time bins spanning one laser period.tau (
float) – Exponential decay time constant, in nanoseconds (0.1 ns or less for a “very fast” IRF-like decay).H (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.W (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.
- Return type:
- static gaussianExpIRF(mu, T=12.5, num_bins=256, sigma=0.1, tau=0.1, H=None, W=None)[source]#
Generates an exponentially modified Gaussian (EMG) IRF: a Gaussian pulse (as in
gaussianIRF()) convolved with a fast causal exponential decay (as inexpdecay()), peak normalized to 1.This models a common real-detector IRF shape: a Gaussian core from optical and timing jitter, with an exponential tail from the detector’s electronic response.
- Parameters:
mu (
float) – Bin index of the Gaussian core’s peak.T (
float) – Laser period in nanoseconds.num_bins (
int) – Number of time bins spanning one laser period.sigma (
float) – Gaussian core spread, in nanoseconds.tau (
float) – Exponential tail time constant, in nanoseconds.H (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.W (
int | None) – If both given, the trace is broadcast to a (H, W, num_bins) cube. If both omitted, a 1D (num_bins,) trace is returned.
- Return type: