Ticket #7982 (closed: fixed)
Saw Tooth Stitching
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | critical | Milestone: | Release 3.0 |
Component: | Reflectometry | Keywords: | |
Cc: | Blocked By: | #7962, #7983 | |
Blocking: | Tester: | Jay Rainey |
Description (last modified by Owen Arnold) (diff)
The current reflectometry stitching procedure involving combineMulti.py is generating a saw-tooth fit under certain conditions. See screenshot.
Need to investigate and hopefully fix the cause of this.
Script to replicate this is below. Dat files will be attached.
from isis_reflgui import combineMulti import os DataDir= os.path.expanduser('~/Desktop/Tims') print os.path.join(DataDir, 'polref8481.dat') r8481 = Load(Filename= os.path.join(DataDir, 'polref8481.dat'),Unit='MomentumTransfer') r8482 = Load(Filename= os.path.join(DataDir, 'polref8482.dat'),Unit='MomentumTransfer') r8483 = Load(Filename= os.path.join(DataDir, 'polref8483.dat'),Unit='MomentumTransfer') r8481 = SortXAxis(r8481) r8482 = SortXAxis(r8482) r8483 = SortXAxis(r8483) Rebin(InputWorkspace='r8481',OutputWorkspace='r8481',Params='0.009,-0.02,0.034',PreserveEvents='0') Rebin(InputWorkspace='r8482',OutputWorkspace='r8482',Params='0.017,-0.02,0.06',PreserveEvents='0') Rebin(InputWorkspace='r8483',OutputWorkspace='r8483',Params='0.027,-0.02,0.100',PreserveEvents='0') ConvertToHistogram(InputWorkspace='r8481',OutputWorkspace='r8481h') ConvertToHistogram(InputWorkspace='r8482',OutputWorkspace='r8482h') ConvertToHistogram(InputWorkspace='r8483',OutputWorkspace='r8483h') wcomb = combineMulti.combineDataMulti(['r8481h' , 'r8482h', 'r8483h'],'test_IvsQ',[0.009, 0.018, 0.04],[0.03, 0.046, 0.1],0.009,0.1,binning=-0.02,keep=1) plotSpectrum(['test_IvsQ'], 0)
Attachments
Change History
comment:1 Changed 7 years ago by Owen Arnold
- Status changed from new to inprogress
- Description modified (diff)
comment:2 Changed 7 years ago by Owen Arnold
It looks like this is an issue resulting from the fact that the input data has errors set to zero. Stitching involves extracting the overlap regions and performing a weighted mean of the contribution from both workspaces being stitched. Because the WeightedMean will multiply each set of bin counts by the harmonic mean of the error values from both workspaces, if the errors in any workspace are zero, then the weighted mean will also be zero.
My way around this is to exit the processing of combineMulti if the input data has completely zero errors.
comment:3 Changed 7 years ago by Owen Arnold
- Blocked By 7983 added
It might be more sensible yet, to determine whether there are complete zeros in the errors for all spectra and apply either WeightedMean, or Mean based on the outcome. We have no Mean algorithm, so I'm going to do that under a separate ticket (#7983).
comment:4 Changed 7 years ago by Nick Draper
- Milestone changed from Backlog to Release 3.0
moved to Release 3.0 as these all seem to be active
comment:5 Changed 7 years ago by Owen Arnold
- Status changed from inprogress to verify
- Resolution set to fixed
comment:6 Changed 7 years ago by Jay Rainey
- Status changed from verify to verifying
- Tester set to Jay Rainey
comment:7 Changed 7 years ago by Jay Rainey
- Status changed from verifying to closed
The changes that were made in #8034 address this problem and a saw-tooth fit no longer occurs — screenshot.