Commit 259665ea authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Add nan_value in flatfield_cuda.py

parent 756b7e81
Pipeline #72939 failed with stage
in 6 minutes
......@@ -16,6 +16,7 @@ class CudaFlatFieldArrays(FlatFieldArrays):
radios_indices=None,
interpolation: str = "linear",
distortion_correction=None,
nan_value=1.0,
cuda_options: Union[dict, None] = None,
):
"""
......@@ -35,7 +36,8 @@ class CudaFlatFieldArrays(FlatFieldArrays):
darks,
radios_indices=radios_indices,
interpolation=interpolation,
distortion_correction=distortion_correction
distortion_correction=distortion_correction,
nan_value=nan_value
)
self._set_cuda_options(cuda_options)
self._init_cuda_kernels()
......@@ -54,15 +56,19 @@ class CudaFlatFieldArrays(FlatFieldArrays):
raise ValueError(
"Interpolation other than linar is not yet implemented in the cuda back-end"
)
#
self._cuda_fname = get_cuda_srcfile("flatfield.cu")
options = [
"-DN_FLATS=%d" % self.n_flats,
"-DN_DARKS=%d" % self.n_darks,
]
if self.nan_value is not None:
options.append("-DNAN_VALUE=%f" % self.nan_value)
self.cuda_kernel = CudaKernel(
"flatfield_normalization",
self._cuda_fname,
signature="PPPiiiPP",
options=[
"-DN_FLATS=%d" % self.n_flats,
"-DN_DARKS=%d" % self.n_darks,
]
options=options
)
self._nx = np.int32(self.shape[1])
self._ny = np.int32(self.shape[0])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment