Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gamma correction to use updated algorithm #131

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/mvesuvio/analysis_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,25 +994,9 @@ def create_gamma_workspaces(self):

profiles = self.calcGammaCorrectionProfiles(self._mean_widths, self._mean_intensity_ratios)

# Approach below not currently suitable for current versions of Mantid, but will be in the future
# background, corrected = VesuvioCalculateGammaBackground(InputWorkspace=inputWS, ComptonFunction=profiles)
# DeleteWorkspace(corrected)
# RenameWorkspace(InputWorkspace= background, OutputWorkspace = inputWS+"_Gamma_Background")

ws = CloneWorkspace(InputWorkspace=inputWS, OutputWorkspace="tmpGC")
for spec in range(ws.getNumberHistograms()):
background, corrected = VesuvioCalculateGammaBackground(
InputWorkspace=inputWS, ComptonFunction=profiles, WorkspaceIndexList=spec
)
ws.dataY(spec)[:], ws.dataE(spec)[:] = (
background.dataY(0)[:],
background.dataE(0)[:],
)
DeleteWorkspace(background)
background, corrected = VesuvioCalculateGammaBackground(InputWorkspace=inputWS, ComptonFunction=profiles)
DeleteWorkspace(corrected)
RenameWorkspace(
InputWorkspace="tmpGC", OutputWorkspace=inputWS + "_Gamma_Background"
)
RenameWorkspace(InputWorkspace= background, OutputWorkspace = inputWS + "_Gamma_Background")

Scale(
InputWorkspace=inputWS + "_Gamma_Background",
Expand Down
Loading