mantid
mantid copied to clipboard
New skew integration algorithm for single crystal Bragg peaks
Description of work.
A new integration method that minimises the skew of background points to identify pixels and bins contributing to a peak.
To test:
- Load data and add peaks
Load(Filename=r'C:\mantid\build\ExternalData\Testing\Data\SystemTest\SXD23767.raw', OutputWorkspace='SXD23767')
CreatePeaksWorkspace(InstrumentWorkspace='SXD23767', NumberOfPeaks=0, OutputWorkspace='SingleCrystalPeakTable')
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=3271.0941922690058, DetectorID=32615, Height=48579, BinCount=1748.6544047163125)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=3806.3122671465112, DetectorID=30017, Height=28792, BinCount=2623.6364687743135)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=5009.848706357172, DetectorID=42513, Height=8312, BinCount=683.91325512745721)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2485.820351956645, DetectorID=39170, Height=594, BinCount=47.772653645954279)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2613.5255156927979, DetectorID=40740, Height=755, BinCount=73.380982729251286)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2328.3963413700967, DetectorID=40905, Height=509, BinCount=64.125675193134072)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=1703.2033622296876, DetectorID=28764, Height=1512, BinCount=155.7961158603562)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2449.3905245093624, DetectorID=41068, Height=2742, BinCount=352.01543879310225)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2303.3581784155558, DetectorID=40121, Height=265, BinCount=0.00021976268225073342)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=2038.5978951201726, DetectorID=36910, Height=517, BinCount=71.174071530741671)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=3787.5542525102373, DetectorID=42749, Height=14856, BinCount=1941.4412168797021)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=885.94412995172002, DetectorID=14284, Height=216, BinCount=7.1705279215654789)
AddPeak(PeaksWorkspace='SingleCrystalPeakTable', RunWorkspace='SXD23767', TOF=1817.2221035426605, DetectorID=36104, Height=118, BinCount=11.982004832328599)
- Call integration algorithm
IntegratePeaksSkew(InputWorkspace='SXD23767', PeaksWorkspace='SingleCrystalPeakTable',
OutputWorkspace='out', OutputFile=r"C:\Users\xhg73778\Desktop\out_v9.pdf",
UseNearestPeak=False, UpdatePeakPosition=False, IntegrateIfOnEdge=False,
BackScatteringTOFResolution=0.04, ThetaWidth=0.02, )
Check output file and confirm peaks with masks on edge are not integrated.
- Set
IntegrateIfOnEdge =True
- check peaks with mask on edge are now integrated (unless failing other mask criteria) - Set
UseNEarestPeak = True
- check that peaks with center outside mask are integrated - Set
UpdatePeakPosition=True
- check peak position is moved to pixel with max. intensity. - Play with
NColsMax
andNRowsMax
to exclude peaks above a certain size - Play with
NVacanciesMax
andNPixPerVacancyMin
to exclude peaks with vacancies (non-peak pixels surrounded by peak pixels)
Fixes #33725
Reviewer
Please comment on the following (full description):
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?
- Are the release notes saved in a separate file, using Issue or PR number for file name and in the correct location?
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.