Ticket #8616 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

CreateTransmissionWorkspaceAuto

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: critical Milestone: Release 3.1
Component: Reflectometry Keywords:
Cc: Blocked By: #8520, #8589
Blocking: Tester: Karl Palmen

Description (last modified by Owen Arnold) (diff)

Max feels quite strongly that we ought to have methods to grab existing IDF parameters and feed them into our new algorithms (#8589 CreateTransmissionWorkspaceAuto). This is the existing way that quick works. See quick and quick_explicit #8520.

By far the best way to do this would be as a python algorithm as it avoids hard-coding IDF parameter names into binaries. The algorithms should be very simple and fill in as much as possible in CreateTransmissionWorkspace. This methodology will be required in order for us to replace the usage of quick script in the gui with these new algorithms.

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Description modified (diff)
  • Blocked By 8520 added

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #8616. Adding properties to dec.

Changeset: c7abd61dfc3a40d6f5fd1dec24daff2592d2a8d5

comment:3 Changed 7 years ago by Owen Arnold

refs #8616. Add remaining properties.

Changeset: 4eb962c5788ba83f21536d37ab34115025faac40

comment:4 Changed 7 years ago by Owen Arnold

refs #8616. Implemented now extending tests.

Have subclassed the existing test methods as these all should still work.

Changeset: b5cb1a53f177a24979c659cfd493384af181228c

comment:5 Changed 7 years ago by Owen Arnold

refs #8616. Extend and fix tests.

Check via the history that the algorithm values supplied were from the IDF.

Changeset: 6c8c0ae19e3a01500f7119f04df40d69301f48a8

comment:6 Changed 7 years ago by Owen Arnold

refs #8616. Base python test class.

Changeset: 39b62a0bc9ed7573e75aeb8783f09e6086b10ffb

comment:7 Changed 7 years ago by Owen Arnold

refs #8616. Use test base class in auto algorithm.

This firstly ensures that the layout of the CreateTransmissionWorkspaceAuto algorithm is the same as CreateTransmissionWorkspace algorithm, and also that it's behaviour is the same if all parameters are passed in.

Changeset: ac79606e83232e53f7b8f50b278df163e8c11753

comment:8 Changed 7 years ago by Owen Arnold

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

Tester: The following script creates two comparison plots. Each plot contains two curves that should be identical. One curve from the full-blown explicit algorithm as a base-line, and another from the Auto version of the CreateTransmissionWorkspace algorithm. Comparing the plots and checking the unit tests should be sufficient.

from mantid.simpleapi import *
from isis_reflectometry import quick
reload(quick)

class ReflectometryQuick(object):
  
    def runTest(self):
        defaultInstKey = 'default.instrument'
        defaultInstrument = config[defaultInstKey]
        
        config[defaultInstKey] = 'INTER'
        LoadISISNexus(Filename='13463', OutputWorkspace='13463')
        LoadISISNexus(Filename='13464', OutputWorkspace='13464')
        LoadISISNexus(Filename='13460', OutputWorkspace='13460')
    
        transmissionRuns = '13463,13464'
        
        # Via full algorithm
        transmission1 = CreateTransmissionWorkspace(WavelengthMin=1.0, WavelengthMax=17.0, WavelengthStep=0.05, MonitorBackgroundWavelengthMin=15.0, 
        MonitorBackgroundWavelengthMax=17.0, I0MonitorIndex=2, MonitorIntegrationWavelengthMin=4.0, MonitorIntegrationWavelengthMax=10.0, 
        WorkspaceIndexList=[3,4], FirstTransmissionRun='13463')
        
        # Via auto algorithm
        transmission2 = CreateTransmissionWorkspaceAuto(AnalysisMode='PointDetectorAnalysis', FirstTransmissionRun="13463")
        
        plotSpectrum([transmission1, transmission2], 0)
        
        
        # Via full algorithm
        transmission3 = CreateTransmissionWorkspace(WavelengthMin=1.0, WavelengthMax=17.0, WavelengthStep=0.05, MonitorBackgroundWavelengthMin=15.0, 
        MonitorBackgroundWavelengthMax=17.0, I0MonitorIndex=2, MonitorIntegrationWavelengthMin=4.0, MonitorIntegrationWavelengthMax=10.0, 
        WorkspaceIndexList=[3,4], Params=[1.5, 0.02, 17], StartOverlap=10.0, EndOverlap=12.0, FirstTransmissionRun='13463', SecondTransmissionRun='13464')
        
        # Via auto algorithm
        transmission4 = CreateTransmissionWorkspaceAuto(AnalysisMode='PointDetectorAnalysis', FirstTransmissionRun="13463", SecondTransmissionRun='13464', StartOverlap=10.0, EndOverlap=12.0, Params=[1.5, 0.02, 17.0])
        
        plotSpectrum([transmission3, transmission4], 0)
        
        
test = ReflectometryQuick()
test.runTest()

comment:9 Changed 7 years ago by Karl Palmen

  • Status changed from verify to verifying
  • Tester set to Karl Palmen

comment:10 Changed 7 years ago by Karl Palmen

  • Status changed from verifying to reopened
  • Resolution fixed deleted

When I ran the script I found only one curve shown in each plot. When I used show data, I saw the second curve was Y=0 in the transmission1 workspace and Y=nan in the transmission3 workspace.

comment:11 Changed 7 years ago by Owen Arnold

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

There are two curves in each plot should be identical. transmission1 and transmission2 are plotted together because they should be identical (and are). transmission3 and transmission4 are plotted together because those should be identical (and are). transmission1 and transmission3 are NOT comparable, that is why the script does not attempt to plot the spectrum from those two workspace together.

comment:12 Changed 7 years ago by Karl Palmen

  • Status changed from verify to verifying

comment:13 Changed 7 years ago by Karl Palmen

This time I also plotted the two curves of each of the original plots separately to verify that the reason only the second curve was visible was because it matches the first curve and so obscures it.

comment:14 Changed 7 years ago by Karl Palmen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8616_tranmission_auto'

Full changeset: f4db882ebe47d5e81ae62739de0a0d984db3c15a

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9460

Note: See TracTickets for help on using tickets.