Ticket #2233 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Improve rebinning of SofQW

Reported by: Nick Draper Owned by: Martyn Gigg
Priority: major Milestone: Release 2.0
Component: Mantid Keywords:
Cc: scu@… Blocked By: #2214
Blocking: Tester: Stuart Campbell

Description (last modified by Stuart Campbell) (diff)

The 2D rebinning of SofQW is simplistic and needs to be improved.

The underlying data is not simple but need to be rebinned into a regular grid with error analysis. Sample code from lamp at the ILL is attached. and some potentially useful code from matlab.

Attachments

RE sofqw.txt (15.3 KB) - added by Nick Draper 10 years ago.
correct conversion to Q.txt (3.0 KB) - added by Nick Draper 10 years ago.
SofQW2_Negative_Q.png (45.4 KB) - added by Stuart Campbell 9 years ago.

Change History

Changed 10 years ago by Nick Draper

Changed 10 years ago by Nick Draper

comment:1 Changed 10 years ago by Nick Draper

comment:2 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 27 to Iteration 28

Bulk move of tickets at the end of iteration 27

comment:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:4 Changed 9 years ago by Stuart Campbell

  • Cc scu@… added

comment:5 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 29 to Iteration 30

"New" tickets moved at the code freeze of iteration 29

comment:6 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:7 Changed 9 years ago by Martyn Gigg

In [13369]:

Refs #2233. New SofQW looks correct but is slow so needs improvement. Test is disabled for this reason at the moment but I'd like to checkpoint my work.

comment:8 Changed 9 years ago by Martyn Gigg

In [13370]:

Fix for OpenMP loop type for windows. Refs #2233

comment:9 Changed 9 years ago by Martyn Gigg

In [13372]:

Fix for multiple constructor matches on Mac. Refs #2233

comment:10 Changed 9 years ago by Martyn Gigg

In [13411]:

Improved the performance of SofQW2. Enabling the unit test. Still room for improvement though I think. Refs #2233

comment:11 Changed 9 years ago by Russell Taylor

In [13428]:

Fix for Intel compiler getting stuck. Re #2233.

comment:12 Changed 9 years ago by Martyn Gigg

In [13472]:

Added dedicated Quadrilateral class that has no dynamic vertex allocation to improve speed for rebinning. Refs #2233

comment:13 Changed 9 years ago by Martyn Gigg

In [13473]:

Speed improvements for rebinned SofQW. At the moment the algorithm name is SofQW2 so that it doesn't supercede the other until I get verification that it is doing the right thing. Re #2233

comment:14 Changed 9 years ago by Martyn Gigg

In [13623]:

Refs #2233. Correct the theta binning to only take in to account the detector's angular width rather than a continuum between this and the next.

comment:15 Changed 9 years ago by Martyn Gigg

In [13624]:

Refs #2233 Update tests values.

comment:16 Changed 9 years ago by Martyn Gigg

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

comment:17 Changed 9 years ago by Wenduo Zhou

  • Status changed from verify to verifying
  • Tester set to Wenduo Zhou

comment:18 Changed 9 years ago by Wenduo Zhou

  • Status changed from verifying to verify
  • Tester Wenduo Zhou deleted

comment:19 Changed 9 years ago by Stuart Campbell

  • Status changed from verify to verifying
  • Tester set to Stuart Campbell

comment:20 Changed 9 years ago by Stuart Campbell

I tried the following script...

LoadEventNexus(Filename='/home/scu/Code/Mantid/Test/Data/BSS_16715_event.nxs',OutputWorkspace='WS')
ConvertUnits(InputWorkspace='WS',OutputWorkspace='WS',Target='DeltaE',EMode='Indirect')
Rebin(InputWorkspace='WS',OutputWorkspace='WS',Params='-0.012,0.0004,0.012')
SofQW(InputWorkspace='WS',OutputWorkspace='16715_sqw',QAxisBinning='0.2,0.2,2',EMode='Indirect')
SofQW2(InputWorkspace='WS',OutputWorkspace='16715_sqw2',QAxisBinning='0.2,0.2,2',EMode='Indirect')

