Improve validation when applying calibration in ISISIndirectEnergyReduction algorithm #38464
Labels
Bug
Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)
Indirect/Inelastic
Issues and pull requests related to indirect or inelastic
ISIS Team: Spectroscopy
Issue and pull requests managed by the Spectroscopy subteam at ISIS
Reported by: Sanghamitra
Describe the bug
ISIS Indirect Energy Reduction Algorithm can apply a calibration step by dividing the spectra to a correction factor contained on a calibration file.
If the calibration file has some values equal to 0, it results on a divide by zero error when the calibration is applied and the final
reduction is not valid.
To Reproduce
This script should run the algorithm just fine:
Now uncommenting the line :
test_calib.setY(0,np.array([0]))
should run the algorithm wihout errors, but the output reduction workspaceirs26173_graphite002_red
does not contain any value.Expected behavior
User is notified that calibration file contains invalid values. Faulty detectors should not be used.
Extra info:
Faulty detectors create 0 values. We have to check also whether this calibration step is similar in OSIRIS reduction.
Also, the fix in Calibration file should not break reduction workflow for other options, such as “Individual”, “Custom”, Files etc.
Screenshots
Platform/Version (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: