pyfli.irf_deconvolution.detector_weights#

Convert detector observations to expected photon rates and inverse-variance weights.

This module belongs to pyfli.irf_deconvolution and is part of PyFLI detector- aware IRF deconvolution and joint FLI fitting utilities. Public API includes classes TCSPCParams, SPADParams, and ICCDParams; functions tcspc_to_lambda(), tcspc_lambda_weight(), spad_to_lambda(), spad_lambda_weight(), iccd_to_lambda(), iccd_lambda_weight(), generalized_anscombe(), and make_observation().

Functions

generalized_anscombe(y_adu, p)

Run the generalized anscombe routine.

iccd_lambda_weight(lam, y_adu, p)

Run the ICCD lambda weight routine.

iccd_to_lambda(y_adu, p)

Run the ICCD to lambda routine.

make_observation(y, detector, params)

Create observation.

spad_lambda_weight(lam, y, p)

Run the SPAD lambda weight routine.

spad_to_lambda(y, p)

Run the SPAD to lambda routine.

tcspc_lambda_weight(lam, y, p)

Run the TCSPC lambda weight routine.

tcspc_to_lambda(y, p)

Run the TCSPC to lambda routine.

Classes

ICCDParams(G0[, F2, sigma_r])

Store ICCD detector weighting parameters.

SPADParams(n_ex)

Store SPAD detector weighting parameters.

TCSPCParams([n_ex])

Store TCSPC detector weighting parameters.

class TCSPCParams(n_ex=None)[source]#

Bases: object

Store TCSPC detector weighting parameters. The optional excitation-count value is used to correct pile-up and inflate variance estimates.

Parameters:

n_ex (float | None) – Number of excitation opportunities used for pile-up or detector corrections.

n_ex: float | None = None#
class SPADParams(n_ex)[source]#

Bases: object

Store SPAD detector weighting parameters. The excitation-count value controls the conversion from observed binary detections to expected photon rates.

Parameters:

n_ex (float) – Number of excitation opportunities used for pile-up or detector corrections.

n_ex: float#
class ICCDParams(G0, F2=2.0, sigma_r=0.0)[source]#

Bases: object

Store ICCD detector weighting parameters. Gain, excess-noise factor, and read-noise standard deviation define the observation model used by IRF deconvolution.

Parameters:
  • G0 (float) – ICCD gain factor used by the detector observation model.

  • F2 (float) – ICCD excess-noise factor used in variance estimates.

  • sigma_r (float) – Read-noise standard deviation used in the detector observation model.

G0: float#
F2: float = 2.0#
sigma_r: float = 0.0#
tcspc_to_lambda(y, p)[source]#

Run the TCSPC to lambda routine.

Parameters:
  • y (np.ndarray) – Observed signal, target data, or coordinate array.

  • p (TCSPCParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by TCSPC to lambda.

Return type:

Any

tcspc_lambda_weight(lam, y, p)[source]#

Run the TCSPC lambda weight routine.

Parameters:
  • lam (np.ndarray) – Wavelength, spectral axis, or expected photon-rate array.

  • y (np.ndarray) – Observed signal, target data, or coordinate array.

  • p (TCSPCParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by TCSPC lambda weight.

Return type:

Any

spad_to_lambda(y, p)[source]#

Run the SPAD to lambda routine.

Parameters:
  • y (np.ndarray) – Observed signal, target data, or coordinate array.

  • p (SPADParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by SPAD to lambda.

Return type:

Any

spad_lambda_weight(lam, y, p)[source]#

Run the SPAD lambda weight routine.

Parameters:
  • lam (np.ndarray) – Wavelength, spectral axis, or expected photon-rate array.

  • y (np.ndarray) – Observed signal, target data, or coordinate array.

  • p (SPADParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by SPAD lambda weight.

Return type:

Any

iccd_to_lambda(y_adu, p)[source]#

Run the ICCD to lambda routine.

Parameters:
  • y_adu (np.ndarray) – ICCD observation in analog-to-digital units.

  • p (ICCDParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by ICCD to lambda.

Return type:

Any

iccd_lambda_weight(lam, y_adu, p)[source]#

Run the ICCD lambda weight routine.

Parameters:
  • lam (np.ndarray) – Wavelength, spectral axis, or expected photon-rate array.

  • y_adu (np.ndarray) – ICCD observation in analog-to-digital units.

  • p (ICCDParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by ICCD lambda weight.

Return type:

Any

generalized_anscombe(y_adu, p)[source]#

Run the generalized anscombe routine.

Parameters:
  • y_adu (np.ndarray) – ICCD observation in analog-to-digital units.

  • p (ICCDParams) – Detector parameter object or fitted parameter vector.

Returns:

Object produced by generalized anscombe.

Return type:

Any

make_observation(y, detector, params)[source]#

Create observation.

Parameters:
  • y (np.ndarray) – Observed signal, target data, or coordinate array.

  • detector (str) – Detector model name used to select weighting or conversion logic.

  • params (Any) – Model, detector, or plotting parameters used by the routine.

Returns:

Tuple containing simulated observations and associated ground-truth arrays.

Return type:

tuple[Any, ]