pyfli.analysis.phasor_analysis#
Compute phasor coordinates from binned decay data and save phasor lifetime maps.
Functions
|
Derive frequency and time axis from IRF array shape. |
|
Compute and calibrate phasor coordinates. |
|
Generate all standard phasor figures. |
|
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,gate start times ``k * T / num_gates``) – covering exactly one laser period (endpoint excluded), so the phasor sums are the discrete Fourier transform at the laser frequency
- Return type:
- compute_phasor(binned_decay, binned_irf, freq_hz, time_axis_ns, n_harmonics=3)[source]#
Compute and calibrate phasor coordinates.
- Parameters:
- 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:
- 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 (
DataSaverorNone)
- 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