httomolibgpu.misc.utils

Contents

httomolibgpu.misc.utils#

Various utilities for data inspection and correction

httomolibgpu.misc.utils.data_checker(data: <cp.ndarray>, infsnans_correct: bool = True, zeros_warning: bool = False, data_to_method_name: str | None = None, verbosity: bool = True) <cp.ndarray>[source]#

Function that performs checks on input data to ensure its validity, performs corrections and prints the warnings. Currently it checks for the presence of Infs and NaNs in the data and corrects them.

Parameters:
  • data (cp.ndarray) – CuPy array either float32 or uint16 data type.

  • infsnans_correct (bool) – Perform correction of NaNs and Infs if they are present in the data.

  • zeros_warning (bool) – Count the number of zeros in the data and produce a warning if more half of the data are zeros.

  • verbosity (bool) – Print the warnings.

  • data_to_method_name (str, optional.) – Method’s name the output of which is tested. This is tailored for printing purposes when the method runs in HTTomo.

Returns:

Returns corrected CuPy array.

Return type:

cp.ndarray