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