pyfli.phasor.phasorS.phasor_locus_tools#
Acquisition configuration and lifetime helpers built on MonoLocus.
This module belongs to pyfli.phasor.phasorS. It complements
MonoLocus with:
AcquisitionMode/AcquisitionConfig– one validated object describing the acquisition geometry, which traces its own locus;phase_lifetime()/modulation_lifetime()– lifetime estimators for any harmonic;lifetime_from_locus()– nearest-point lifetime on any traced locus;phase_lifetime_gated()– exact phase inversion of the single-gate locus;discrete_locus_circle()– analytic centre and radius of the binned locus;plot_discrete_n_sweep()– convergence of the binned locus with the number of bins.
Units follow MonoLocus: frequencies in hertz, times in nanoseconds, window
lengths as fractions of the laser period.
Functions
|
|
|
Centre |
|
Lifetime of the nearest point of a traced locus, for every phasor. |
|
Modulation lifetime |
|
Phase lifetime |
|
Lifetime whose single-gate locus point has the measured phase. |
|
Binned loci for several numbers of bins, converging to the universal semicircle as the number of bins grows. |
Classes
|
Validated description of an acquisition geometry. |
|
Acquisition geometries with an analytical mono-exponential locus. |
- class AcquisitionMode(*values)[source]#
Bases:
StrEnumAcquisition geometries with an analytical mono-exponential locus.
- CONTINUOUS = 'continuous'#
- DISCRETE = 'discrete'#
- GATED_SINGLE = 'gated_single'#
- GATED_N = 'gated_n'#
- TRUNCATED = 'truncated'#
- OFFSET = 'offset'#
- class AcquisitionConfig(mode=AcquisitionMode.CONTINUOUS, frequency_hz=80000000.0, harmonic=1, n_bins=256, gate_width_frac=0.5, n_gates=4, t_rec_frac=1.0, t0_frac=0.0)[source]#
Bases:
objectValidated description of an acquisition geometry.
- Parameters:
mode (
AcquisitionMode | str) – Acquisition geometry ("continuous","discrete","gated_single","gated_n","truncated"or"offset").frequency_hz (
float) – Laser repetition frequency in hertz.harmonic (
int) – Phasor harmonic.n_bins (
int) – Number of bins over one period (discrete).gate_width_frac (
float) – Gate width as a fraction of the period (gated_single,gated_n).n_gates (
int) – Number of equidistant gates over one period (gated_n).t_rec_frac (
float) – Recorded window as a fraction of the period (truncated).t0_frac (
float) – Excitation offset as a fraction of the period (offset).
- mode: AcquisitionMode | str = 'continuous'#
- phase_lifetime(g, s, frequency_hz, harmonic=1)[source]#
Phase lifetime
tau = s / (g * omega)in nanoseconds, withomegathe angular frequency of harmonic. Exact for mono-exponential decays on the universal semicircle.
- modulation_lifetime(g, s, frequency_hz, harmonic=1)[source]#
Modulation lifetime
tau = sqrt(1/m^2 - 1) / omegain nanoseconds, withm^2 = g^2 + s^2. Exact for mono-exponential decays on the universal semicircle.
- lifetime_from_locus(g, s, locus_g, locus_s, locus_tau, mask=None)[source]#
Lifetime of the nearest point of a traced locus, for every phasor.
- Parameters:
g (
array_like) – Phasor coordinates (any shape).s (
array_like) – Phasor coordinates (any shape).locus_g (
array_like) – A locus fromMonoLocusorAcquisitionConfig.locus().locus_s (
array_like) – A locus fromMonoLocusorAcquisitionConfig.locus().locus_tau (
array_like) – A locus fromMonoLocusorAcquisitionConfig.locus().mask (
array_like | None) – Phasors to evaluate; the others (and non-finite phasors) areNaN.
- Returns:
Lifetimes in nanoseconds, same shape as g.
- Return type:
np.ndarray
- phase_lifetime_gated(g, s, frequency_hz, gate_width_frac, harmonic=1, tau_range_ns=(1e-3, 100.0))[source]#
Lifetime whose single-gate locus point has the measured phase.
The standard phase lifetime is biased for a single square gate of width
gate_width_frac * T. This solvesarg(z_gate(tau)) = arg(g + i s)fortauin tau_range_ns (Brent’s method), phasor by phasor. Phases outside the range of the locus giveNaN.
- discrete_locus_circle(n_bins, harmonic=1)[source]#
Centre
(gc, sc)and radiusrof the circle the binned locus lies on.For
n_binsequal bins over one period, the phasor of a mono-exponential decay isz = (1 - x) / (1 - x e^{i phi})withx = exp(-T / (n_bins tau))andphi = 2 pi harmonic / n_bins; asxgoes from 0 to 1 it traces an arc of the circle through (1, 0) and (0, 0) withgc = 1/2, sc = -tan(phi / 2) / 2, r = 1 / (2 cos(phi / 2)).
The circle tends to the universal semicircle as
n_binsgrows. Whencos(phi / 2) = 0(e.g.n_bins = 2,harmonic = 1) the locus is the segment [0, 1] and(0.5, 0.0, 0.5)is returned.