@@ -43,6 +43,8 @@ def normalize(
4343 data : cp .ndarray ,
4444 flats : cp .ndarray ,
4545 darks : cp .ndarray ,
46+ flats_multiplier : float = 1.0 ,
47+ darks_multiplier : float = 1.0 ,
4648 cutoff : float = 10.0 ,
4749 minus_log : bool = True ,
4850 nonnegativity : bool = False ,
@@ -60,13 +62,17 @@ def normalize(
6062 3D flat field data as a CuPy array.
6163 darks : cp.ndarray
6264 3D dark field data as a CuPy array.
63- cutoff : float, optional
65+ flats_multiplier: float
66+ A multiplier to apply to flats, can work as an intensity compensation constant.
67+ darks_multiplier: float
68+ A multiplier to apply to darks, can work as an intensity compensation constant.
69+ cutoff : float
6470 Permitted maximum value for the normalised data.
65- minus_log : bool, optional
71+ minus_log : bool
6672 Apply negative log to the normalised data.
67- nonnegativity : bool, optional
73+ nonnegativity : bool
6874 Remove negative values in the normalised data.
69- remove_nans : bool, optional
75+ remove_nans : bool
7076 Remove NaN and Inf values in the normalised data.
7177
7278 Returns
@@ -82,6 +88,9 @@ def normalize(
8288 mean (darks , axis = 0 , dtype = float32 , out = dark0 )
8389 mean (flats , axis = 0 , dtype = float32 , out = flat0 )
8490
91+ dark0 *= darks_multiplier
92+ flat0 *= flats_multiplier
93+
8594 kernel_name = "normalisation"
8695 kernel = r"""
8796 float denom = float(flats) - float(darks);
0 commit comments