Ticket #8888 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Stitch1D Fixes

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: blocker Milestone: Release 3.1
Component: Reflectometry Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

Issues reported by Tim Charlton as part of Beta Testing

  • Params min and max are required as well as the step. Step should be mandatory, but min and max can be calculated from input workspaces. Both workspaces are required for this calculation.
  • StartOverlap and EndOverlap also need to be calculated if not provided.

Change History

comment:1 Changed 7 years ago by Owen Arnold

Tester. It should be sufficient that the updated unit tests are passing and that the system tests are still passing.

Using the data in the systemtest repo, you should also be able to verify that the following plots are essentially identical. There will be minor, but insignificant differences. The point of this is to compare the resulting plots.

import numpy
from mantid.simpleapi import *
from isis_reflectometry import quick
from isis_reflectometry import combineMulti

class ReflectometryQuickCombineMulti(object):

    __stitchedWorkspaceName = "stitched_13460_13462"
    
    def doQuickOnRun(self, runNumber, transmissionNumbers, instrument, incidentAngle):
        defaultInstKey = 'default.instrument'
        defaultInstrument = config[defaultInstKey]
        try:
            config[defaultInstKey] = instrument
            LoadISISNexus(Filename=str(runNumber), OutputWorkspace=str(runNumber))
            for transmissionNumber in transmissionNumbers:
                LoadISISNexus(Filename=str(transmissionNumber), OutputWorkspace=str(transmissionNumber))
            
            transmissionRuns = ",".join(map(str, transmissionNumbers))
            # Run quick
            quick.quick(str(runNumber), trans=transmissionRuns, theta=incidentAngle) 
        finally:
            config[defaultInstKey] = defaultInstrument
        return mtd[str(runNumber) + '_IvsQ']
    
    def createBinningParam(self, low, step, high):
        return "%f,%f,%f" %(low, step, high)
    
    def runTest(self):
        step = 0.040
        run1QLow = 0.010
        run1QHigh = 0.06
        run2QLow = 0.035
        run2QHigh = 0.300
        
        # Create IvsQ workspaces
        IvsQ1 = self.doQuickOnRun(runNumber=13460, transmissionNumbers=[13463,13464], instrument='INTER', incidentAngle=0.7)
        IvsQ1Binned = Rebin(InputWorkspace=IvsQ1, Params=self.createBinningParam(run1QLow, -step, run1QHigh))
        
        # Create IvsQ workspaces
        IvsQ2 = self.doQuickOnRun(runNumber=13462, transmissionNumbers=[13463,13464], instrument='INTER', incidentAngle=2.3)
        IvsQ2Binned = Rebin(InputWorkspace=IvsQ2, Params=self.createBinningParam(run2QLow, -step, run2QHigh))
        
        # Peform the stitching the old way --- specifying everything
        stitchedMany1, scaleFactor = Stitch1DMany(InputWorkspaces="%s,%s"%(IvsQ1Binned.name(), IvsQ2Binned.name()), StartOverlaps=[run2QLow], EndOverlaps=[run1QHigh], Params=[run1QLow, -step,run2QHigh])
        # Peform the stitching the new way --- where overlaps and limits can be calculated for you
        stitchedMany2, scaleFactor = Stitch1DMany(InputWorkspaces="%s,%s"%(IvsQ1Binned.name(), IvsQ2Binned.name()), Params=[-step])
        # Results should be essentially the same
        plotSpectrum([stitchedMany1, stitchedMany2], 0)
        
        
test = ReflectometryQuickCombineMulti()
test.runTest()
Last edited 7 years ago by Owen Arnold (previous) (diff)

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #8888. Fix rebin param calculations.

Fix parameter input creation/selection and update unit tests.

Changeset: d9d65837d8f267543fc6df685802f3dcb0fce191

comment:3 Changed 7 years ago by Owen Arnold

refs #8888. Calculate start and end overlap automatically.

Changeset: fe204408a7c375457c0b48ebd923bc2d7944ea17

comment:4 Changed 7 years ago by Owen Arnold

refs #8888. Make fixes to Stitch1DMany.

Also update unit tests for Stitch1DMany.

Changeset: ab56fad8b749db4ba5de0ebd8cca49be94bc3474

comment:5 Changed 7 years ago by Owen Arnold

  • Status changed from inprogress to verify
  • Resolution set to fixed

I've performed system tests on my local build, I've also kicked-off system tests here, which should pass http://download.mantidproject.org/jenkins/view/Manually%20Run%20Tests/job/isis_systemtests_rhel6/

comment:6 Changed 7 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:7 Changed 7 years ago by Martyn Gigg

Plots match very closely within the expected level of deviation with doing the work slightly differently.

comment:8 Changed 7 years ago by Martyn Gigg

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8888_fix_stitch1d'

Full changeset: 311fdbd8ee660221074c0c7ef431f51823b35e21

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9732

Note: See TracTickets for help on using tickets.