Ticket #8643 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Polarisation Correction in Quick

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: critical Milestone: Release 3.1
Component: Reflectometry Keywords:
Cc: Blocked By: #8639
Blocking: Tester: Keith Brown

Description

Max has supplied a version of quick which is also performing polarisation corrections (attached). I need to get these changes into the modern version of quick and test that it all works.

I notice two problems with the existing code that I'll need to fix-up.

  • It uses this dictionary style programming so is very very hard to read and will be difficult to implement. I suggest setting up a running environment using the attached script and the data provided by max as a starting point.
  • It takes parameters from the IDF. We may need to do something similar to the Correction type implemented now.

Attachments

quick_Max.py (28.8 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

comment:2 Changed 7 years ago by Owen Arnold

  • Milestone changed from Backlog to Release 3.1

comment:3 Changed 7 years ago by Owen Arnold

Using Polref as an example, we have reference data previously used for uncovering an issue with stitching here #7982

comment:4 Changed 7 years ago by Owen Arnold

refs #8643. Inserting the polarisation correction routines.

Appears to be working for PNR and PA cases. System test for multi detector runs is failing as a result of these changes. This will need fixing.

Changeset: d61dcd2abcfc6f21bece0d45bb3150e9f8b837ed

comment:5 Changed 7 years ago by Owen Arnold

refs #8643. Update system tests.

Changeset: 5897587eff9eff0814223389d33b375558f326fb

comment:6 Changed 7 years ago by Owen Arnold

Tester: Ensure that you run the git test macros for both the mantid repository and the systemtest repository. It would be better if the tester was at ISIS, because I need to pass them some datafiles in order to run the testing.

Run the following. It should print out a line saying "Performing PA correction with parameters from IDF..." and complete without problems.

from isis_reflectometry import quick

run1 = Load('POLREF00008481.nxs')
run2 = Load('POLREF00008481.nxs')
run3 = Load('POLREF00008481.nxs')
run4 = Load('POLREF00008481.nxs')

LoadParameterFile(Workspace=run1,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')
LoadParameterFile(Workspace=run2,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')
LoadParameterFile(Workspace=run3,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')
LoadParameterFile(Workspace=run4,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')

runs = GroupWorkspaces(InputWorkspaces='run1, run2, run3, run4')

mytemp = SumSpectra(InputWorkspace=runs, StartWorkspaceIndex=3, EndWorkspaceIndex=644)

out = quick.quick_explicit(run=runs, i0_monitor_index=2, lambda_min=0.8, lambda_max=14.5, background_min=13, 
                                     background_max=14.5, int_min=4, int_max=10, point_detector_start=3, point_detector_stop=245, theta=0.4
                                     , pointdet=False, detector_component_name='lineardetector', pol_corr=2, roi=[3,644], correct_positions=False,
                                     crho=[1.006831,-0.011467,0.002244,-0.000095],
                                     calpha=[1.017526,-0.017183,0.003136,-0.000140],
                                     cAp=[0.917940,0.038265,-0.006645,0.000282],
                                     cPp=[0.972762,0.001828,-0.000261,0.0]   )

Run the following. It should print out a line saying "Performing PNR correction with parameters from IDF" and complete without error.

run1 = Load('POLREF00008481.nxs')
run2 = Load('POLREF00008482.nxs')

LoadParameterFile(Workspace=run1,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')
LoadParameterFile(Workspace=run2,Filename=r'/Users/spu92482/Documents/mantid/mantid/Code/Mantid/instrument/POLREF_Parameters.xml')

runs = GroupWorkspaces(InputWorkspaces='run1, run2')

mytemp = SumSpectra(InputWorkspace=runs, StartWorkspaceIndex=3, EndWorkspaceIndex=644)

out = quick.quick_explicit(run=runs, i0_monitor_index=2, lambda_min=0.8, lambda_max=14.5, background_min=13, 
                                     background_max=14.5, int_min=4, int_max=10, point_detector_start=3, point_detector_stop=245, theta=0.4
                                     , pointdet=False, detector_component_name='lineardetector', pol_corr=1, roi=[3,644], correct_positions=False,
                                     crho=[1.006831,-0.011467,0.002244,-0.000095],
                                     calpha=[1.017526,-0.017183,0.003136,-0.000140],
                                     cAp=[0.917940,0.038265,-0.006645,0.000282],
                                     cPp=[0.972762,0.001828,-0.000261,0.0]   )

The system tests and unit tests should all still be passing.

Last edited 7 years ago by Owen Arnold (previous) (diff)

comment:7 Changed 7 years ago by Owen Arnold

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

comment:8 Changed 7 years ago by Keith Brown

  • Status changed from verify to verifying
  • Tester set to Keith Brown

comment:9 Changed 7 years ago by Keith Brown

  • Status changed from verifying to closed

Completes without error

comment:10 Changed 7 years ago by Keith Brown

Merge remote-tracking branch 'origin/feature/8643_quick_pol_corr'

Full changeset: c77a62947589a0e7f1a345338771712bcf67b086

comment:11 Changed 7 years ago by Andrei Savici

L2QScriptTest fails. See #8689

comment:12 Changed 7 years ago by Keith Brown

I noticed that yesterday. When i passed this i saw that he build servers were showing ok, but i didn't notice the date they last ran.

This failiure may be related to a problem i encountered yesterday.

comment:13 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Reflectometry

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9487

Note: See TracTickets for help on using tickets.