pyfli.solver.base_static#

Provide static initial-guess, bounds, convolution, and parameter-resolution helpers for solvers.

This module belongs to pyfli.solver and is part of PyFLI least-squares, maximum- likelihood, CPU, GPU, binned, and global FLI fitting routines. Public API includes functions resolve_params_and_bounds(), photon_amplitude_guess(), moment_based_guess(), and rld_based_guess().

Functions

moment_based_guess(t, decay, T_acq, T_laser)

Run the moment based guess routine.

photon_amplitude_guess(clean_decay, tau, T_acq)

Initial guess of the forward model's amplitude S -- the total photon count of the decay: the background-subtracted counts in the window, divided by the fraction 1 - exp(-T_acq / tau) of a decay with lifetime tau that falls inside the acquisition window.

resolve_params_and_bounds(user_p0, ...)

Run the resolve params and bounds routine.

rld_based_guess(t, decay, T_acq, T_laser[, ...])

Run the RLD based guess routine.

resolve_params_and_bounds(user_p0, user_bounds, model_type, t, decay, T_laser, guess_plugin, T_acq)[source]#

Run the resolve params and bounds routine.

Parameters:
  • user_p0 (np.ndarray) – User-supplied initial parameter vector.

  • user_bounds (np.ndarray) – User-supplied parameter bounds.

  • model_type (str) – FLI model family, such as mono- or bi-exponential.

  • t (np.ndarray) – Time axis or acquisition period used by the calculation.

  • decay (np.ndarray) – Time-resolved decay signal or decay cube.

  • T_laser (np.ndarray) – Laser repetition period used by the initial-guess routine.

  • guess_plugin (np.ndarray) – Optional callable that supplies initial parameter guesses.

  • T_acq (np.ndarray) – Acquisition window length used by the initial-guess routine.

Returns:

Tuple containing initial parameter guesses and optimization bounds.

Return type:

tuple[Any, ]

photon_amplitude_guess(clean_decay, tau, T_acq)[source]#

Initial guess of the forward model’s amplitude S – the total photon count of the decay: the background-subtracted counts in the window, divided by the fraction 1 - exp(-T_acq / tau) of a decay with lifetime tau that falls inside the acquisition window.

Parameters:
Return type:

float

moment_based_guess(t, decay, T_acq, T_laser, model_type='mono-exponential')[source]#

Run the moment based guess routine.

Parameters:
  • t (np.ndarray) – Time axis or acquisition period used by the calculation.

  • decay (np.ndarray) – Time-resolved decay signal or decay cube.

  • T_acq (np.ndarray) – Acquisition window length used by the initial-guess routine.

  • T_laser (np.ndarray) – Laser repetition period used by the initial-guess routine.

  • model_type (str) – FLI model family, such as mono- or bi-exponential.

Returns:

Dictionary containing the data produced by moment based guess.

Return type:

dict[Any, Any]

rld_based_guess(t, decay, T_acq, T_laser, model_type='mono-exponential')[source]#

Run the RLD based guess routine.

Parameters:
  • t (np.ndarray) – Time axis or acquisition period used by the calculation.

  • decay (np.ndarray) – Time-resolved decay signal or decay cube.

  • T_acq (np.ndarray) – Acquisition window length used by the initial-guess routine.

  • T_laser (np.ndarray) – Laser repetition period used by the initial-guess routine.

  • model_type (str) – FLI model family, such as mono- or bi-exponential.

Returns:

Dictionary containing the data produced by RLD based guess.

Return type:

dict[Any, Any]