Ticket #7001 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Improve peak fitting capability of FindPeaks

Reported by: Wenduo Zhou Owned by: Wenduo Zhou
Priority: major Milestone: Release 2.6
Component: Diffraction Keywords:
Cc: petersonpf@… Blocked By:
Blocking: Tester: Peter Peterson

Description (last modified by Wenduo Zhou) (diff)

Algorithm CalibrateRectangularDetectors requires a better algorithm to find and fit peaks, especially for POWGEN's K4 detector. Thus algorithm in FindPeaks should be improved to minimize the number of spectra that have peaks fit to wrong positions, which reduces the resolution of summed peaks.

Attachments

s1A.py (508 bytes) - added by Wenduo Zhou 7 years ago.
s2A.py (2.6 KB) - added by Wenduo Zhou 7 years ago.

Change History

comment:1 Changed 7 years ago by Wenduo Zhou

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Wenduo Zhou

Clean the codes. Refs #7001.

Changeset: aff4398c26e1a23aeffb59635fdcc27fd57f8b09

comment:3 Changed 7 years ago by Wenduo Zhou

Add some debug output workspace. Refs #7001.

Changeset: 56ea3a493ec39757020740cac415ef351bcdf7ee

comment:4 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7001.

Changeset: bf8227076d043d74e8603b16f3d6a5c0a7e2c3d1

comment:5 Changed 7 years ago by Wenduo Zhou

Checkpointing work. Refs #7001.

Changeset: 3ab5e45cc2c9fb1a342cf3102352cf5921c53f2c

comment:6 Changed 7 years ago by Wenduo Zhou

Make some change with FindPeaks. Refs #7001.

Changeset: fe43cec0ae3c1c4f5292a0ac96948dc11f3c5b51

comment:7 Changed 7 years ago by Wenduo Zhou

Improve fitting. Refs #7001.

Changeset: a9d4cf97ad218cc8bd5f27d50469cbfe7037b836

comment:8 Changed 7 years ago by Wenduo Zhou

Improve FindPeaks. Refs #7001.

Changeset: 227f891073c34a00839e26628babe6a4f3cb3a6e

comment:9 Changed 7 years ago by Wenduo Zhou

Corrected a major error. Refs #7001.

The algorithm to handle FitWindows were based on a wrong definition. The code is corrected such that FitWindows specify the range data to fit a peak.

Changeset: 555124239092b94ec8e1920290938af3e3414704

comment:10 Changed 7 years ago by Wenduo Zhou

Fixed a bug. Refs #7001.

Changeset: 92960c50123765ebf47e286e297afecc2a1fd459

comment:11 Changed 7 years ago by Wenduo Zhou

Improved consistency between 2 algorithms. Refs #7001.

Changeset: 86e6cd7080352daeb4b6752553051fa1129f0f9e

comment:12 Changed 7 years ago by Wenduo Zhou

  • Description modified (diff)

comment:13 Changed 7 years ago by Wenduo Zhou

  • Description modified (diff)

comment:14 Changed 7 years ago by Wenduo Zhou

Ignore super wide peaks. Refs #7001.

Changeset: 2104bf18723c6e1c43035f42298c99b0c5daa9d3

comment:15 Changed 7 years ago by Wenduo Zhou

Added specific support for flat background. Refs #7001.

Changeset: c757b369f7d9199e1bcca3eca5d99101c3d46828

comment:16 Changed 7 years ago by Wenduo Zhou

Add property minimum peak height. Refs #7001.

Changeset: fad64869fa15019ffd3466d825eb4d4bf39006f3

comment:17 Changed 7 years ago by Wenduo Zhou

New golden files due to change of FindPeaks. Refs #7001.

Changeset: 5f940db7494c090f036950e6bca6801e1b819118

comment:18 Changed 7 years ago by Wenduo Zhou

Tried to resolve a potential conflict in header. Refs #7001.

Changeset: 5f4eeed66a004123014e6b93ea00a8d9fc2308ee

comment:19 Changed 7 years ago by Wenduo Zhou

Cleared all the debugging codes. Refs #7001.

Changeset: 64566bf37b8a67c8945bbdd5931aba7cb29a6f4e

comment:20 Changed 7 years ago by Wenduo Zhou

Tried to resolve conflict. Refs #7001.

Changeset: 9bfce63f03c600a145db2889e1bd8345c3152f31

comment:21 Changed 7 years ago by Wenduo Zhou

Removed some debugging codes. Refs #7001.

Changeset: c761afc1bef90c9a646ef05dfd8bad30afea0b1a