The output from SofQW looks ok, but the output from SofQW2 is all 0.0's.

I also get the same for CNCS, but it takes about 10mins to run.

comment:21 Changed 9 years ago by Stuart Campbell

  • Status changed from verifying to reopened
  • Resolution fixed deleted
  • Milestone changed from Iteration 30 to Iteration 31

After discussing with Nick, this can go to the next iteration.

comment:22 Changed 9 years ago by Martyn Gigg

Refs #2233. Make SofQW2 a better at checking what information is required.

The algorithm will now throw if Ei has not been provided in Direct mode, whether within the workspace from GetEi or set explicity. In Indirect mode it will throw if it cannot find efixed on a component or in its tree.

Changeset: 45e67dccdc37761e6bdb1370ccc43398850177c3

comment:23 Changed 9 years ago by Martyn Gigg

  • Status changed from reopened to accepted

comment:24 Changed 9 years ago by Martyn Gigg

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

I think this should fix the problems with everything being zero.

comment:25 Changed 9 years ago by Martyn Gigg

Refs #2233. Make SofQW2 a better at checking what information is required.

The algorithm will now throw if Ei has not been provided in Direct mode, whether within the workspace from GetEi or set explicity. In Indirect mode it will throw if it cannot find efixed on a component or in its tree.

Changeset: 45e67dccdc37761e6bdb1370ccc43398850177c3

comment:26 Changed 9 years ago by Nick Draper

There remains a known issue about how this handles masked data, but that is dealt with in a separate ticket

comment:27 Changed 9 years ago by Stuart Campbell

  • Status changed from verify to verifying

comment:28 Changed 9 years ago by Stuart Campbell

  • Load CNCS_7860_event.nxs from AutoTestData directory.
  • ConvertUnits into DeltaE, Direct Mode, Efixed = 3.0
  • Rebin -2.9,0.01,2.9

Run SofQW:(QAxisBinning="0.0,0.2,2.0")
without specifying Efixed/Ei:

Error in execution of algorithm SofQW:
Workspace2D::getSpectrum, histogram number out of range

specifying Ei explicitly: --> Works OK - except Q range looks to go -ve.

Run SofQW2:(QAxisBinning="0.0,0.2,2.0")
without specifying Efixed/Ei:

No errors - took 577 seconds.

specifying an Ei explicitly:

No errors - took 810 seconds.

Again data looks like it is going -ve, but I think that this is a centre/edge of bin issue.

Changed 9 years ago by Stuart Campbell

comment:29 Changed 9 years ago by Stuart Campbell

Uploaded screenshot to show how the data seems to go into negative Qs'.

comment:30 Changed 9 years ago by Stuart Campbell

  • Load BSS_15600_event.nxs
  • ConvertUnits into DeltaE, Indirect, default Efixed.
  • Rebin, -0.012,0.001,0.012

Run SofQW2 (QAxisBinning="0.0,0.2,2.0"): Using default Ef:

SofQW2: Cannot find EFixed parameter for component "0". This is required in indirect mode. Please check the IDF contains these values.
Exception thrown in parallel region
Error in execution of algorithm SofQW2:
SofQW2: error (see log)

Specifying Ef=2.08:

Works ok - Q goes -ve.

SofQW shows the same behaviour.

comment:31 Changed 9 years ago by Stuart Campbell

  • Description modified (diff)

Doesn't give zeros for BASIS anymore. The Q axis still seems to go -ve if you specify q binning of 0.0,0.2,2.0. But this can be a ticket for the next iteration.

comment:32 Changed 9 years ago by Stuart Campbell

  • Status changed from verifying to closed

About the -ve issue - looks like just a plotting issue - the underlying data has the correct limits.

comment:33 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3080

Note: See TracTickets for help on using tickets.