pyfli.simulator.irf_sim.irf_offset_gen#
Sample per-call IRF time-of-flight shifts and baseline offsets 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 OffsetGen.
Classes
|
Samples a horizontal time-of-flight shift |
- class OffsetGen(irf_data, a_range=(-20, 100), b_range=(0, 10), pixel=(0, 0))[source]#
Bases:
objectSamples a horizontal time-of-flight shift
aand a vertical baseline offsetbfor a single pixel’s base IRF, and applies them to produce a shifted IRF trace:I(t) -> np.roll(I, round(a)) + b.- Parameters:
irf_data (
np.ndarray) – Full IRF cube, shape(H, W, n_bins).a_range (
tuple[float,float]) – Uniform sampling range for the horizontal shifta, in bins.b_range (
tuple[float,float]) – Uniform sampling range for the vertical baseline offsetb.pixel (
tuple[int,int]) –(row, col)pixel used to select the base IRF trace fromirf_data.
- sample_cube()[source]#
Applies an independently-sampled
(a, b)to every pixel of the full 3-Dirf_datacube, returning the fully shifted IRF cube along with(H, W)maps of thea/bvalues drawn per pixel.- Returns:
(irf_cube, a_map, b_map)— the shifted(H, W, n_bins)IRF cube, and the per-pixela/bvalues used to build it.- Return type:
tuple[np.ndarray,np.ndarray,np.ndarray]
- sample_picked(px=None)[source]#
Picks one IRF trace out of the full 3-D
irf_datacube viairf_picker()— an SNR-validated random pixel, or the givenpx— then drawsa/band applies them to it.- Parameters:
px (
tuple[int,int] | None) – Explicit(x, y)pixel to pick, forwarded toirf_picker. A random SNR-validated pixel is chosen when omitted.- Returns:
(irf_1d, a, b)— the shifted IRF trace and the shift/offset used to build it.- Return type:
tuple[np.ndarray,float,float]