pyfli.simulator.calibration.expected_decay#

Analytic noise-free expected decay of the pyfli simulator for given lifetimes and IRF.

Functions

gated_bin_probabilities(tau, irf, laser_period)

Expected per-gate photon distribution of PhotonCountSimulator for lifetime(s) tau: the wrapped, gate-integrated exponential (wrapped_gate_exponential()) circularly convolved with the IRF.

wrapped_gate_exponential(tau, n_bins, ...)

Probability that a photon emitted with an exponential delay of lifetime(s) tau (ns, any shape S) falls in each of n_bins equal gates covering one laser period, with delays wrapped modulo the period (pyfli.reconstruction.common_reconstruct.periodic_bin_exponential()).

Classes

DecayForwardModel(n_bins, period_ns, ...[, ...])

wrapped_gate_exponential(tau, n_bins, laser_period)[source]#

Probability that a photon emitted with an exponential delay of lifetime(s) tau (ns, any shape S) falls in each of n_bins equal gates covering one laser period, with delays wrapped modulo the period (pyfli.reconstruction.common_reconstruct.periodic_bin_exponential()). Returns S + (n_bins,), summing to 1 along the last axis.

Parameters:
Return type:

ndarray

gated_bin_probabilities(tau, irf, laser_period)[source]#

Expected per-gate photon distribution of PhotonCountSimulator for lifetime(s) tau: the wrapped, gate-integrated exponential (wrapped_gate_exponential()) circularly convolved with the IRF.

Parameters:
  • tau (float | np.ndarray) – Lifetime(s) in ns; any shape S.

  • irf (np.ndarray) – IRF of shape (T,) (shared) or S + (T,) (one per lifetime); normalised to unit sum here.

  • laser_period (float) – Laser repetition period in ns; the T gates cover [0, laser_period).

Returns:

Array of shape S + (T,) whose last axis sums to 1.

Return type:

np.ndarray

class DecayForwardModel(n_bins, period_ns, detector_type, jitter=True, inactive_bins=())[source]#

Bases: object

Parameters:
property n_active: int#
simulated_irf(mu, sigma_ns, tail_ns)[source]#

Peak-normalised exponentially modified Gaussian IRF (pyfli IRFGenerator).

Parameters:
Return type:

ndarray

static with_baseline(irf_peak1, b)[source]#

What OffsetGen does to the IRF (+ b) followed by the simulator’s sum-normalisation.

Parameters:
Return type:

ndarray

components(taus, fracs)[source]#
Return type:

ndarray

shape(irf_norm, taus, fracs)[source]#

Expected decay shape (sums to 1 over the active bins) for a sum-normalised IRF.

Parameters:

irf_norm (ndarray)

Return type:

ndarray

flat()[source]#

Flat background spread over the active bins (sums to 1).

Return type:

ndarray