ewoksid02.utils.io.get_array_dark#
- ewoksid02.utils.io.get_array_dark(filename_dark, data_signal_shape, datatype=None, binning=(1, 1), dummy=None, delta_dummy=None, filename_mask=None, dark_filter=None, dark_filter_quantil_lower=0.1, dark_filter_quantil_upper=0.9, use_cupy=False, persistent=True)[source]#
Generate the array of the dark current correction, eventually applying the mask and dummy pixel filtering and dark dataset filtering params:
filename_dark (str): the filename of the dark current correction
data_signal_shape (tuple): the shape of the data signal array, used for binning unification
datatype (str): format of the imported array, if None, datatype is respected
binning (tuple): binning of the data signal, used for binning unification
dummy (int): if not None, the value of the dummy pixels to filter
delta_dummy (float): if dummy is not None, the tolerance around the dummy value
filename_mask (str): the filename of the mask
dark_filter (str): if not None, the method to use for filtering a stack of darks into a single dark (e.g. “median” or “quantil”)
dark_filter_quantil_lower (float): if dark_filter is “quantil”, the lower quantile to use for filtering
dark_filter_quantil_upper (float): if dark_filter is “quantil”, the upper quantile to use for filtering
use_cupy (bool): if True, returns a cupy.asarray
persistent (bool): if True, the array is cached in memory and only reloaded if the file modification time changes
- returns:
Optional[Union[numpy.ndarray, cupy.ndarray]]: the array dark current correction or None if the file does not exist
- Parameters:
filename_dark (
str)data_signal_shape (
tuple)datatype (
str)binning (
tuple)dummy (
int)delta_dummy (
float)filename_mask (
str)dark_filter (
str)dark_filter_quantil_lower (
float)dark_filter_quantil_upper (
float)use_cupy (
bool)persistent (
bool)
- Return type:
Optional[ndarray]