Commit 53a20bf8 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Improve error message when sino_normalization_file is invalid

parent c61193ab
Pipeline #65163 passed with stage
in 6 minutes and 25 seconds
......@@ -597,6 +597,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")
......
......@@ -140,19 +140,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)
self._sino_normalization_arr = norm_array.astype("f")
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")
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
......
Markdown is supported
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