Ticket #9166 (closed: fixed)
CalculateGammaBackground does not copy the errors to the output workspace
Reported by: | Martyn Gigg | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.2 |
Component: | Direct Inelastic | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Keith Brown |
Description
The CalculateGammaBackground algorithm implemented for Vesuvio in #8378 does not copy the errors from the input workspace to the corrected workspace and leaves them at zero. Trying to use the fitting with this then results in lots of divide by zero errors.
This test script demonstrates the problem:
from mantid.simpleapi import * # # Load # runs = "14188-14195" spectra = "135-142" diff_type="SingleDifference" # Allowed values=Single,Double,Thick ip_file = "IP0004_10.par" raw_ws = LoadVesuvio(Filename=runs, SpectrumList=spectra, Mode=diff_type,InstrumentParFile=ip_file) raw_ws = CropWorkspace(raw_ws,XMin=50.0,XMax=562.0) # # Correct - Usually this string would come out of being constructed from Fit # mass1_str = "name=GramCharlierComptonProfile,WorkspaceIndex=0,Mass=1.007900,HermiteCoeffs=1 0 0,Width=4.226288,FSECoeff=0.498073,C_0=57.941101" mass2_str = "name=GaussianComptonProfile,WorkspaceIndex=0,Mass=27.000000,Width=13.000000,Intensity=1.626268" mass3_str = "name=GaussianComptonProfile,WorkspaceIndex=0,Mass=91.200000,Width=26.000000,Intensity=2.977515" func_str = "%s;%s;%s" %(mass1_str,mass2_str,mass3_str) background,corrected = CalculateGammaBackground(InputWorkspace=raw_ws, ComptonFunction=func_str,WorkspaceIndexList=0) # Fit corrected # Convert to seconds ScaleX(InputWorkspace='corrected ',OutputWorkspace='corrected ',Operation='Multiply',Factor=1e-06) ties_str = "f1.Width=10.000000,f2.Width=25.000000" constraints_str = "2.000000 < f0.Width < 7.000000" Fit(InputWorkspace='corrected ',Function=function_str,Ties=ties_str,Constraints=constraints_str, Output='fit', CreateOutput=True,OutputCompositeMembers=True,MaxIterations=5000, Minimizer="Levenberg-Marquardt,AbsError=1e-08,RelError=1e-08") # Convert back to microseconds ScaleX(InputWorkspace='fit_Workspace',OutputWorkspace='fit_Workspace',Operation='Multiply',Factor=1e06) ScaleX(InputWorkspace='corrected ',OutputWorkspace='corrected ',Operation='Multiply',Factor=1e06)
Change History
comment:2 Changed 7 years ago by Martyn Gigg
- Status changed from assigned to inprogress
Formatting changes to put the methods back in the right order
Refs #9166
Changeset: 0b44233e6593a3665bbc567f912b404d571775ae
comment:3 Changed 7 years ago by Martyn Gigg
Copy errors across to corrected workspace for all cases.
Refs #9166
Changeset: 72cf3d077c02584227d9a716e83b118801f7eee2
comment:4 Changed 7 years ago by Martyn Gigg
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: feature/9166_errors_on_calculategammabackground
Tester: Use the script in the description to run the gamma correction. The location of the required files is described here
comment:5 Changed 7 years ago by Keith Brown
- Status changed from verify to verifying
- Tester set to Keith Brown
comment:6 Changed 7 years ago by Keith Brown
- Status changed from verifying to closed
Merge remote-tracking branch 'origin/feature/9166_errors_on_calculategammabackground'
Full changeset: 6ea8f6edc3e054ae8e9b74486b63c3a59b193b9c