mantid
mantid copied to clipboard
Improve shoebox position determination in `IntegratePeaksShoeboxTOF`
Description of work
Improve shoebox position determination in IntegratePeaksShoeboxTOF
by doing the following:
- Stop smoothing the I/sigma from the shoebox convolution - this was over smoothing as the shoebox is effectively also doing some smoothing.
- Use
label
to find contiguous regions of statistically significant I/sigma and find regions closer to predicted peak position than any other position - Get a better initial shoebox dimensions by allowing float NFHWM
Purpose of work
In reducing SXD data for Nick Funnell it was found that the shoebox would often find a region of I/sigma far away from weak peak positions - this was because it previously centred the shoebox on the maximum I/sigma, but if there was a nearby peak which wasn't in the peak table the shoebox could go to the wrong peak position. This should be fixed by (2)
There is no associated issue.
To test:
(1) Run this script change OuptutFile
ws = Load(Filename=r'SXD23767.raw', OutputWorkspace='SXD23767')
peaks = FindSXPeaksConvolve(InputWorkspace=ws, PeakFindingStrategy="IOverSigma", NCols=7, NRows=7, NFWHM=6, ThresholdIoverSigma=5)
kwargs = {"InputWorkspace": ws, "PeaksWorkspace": peaks, "OutputWorkspace": 'peaks_int',
"NRows": 7, "NCols": 7, "GetNBinsFromBackToBackParams": True, "NFWHM": 3, "NShoeboxInWindow": 3,
"WeakPeakThreshold": 0, "IntegrateIfOnEdge": True, "LorentzCorrection": False,
"OutputFile": '//olympic/Babylon5/Public/RWaite/test_shoebox.pdf'}
IntegratePeaksShoeboxTOF(**kwargs)
(2) Check the pdf - the box should be centered on the peak in the data nearest the red x
This does not require release notes because fill in an explanation of why If you add release notes please save them as a separate file using the Issue or PR number as the file name. Check the file is located in the correct directory for your note(s). -->
Reviewer
Please comment on the points listed below (full description). Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
- Is the code of an acceptable quality?
- Does the code conform to the coding standards?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the GUI standards?
- If there are changes in the release notes then do they describe the changes appropriately?
- Do the release notes conform to the release notes guide?
Functional Tests
- Do changes function as described? Add comments below that describe the tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been added/updated?
Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers
will take care of it.
Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.