Ticket #3122 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

CentroidPeaksMD: Algorithm to center peaks in reciprocal space

Reported by: Janik Zikovsky Owned by: Janik Zikovsky
Priority: critical Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By: #3119
Blocking: Tester: Stuart Campbell

Description


Change History

comment:1 Changed 9 years ago by Janik Zikovsky

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Janik Zikovsky

(In [12218]) Refs #3122: Methods for finding the centroid of a sphere. Algorithm started.

comment:3 Changed 9 years ago by Janik Zikovsky

(In [12225]) Refs #3122: Algorithm to centroid peaks. Fixed FakeMDEventData giving non-uniform peaks.

comment:4 Changed 9 years ago by Janik Zikovsky

(In [12243]) Refs #3102: test for GetEulerAngle(), fixes to universalGoniometers. Also refs #3122: Cxxtest got confused by a commented-out performance test.

comment:5 Changed 9 years ago by Janik Zikovsky

(In [12275]) Refs #3122: Centroid peaks in reciprocal space in either Q or HKL.

comment:6 Changed 9 years ago by Janik Zikovsky

Join together the integrateSphere method and centroidSphere() so that one method does both.

comment:7 Changed 9 years ago by Janik Zikovsky

  • Milestone changed from Iteration 29 to Iteration 30

Moved my tickets that won't get finished by iteration 29

comment:8 Changed 9 years ago by Janik Zikovsky

In [13696]:

Refs #3122: Added compiler directive to avoid caching centroids for all boxes - should save some memory at the cost of slower centroiding/peak finding.

comment:9 Changed 9 years ago by Janik Zikovsky

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

This method looks pretty reasonably well working. Some tweaking might be done with real data (e.g. an iterative routine of UB matrix finding, centroiding, etc.) , but will leave it alone for now.

comment:10 Changed 9 years ago by Janik Zikovsky

Algorithm renamed to CentroidPeaksMD.

comment:11 Changed 9 years ago by Janik Zikovsky

  • Summary changed from MDCentroidPeaks: Algorithm to center peaks in reciprocal space to CentroidPeaksMD: Algorithm to center peaks in reciprocal space

comment:12 Changed 9 years ago by Peter Parker

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

comment:13 Changed 9 years ago by Peter Parker

  • Status changed from verifying to verify
  • Tester Peter Parker deleted

Unsure as how to proceed with testing. Have used CreateMDWorkspace, FakeMDEventData and CreatePeakWorkspace via the UI to create necessary objects to feed into CentroidPeaksMD, but unsure of exactly what I'm looking for.

Perhaps this is best left for someone less new to the project.

comment:14 Changed 9 years ago by Stuart Campbell

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

comment:15 Changed 9 years ago by Stuart Campbell

Janik, how do you test this ?

comment:16 Changed 9 years ago by Janik Zikovsky

Here is a sample script using real data:

# Basic parameters
filename = "TOPAZ_3131_event.nxs"
#Name of the workspaces to create
ws = "TOPAZ_3131"

# Load the original data
LoadEventNexus(Filename=filename,OutputWorkspace=ws)

# Convert to reciprocal space, in the sample frame
ConvertToDiffractionMDWorkspace(InputWorkspace=ws,OutputWorkspace=ws+'_MD',
		OutputDimensions='Q (sample frame)',LorentzCorrection='1')
		
# Find peaks
FindPeaksMD(InputWorkspace=ws+'_MD',MaxPeaks='50',OutputWorkspace=ws+'_peaks')

# Find the UB matrix using the peaks and known lattice parameters
FindUBUsingLatticeParameters(PeaksWorkspace=ws+'_peaks',a='10.3522',b='6.0768',c='4.7276',
		alpha='90',beta='90',gamma='90', NumInitial='20', Tolerance='0.12')
# And index to HKL		
IndexPeaks(PeaksWorkspace=ws+'_peaks', Tolerance='0.12')
		
# Centroid the peaks
CentroidPeaksMD(InputWorkspace=ws+'_MD',CoordinatesToUse='Q (sample frame)',
		PeakRadius='0.05',PeaksWorkspace=ws+'_peaks',OutputWorkspace=ws+'_peaks_centered')
		

Alternatively, you can use FakeMDEventData to create fake peaks in an empty workspace and try to get their centroid. You'll need to create a peaks workspace to start at, I'm not sure how much of Peak creation is exposed to Python though... Also, the easiest way to do it that way is to do it in HKL space (otherwise the Peaks need to have a physical meaning in Q and they are harder to fake :) )

comment:17 Changed 9 years ago by Janik Zikovsky

Maybe use LoadIsawPeaks to make the initial peaksWS?

comment:18 Changed 9 years ago by Stuart Campbell

  • Status changed from verifying to closed

comment:19 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3969

Note: See TracTickets for help on using tickets.