pyfli.io.data_operations#

Load raw decay, IRF, background, mask, and hot-pixel data from common FLI sources.

This module belongs to pyfli.io and is part of PyFLI detector importers, file readers, saving helpers, and processed-data loaders. Public API includes classes DataOperations.

Classes

DataOperations([data_path, irf_path, ...])

Load primary data, IRF, background, masks, and hot-pixel maps from common FLI file formats.

class DataOperations(data_path=None, irf_path=None, bg_path=None, mask_path=None, hp_path=None)[source]#

Bases: object

Load primary data, IRF, background, masks, and hot-pixel maps from common FLI file formats. It provides a path-centric interface for raw loading, correction, and packaging into PyFLI-ready structures.

Parameters:
  • data_path (str | None) – Path to the primary decay data source.

  • irf_path (str | None) – Path to the instrument response data source.

  • bg_path (str | None) – Path to the background measurement used for subtraction or correction.

  • mask_path (str | None) – Path to a binary or labeled mask used to select valid pixels.

  • hp_path (str | None) – Path to a hot-pixel mask or image used for interpolation.

load_data(sub_bg=True, pile_up=False, hot_pixel=False)[source]#

Load data.

Parameters:
  • sub_bg (bool) – Whether background subtraction is applied.

  • pile_up (bool) – Whether pile-up correction should be applied.

  • hot_pixel (bool) – Whether hot-pixel correction should be applied.

Returns:

Object produced by load data.

Return type:

Any

load_background(pile_up=False, hot_pixel=False)[source]#

Loads background. If folder, returns the mean average of all files.

Parameters:
Return type:

Any

load_irf(sub_bg=False, pile_up=False, hot_pixel=False)[source]#

Load irf.

Parameters:
  • sub_bg (bool) – Whether background subtraction is applied.

  • pile_up (bool) – Whether pile-up correction should be applied.

  • hot_pixel (bool) – Whether hot-pixel correction should be applied.

Returns:

Object produced by load IRF.

Return type:

Any

load_all_parallel(sub_bg=True, pile_up=False, hot_pixel=False)[source]#

Load all parallel.

Parameters:
  • sub_bg (bool) – Whether background subtraction is applied.

  • pile_up (bool) – Whether pile-up correction should be applied.

  • hot_pixel (bool) – Whether hot-pixel correction should be applied.

Returns:

Tuple containing loaded data arrays, labels, and file metadata.

Return type:

tuple[Any, ]

make_dataset(name='Experiment_1', source='ICCD', sub_bg=True, pile_up=False, hot_pixel=False)[source]#

Create dataset.

Parameters:
  • name (str) – Dataset, experiment, figure, or output name.

  • source (str) – Source label recorded with the loaded dataset.

  • sub_bg (bool) – Whether background subtraction is applied.

  • pile_up (bool) – Whether pile-up correction should be applied.

  • hot_pixel (bool) – Whether hot-pixel correction should be applied.

Returns:

Dictionary containing the data produced by make dataset.

Return type:

dict[Any, Any]

load_mask()[source]#

Load mask.

Returns:

Object produced by load mask.

Return type:

Any