Commit d9f15fb3 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Improve error message when sino_normalization_file is invalid

parent 47c1a579
Pipeline #73814 failed with stage
in 29 seconds
...@@ -598,6 +598,7 @@ class ChunkedPipeline: ...@@ -598,6 +598,7 @@ class ChunkedPipeline:
self.sino_normalization = self.SinoNormalizationClass( self.sino_normalization = self.SinoNormalizationClass(
kind=options["method"], kind=options["method"],
radios_shape=self._get_shape("sino_normalization"), radios_shape=self._get_shape("sino_normalization"),
normalization_array=options["normalization_array"]
) )
@use_options("build_sino", "sino_builder") @use_options("build_sino", "sino_builder")
......
...@@ -147,19 +147,18 @@ class ProcessConfig(ProcessConfigBase): ...@@ -147,19 +147,18 @@ class ProcessConfig(ProcessConfigBase):
def _get_user_sino_normalization(self): def _get_user_sino_normalization(self):
self._sino_normalization_arr = None self._sino_normalization_arr = None
norm = nabu_config["preproc"]["sino_normalization"] norm = self.nabu_config["preproc"]["sino_normalization"]
if norm not in ["subtraction", "division"]: if norm not in ["subtraction", "division"]:
return return
norm_path = "silx://" + self.nabu_config["preproc"]["sino_normalization_file"].strip() norm_path = "silx://" + self.nabu_config["preproc"]["sino_normalization_file"].strip()
url = DataUrl(norm_path) url = DataUrl(norm_path)
try: try:
norm_array = get_data(url) norm_array = get_data(url)
self._sino_normalization_arr = norm_array.astype("f")
except (ValueError, OSError) as exc: except (ValueError, OSError) as exc:
self.logger.error( error_msg = "Could not load sino_normalization_file %s. The error was: %s" % (norm_path, str(exc))
"Could not load sino_normalization_file %s. The error was:" % norm_path self.logger.error(error_msg)
) raise ValueError(error_msg)
self.logger.error(str(exc))
self._sino_normalization_arr = norm_array.astype("f")
@property @property
......
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