Skip to content

Commit c4b846d

Browse files
Update gamma correction to use updated algorithm
Mantid's algorithm for gamma correction was recently updated to correct a bug where output workspaces would not preserve the order of the spectra. Now that this is fixed, we can avoid using a for loop for the gamma correction algorithm.
1 parent 5f81684 commit c4b846d

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/mvesuvio/analysis_reduction.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -995,24 +995,9 @@ def create_gamma_workspaces(self):
995995
profiles = self.calcGammaCorrectionProfiles(self._mean_widths, self._mean_intensity_ratios)
996996

997997
# Approach below not currently suitable for current versions of Mantid, but will be in the future
998-
# background, corrected = VesuvioCalculateGammaBackground(InputWorkspace=inputWS, ComptonFunction=profiles)
999-
# DeleteWorkspace(corrected)
1000-
# RenameWorkspace(InputWorkspace= background, OutputWorkspace = inputWS+"_Gamma_Background")
1001-
1002-
ws = CloneWorkspace(InputWorkspace=inputWS, OutputWorkspace="tmpGC")
1003-
for spec in range(ws.getNumberHistograms()):
1004-
background, corrected = VesuvioCalculateGammaBackground(
1005-
InputWorkspace=inputWS, ComptonFunction=profiles, WorkspaceIndexList=spec
1006-
)
1007-
ws.dataY(spec)[:], ws.dataE(spec)[:] = (
1008-
background.dataY(0)[:],
1009-
background.dataE(0)[:],
1010-
)
1011-
DeleteWorkspace(background)
998+
background, corrected = VesuvioCalculateGammaBackground(InputWorkspace=inputWS, ComptonFunction=profiles)
1012999
DeleteWorkspace(corrected)
1013-
RenameWorkspace(
1014-
InputWorkspace="tmpGC", OutputWorkspace=inputWS + "_Gamma_Background"
1015-
)
1000+
RenameWorkspace(InputWorkspace= background, OutputWorkspace = inputWS + "_Gamma_Background")
10161001

10171002
Scale(
10181003
InputWorkspace=inputWS + "_Gamma_Background",

0 commit comments

Comments
 (0)