Ticket #8042 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Stitch1DMany

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: major Milestone: Release 3.0
Component: Reflectometry Keywords:
Cc: Blocked By:
Blocking: Tester: Gesner Passos

Description

New algorithm to do the work of combineMulti.py without the annoying interface on this existing script. A proper algorithm to do this would be much better than our current state of affairs. The changes here #8034 should be the last ones required to the old combineMulti, which I'll try to find a way to deprecate.

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Milestone changed from Backlog to Release 3.0

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #8042. Code templates.

Changeset: db43a6f85ef59244c998923bcbb93b2a8b30848d

comment:3 Changed 7 years ago by Owen Arnold

refs #8042. Check combine two WS.

Changeset: b56c3b708a9d36374b86be564bbd78846faf5d66

comment:4 Changed 7 years ago by Owen Arnold

refs #8042. Fix bug with integration.

Changeset: f905086571e105ae7cba476cf4181325ecf9aa99

comment:5 Changed 7 years ago by Owen Arnold

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

Tester:

  • Code review and check unit tests
  • The following test is adapted from the ReflectometryQuickCombineMulti system test.
from mantid.simpleapi import *
from isis_reflgui import quick
from isis_reflgui import combineMulti

class ReflectometryQuickCombineMulti(object):
    """
    This is a system test for the top-level CombineMulti routines. Quick is the name given to the 
    ISIS reflectometry reduction scripts. CombineMulti is used for stitching together runs converted Into I/I0 vs |Q| taken at 
    different incident angles (and hence covering different Q-ranges) 
    """
    
    __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
        stitchedMany = Stitch1DMany(InputWorkspaces="%s,%s"%(IvsQ1Binned.name(), IvsQ2Binned.name()), StartOverlaps=[run2QLow], EndOverlaps=[run1QHigh], Params=[run1QLow, -step,run2QHigh])
        combineMulti.combineDataMulti([IvsQ1Binned.name(), IvsQ2Binned.name()], self.__stitchedWorkspaceName, [run1QLow, run2QLow], [run1QHigh, run2QHigh], run1QLow, run2QHigh, -step, 1)

        
        
test = ReflectometryQuickCombineMulti()
test.runTest()
plotSpectrum(["stitched_13460_13462", "stitchedMany"], 0)

The output workspaces should be the same via the older CombineMulti script and the newer Stitch1DMany algorithm. The plot demonstrates this.

comment:6 Changed 7 years ago by Owen Arnold

  • Status changed from verify to reopened
  • Resolution fixed deleted

Fix system tests ref results.

comment:7 Changed 7 years ago by Owen Arnold

  • Status changed from reopened to inprogress

refs #8042. Update system tests.

Changeset: c2f685665069caec229eafcc742e16b06146f3da

comment:8 Changed 7 years ago by Owen Arnold

Tester: You will need to merge two branches with identical names (feature/8042_stitch_many) into the mantid and systemtest repositories!

comment:9 Changed 7 years ago by Owen Arnold

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

comment:10 Changed 7 years ago by Owen Arnold

refs #8042. Update quick reference results.

Changeset: de6cf1c2e002de9f4110b6e377cb63b6741027a6

comment:11 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:12 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8042_stitch_many'

Full changeset: 961c48407e2b154130e7e07daac9f56bd30bd754

comment:13 Changed 7 years ago by Gesner Passos

Merge remote-tracking branch 'origin/feature/8042_stitch_many'

Full changeset: 6b2ced019b1a6b370c41aea1629b378ae3fb5afb

comment:14 Changed 7 years ago by Gesner Passos

The results are compatible, and differences (in the systemtest) are really minimal. Besides, having the algorithm improves the interaction.

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8887

Note: See TracTickets for help on using tickets.