pyfli.simulator.irf_sim.tof_sim#

Convert a sample height/topology offset into an equivalent time-of-flight shift, in units of IRF time bins, for the simulator workflow.

This module belongs to pyfli.simulator.irf_sim and is part of PyFLI synthetic FLI/FLIM data generation, hardware noise modeling, calibration, and validation tools. Public API includes classes ToFSim.

Classes

ToFSim([T, num_bins])

Converts a physical height offset (mm) into the equivalent time-of-flight delay (ns) via the vacuum speed of light, then into an integer number of IRF time bins to np.roll an IRF trace by.

class ToFSim(T=12.5, num_bins=256)[source]#

Bases: object

Converts a physical height offset (mm) into the equivalent time-of-flight delay (ns) via the vacuum speed of light, then into an integer number of IRF time bins to np.roll an IRF trace by.

A positive height is treated as being closer to the detector — a shorter one-way path length, so photons arrive faster (negative delay, negative roll); a negative height is farther away (positive delay, positive roll).

Parameters:
  • T (float) – Laser period, in nanoseconds (matches IRFGenerator).

  • num_bins (int) – Number of time bins spanning one laser period.

height_to_time(height_mm)[source]#

Converts a height offset (mm) to a time-of-flight delay (ns). Positive height (closer to the detector) yields a negative delay.

Parameters:

height_mm (float)

Return type:

float

sample_shift(height_range_mm=(-10.0, 10.0))[source]#

Draws a height offset from height_range_mm, converts it to a time-of-flight delay via height_to_time(), and converts that delay to an integer number of gate_delay-sized bins.

Returns:

(roll_bins, height_mm, time_diff_ns) — the integer np.roll amount (positive or negative), the sampled height, and the time-of-flight delay it corresponds to.

Return type:

tuple[int, float, float]

Parameters:

height_range_mm (tuple[float, float])