comment:22 Changed 7 years ago by Wenduo Zhou

Changed unit test value. Refs #7001.

Changed unit test value as new FindPeaks gives out better result.

Changeset: e8e871acb2aeca8f0b1f10829727b48496d2c88f

comment:23 Changed 7 years ago by Wenduo Zhou

Removed optional output property 'OutputWorkspace'. Refs #7001.

Changeset: c4631a05a11df2059c1a8e521fc051cf9f023011

comment:24 Changed 7 years ago by Wenduo Zhou

Fixed unit test for FindPeaks. Refs #7001.

Changeset: c4add447b74001e53a25100384f1b0d80896c3f9

comment:25 Changed 7 years ago by Wenduo Zhou

Cleaned the doxygen. Refs #7001.

Changeset: 5f08e837bc4e782268dd7b0c6614f149ab3ebe59

comment:26 Changed 7 years ago by Wenduo Zhou

Removed some debug output. Refs #7001.

Changeset: e304c143a0c53656d035c8542ad6e7693dec1a3b

comment:27 Changed 7 years ago by Wenduo Zhou

  • Description modified (diff)

comment:28 Changed 7 years ago by Wenduo Zhou

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

Instruction for Verification

The work to solve the issue reported by this ticket turned out to be so complicated that it affects more than one algorithm in Mantid. The reasons include the incapable algorithm and exiting defects that were not found before. Here are the algorithms that have been improved

  • FindPeaks
  • GeneratePeaks
  • CalibrateRectangularDetectors

Suggestion: As the goal of this ticket is to improve performance of FindPeaks, thus the best way to verify the ticket is to compare some results obtained by the original FindPeaks() and modified FindPeaks() commit in this ticket. Please read carefully the instruction for both scripts introduced below before merging the commits of this code to master.

Script 1 to verify the ticket

This script is to show that the new FindPeaks() improves the rectangular calibration.

  1. Download script s1A.py
  2. Locate data from systemtests/Data/PG3_2538_event.nxs
  3. Compile Mantid in master without merging the change from this ticket;
  4. Run s1A.py and save workspace PG3_2538_calibrated to a Nexus file;
  5. Merge the commits under this ticket to master and build Mantid
  6. Run s1A.py again
  7. Load previously saved Nexus file and compare to PG3_2538_calibrated in color fill plot. You can see the improvement.

Script 2 to verify the ticket

This script is to show that by the enhanced FindPeaks(), the fitting of Vanadium peaks is improved.

  1. Locate the data from system test
    • PG3_4866_event.nxs
    • PG3_FERNS_d4832_2011_08_24.cal
  2. Before merging the code, build Mantid and run the attached script s2A.py;
  3. Save the output table workspace "FoundPeakTable" to a Nexus file;
  4. Merge the commit of this ticket and build Mantid.
  5. Run script s2A.py again.
  6. Load the previously saved table workspace nexus file;
  7. Run GeneratePeaks() on both table workspaces for comparison;
  8. Compare the Vanadium peaks generated from the output of original and new FindPeaks. The new vanadium peaks generated by new FindPeaks are more realistic, while some of the peaks found and fit by the old FindPeaks were fit to noise. If you plot the peaks' centre against the their width (sigma), you can see the curve from the new FindPeaks() is more smooth.

Changed 7 years ago by Wenduo Zhou

Changed 7 years ago by Wenduo Zhou

comment:29 Changed 7 years ago by Alex Buts

  • Status changed from verify to verifying
  • Tester set to Alex Buts

comment:30 Changed 7 years ago by Alex Buts

  • Status changed from verifying to verify
  • Tester Alex Buts deleted

I was able to build the ticket and first part of the test looks fine but there are no files needed to test second script available on GIT. And apparently transferring them from SNS is too much pain.

Another one for "SNS only" testing.

comment:31 Changed 7 years ago by Peter Peterson

  • Status changed from verify to verifying
  • Tester set to Peter Peterson

comment:32 Changed 7 years ago by Peter Peterson

Merge remote branch 'origin/feature/7001_fit_peak'

Re #7001. Conflicts:

Code/Mantid/Framework/Algorithms/src/GeneratePeaks.cpp Code/Mantid/Framework/Algorithms/test/FindPeaksTest.h

Changeset: b91368d53955ea969e6949ab0f331fc6861be1c2

comment:33 Changed 7 years ago by Peter Peterson

  • Status changed from verifying to closed

comment:34 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:35 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Diffraction

comment:36 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7847

Note: See TracTickets for help on using tickets.