diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py index dd39e4be12d9e81f0c6d4fe625c6e9115f6341be..8be63a6b10db464f298aa36ee31904a6c8ccd61c 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ElasticWindowMultiple.py @@ -27,8 +27,13 @@ def _normalize_by_index(workspace, index): y_values = workspace.readY(idx) y_errors = workspace.readE(idx) + # Avoid divide by zero + if y_values[index] == 0.0: + scale = np.reciprocal(1.0e-8) + else: + scale = np.reciprocal(y_values[index]) + # Normalise y values - scale = np.reciprocal(y_values[index]) y_values_normalised = scale * y_values # Propagate y errors: C = A / B ; dC = sqrt( (dA/B)^2 + (A*dB/B^2)^2 )