Ticket #7982 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

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

Screen Shot 2013-09-19 at 09.02.58.png (20.9 KB) - added by Owen Arnold 7 years ago.
Tims.zip (13.5 KB) - added by Owen Arnold 7 years ago.

Change History

Changed 7 years ago by Owen Arnold

comment:1 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress
  • Description modified (diff)

Changed 7 years ago by Owen Arnold

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

This ticket is implicitly fixed by #8034, which is still in a verify state, because Stitch1D now calculates the Mean internally if the WeightedMean cannot be used. Do not verify this until #8034 has been verified. No branches/code changes required here.

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.

Last edited 7 years ago by Jay Rainey (previous) (diff)

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8827

Note: See TracTickets for help on using tickets.