Skip to content

Commit

Permalink
Merge pull request #922 from mantidproject/0_correct_error_propagatioN
Browse files Browse the repository at this point in the history
Correct error propagation in GDOS intensity correction
  • Loading branch information
SilkeSchomann authored Jun 23, 2023
2 parents 33876af + ee06283 commit e98c745
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mslice/models/intensity_correction_algs.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def _reduce_bins_and_return_signal_error(slice_gdos, algorithm, cut_axis, int_ax
def _reduce_bins_and_return_signal_error_PSD(slice_gdos, algorithm, int_axis, cut_axis_id, cut_slice_alignment):
# PSD type workspace, just sum all the bins
signal = np.nansum(slice_gdos.get_signal(), axis=cut_axis_id, keepdims=True)
error = np.nansum(np.sqrt(slice_gdos.get_variance()), cut_axis_id, keepdims=True)
error = np.sqrt(np.nansum(slice_gdos.get_variance(), cut_axis_id, keepdims=True))
if not cut_slice_alignment:
signal = signal.transpose()
error = error.transpose()
Expand Down
2 changes: 1 addition & 1 deletion tests/intensity_correction_algs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _internal_tst_reduce_bins(self, algorithm, rotated, use_psd, createMDHistoWo
if use_psd:
integration_factor = int_axis.step if algorithm == 'Integration' else 1
signal_result = np.nansum(selected_test_ws.get_signal(), int(rotated), keepdims=True) * integration_factor
error_result = np.nansum(selected_test_ws.get_error(), int(rotated), keepdims=True) * integration_factor
error_result = np.sqrt(np.nansum(selected_test_ws.get_variance(), int(rotated), keepdims=True)) * integration_factor
shape_string = f'{signal_result.shape[1]},{signal_result.shape[0]}' if rotated else f'{signal_result.shape[0]},' \
f'{signal_result.shape[1]}'
self.assertEqual(shape_string, createMDHistoWorkspace_mock.call_args[1]['NumberOfBins'])
Expand Down

0 comments on commit e98c745

Please sign in to comment.