pyfli.simulator.calibration.config#
Inputs and constants for calibrating the pyfli simulator against an experimental cube.
Functions
|
|
|
Classes
|
Everything the calibration needs. |
|
Thresholds that decide whether a pixel carries sample fluorescence or only detector/background noise. |
- class PixelSelectionCriteria(min_signal_photons=50.0, snr_min=5.0, flatness_sigma=5.0, peak_window_bins=None, use_otsu='auto', otsu_min_separability=0.6, hot_pixel_factor=10.0, min_component_size=9, refine_user_mask=False)[source]#
Bases:
objectThresholds that decide whether a pixel carries sample fluorescence or only detector/background noise. See
pixel_selectionfor the tests.- Parameters:
- class CalibrationInputs(data_path, detector_type, model_type, irf_path=None, irf_mode='auto', bg_path=None, mask_path=None, reference_path=None, reference_source='auto', reference_alpha='auto', laser_freq_mhz=80.0, bin_radius=0, bit_depth=None, jitter='auto', mono_fraction=None, prior_inflation=1.0, optimize_irf=True, optimize_noise=True, optimize_priors=True, reference_weight=0.05, n_exp_pixels=20000, n_sim_pixels=2000, n_fit_pixels=1500, n_validation_pixels=6000, n_bank_pixels=20000, bank_rounds=3, max_evals_stage1=120, max_evals_stage2=1500, target_coverage=0.99, n_coverage_pixels=20000, max_coverage_iter=10, seed=0, output_dir=None, selection=<factory>)[source]#
Bases:
objectEverything the calibration needs.
- Parameters:
data_path (
str) – Raw 3D decay data (.sdt, .ptu, .tif, .npy, …), loaded viapyfli.io.DataOperations.detector_type (
str) – “continuous” (gated/ICCD-like) or “discrete” (TCSPC photon counting).model_type (
str) – “bi_exponential” or “mono_exponential”.irf_path (
str | None) – Experimental IRF. When omitted the IRF is simulated withpyfli.simulator.IRFGenerator.gaussianExpIRFand its parameters are optimised.mask_path (
str | None) – Boolean mask of sample pixels. When omitted, one is derived automatically.reference_path (
str | None) – Optional parameter maps (AlliGator folder, SPCImage folder, or a pyfli session .npy file / folder) used to initialise and regularise the priors.target_coverage (
float) – Required fraction of experimental pixels inside the simulated distribution for every coverage statistic (raw phasors h=1/2, photons, rising edge, background); seecoverage. After the best-fit calibration the config is widened until this is reached, so that the experiment is a subset of what the simulator produces. 0 keeps the best-fit config.n_coverage_pixels (
int) – Simulated pixels per coverage check.max_coverage_iter (
int) – Maximum number of widening steps.irf_mode (str)
bg_path (str | None)
reference_source (str)
reference_alpha (str)
laser_freq_mhz (float)
bin_radius (int)
bit_depth (int | None)
mono_fraction (float | None)
prior_inflation (float)
optimize_irf (bool)
optimize_noise (bool)
optimize_priors (bool)
reference_weight (float)
n_exp_pixels (int)
n_sim_pixels (int)
n_fit_pixels (int)
n_validation_pixels (int)
n_bank_pixels (int)
bank_rounds (int)
max_evals_stage1 (int)
max_evals_stage2 (int)
seed (int)
output_dir (str | None)
selection (PixelSelectionCriteria)
- selection: PixelSelectionCriteria#