pyfli.analysis.phasor_analysis#

Compute phasor coordinates from binned decay data and save phasor-derived lifetime maps.

This module belongs to pyfli.analysis and is part of PyFLI post-processing, diagnostics, statistical comparison, and result-loading utilities for fitted FLI/FLIM datasets. Public API includes functions compute_freq_axis(), compute_phasor(), plot_phasor_figures(), and save_phasor_result().

Functions

compute_freq_axis(binned_irf[, laser_period_ns])

Derive frequency and time axis from IRF array shape.

compute_phasor(binned_decay, binned_irf, ...)

Compute and calibrate phasor coordinates.

plot_phasor_figures(phasor_obj, Gc, Sc, ...)

Generate all standard phasor figures.

save_phasor_result(save_dir, tau_map_ns[, saver])

Save phasor result.

compute_freq_axis(binned_irf, laser_period_ns=12.5)[source]#

Derive frequency and time axis from IRF array shape.

Parameters:
  • binned_irf (np.ndarray  (H, W, T))

  • laser_period_ns (float       default 12.5 ns → 80 MHz)

Returns:

  • freq (tuple from AnalyticalHelpers.freq_computation())

  • freq_hz (float)

  • time_axis_ns (np.ndarray  length T)

Return type:

tuple[Any, …]

compute_phasor(binned_decay, binned_irf, freq_hz, time_axis_ns, n_harmonics=3)[source]#

Compute and calibrate phasor coordinates.

Parameters:
  • binned_decay (np.ndarray  (H, W, T))

  • binned_irf (np.ndarray  (H, W, T))

  • freq_hz (float)

  • time_axis_ns (np.ndarray)

  • n_harmonics (int)

Returns:

  • phasor_obj (PhasorAnalyzer   reuse this instance for all plotting calls)

  • Gc, Sc (np.ndarray  (n_harmonics, H, W)  calibrated phasor coordinates)

  • tau_map_ns (np.ndarray  (H, W)               apparent lifetime from 1st harmonic)

Return type:

tuple[Any, …]

plot_phasor_figures(phasor_obj, Gc, Sc, binned_decay, mask, colorset='jet', saver=None)[source]#

Generate all standard phasor figures.

Produces: phasor diagram, overlay subplots, harmonics plot (if ≥ 3 harmonics), pure phasor map, and traceable analysis.

Parameters:
  • phasor_obj (PhasorAnalyzer   returned by compute_phasor())

  • Gc (np.ndarray  (n_harmonics, H, W))

  • Sc (np.ndarray  (n_harmonics, H, W))

  • binned_decay (np.ndarray  (H, W, T))

  • mask (np.ndarray  (H, W) bool)

  • colorset (str         colormap name for hexbin density plots)

  • saver (DataSaver or None)

Returns:

figs

Return type:

dict[str, Figure]   keyed by figure name

save_phasor_result(save_dir, tau_map_ns, saver=None)[source]#

Save phasor result.

Parameters:
  • save_dir (str) – Directory where outputs are saved.

  • tau_map_ns (np.ndarray) – Lifetime map in nanoseconds.

  • saver (Any | None) – Optional saver used to persist messages or figures.

Returns:

Saved phasor result arrays or metadata.

Return type:

np.ndarray