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

CalculateGammaBackground does not copy the errors to the output workspace #10009

Closed
martyngigg opened this issue Mar 12, 2014 · 1 comment
Closed
Assignees
Labels
Direct Inelastic Issues and pull requests related to direct inelastic High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Milestone

Comments

@martyngigg
Copy link
Member

The CalculateGammaBackground algorithm implemented for Vesuvio in http://trac.mantidproject.org/mantid/ticket/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:

#!python
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)
@martyngigg
Copy link
Member Author

This issue was originally trac ticket 9166

@martyngigg martyngigg added High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Direct Inelastic Issues and pull requests related to direct inelastic labels Jun 3, 2015
@martyngigg martyngigg self-assigned this Jun 3, 2015
@martyngigg martyngigg added this to the Release 3.2 milestone Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Direct Inelastic Issues and pull requests related to direct inelastic High Priority An issue or pull request that if not addressed is severe enough to postponse a release.
Projects
None yet
Development

No branches or pull requests

1 participant