Commit 0fbd6f77 authored by Henri Payno's avatar Henri Payno
Browse files

[io][spec] add test on mu once divided by the monitor. Can contain some infinite values

parent 536e90ff
Pipeline #52527 failed with stages
in 20 minutes and 13 seconds
...@@ -160,7 +160,8 @@ class PyMca_normalization(Process): ...@@ -160,7 +160,8 @@ class PyMca_normalization(Process):
self._advancement.startProcess() self._advancement.startProcess()
self._pool_process(xas_obj=_xas_obj) self._pool_process(xas_obj=_xas_obj)
self._advancement.endProcess() self._advancement.endProcess()
assert _xas_obj.normalized_energy is not None if _xas_obj.normalized_energy is None:
raise ValueError("Fail to compute normalize energy")
self.register_process( self.register_process(
_xas_obj, _xas_obj,
data_keys=( data_keys=(
......
...@@ -107,7 +107,14 @@ def read_spectrum( ...@@ -107,7 +107,14 @@ def read_spectrum(
monitor = spec_file.data_column_by_name( monitor = spec_file.data_column_by_name(
scan_index=i_data, label=monitor_col_name scan_index=i_data, label=monitor_col_name
) )
mu = mu / monitor mu = mu / monitor
if numpy.any(mu == numpy.inf) or numpy.any(mu == -numpy.inf):
_logger.warning(
"found inf values after mu division by the monitor. Replace them by 0"
)
mu[mu == numpy.inf] = 0
mu[mu == -numpy.inf] = 0
return energy, numpy.asarray(mu) return energy, numpy.asarray(mu)
return energy, mu return energy, mu
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