Skip to content

Commit

Permalink
Refs #4472: diffraction demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Mar 6, 2012
1 parent 2d8e90c commit 1b5e289
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Code/Mantid/scripts/Vates/Diffraction_Workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,29 @@
SplitInto='2',SplitThreshold='150')
# Find peaks
FindPeaksMD(InputWorkspace=ws+'_MD2',MaxPeaks='100',OutputWorkspace=ws+'_peaksLattice')
# 3d integration to centroid peaks
CentroidPeaksMD(InputWorkspace=ws+'_MD2',CoordinatesToUse='Q (sample frame)',PeakRadius='0.12',PeaksWorkspace=ws+'_peaksLattice',OutputWorkspace=ws+'_peaksLattice')
# Find the UB matrix using the peaks and known lattice parameters
FindUBUsingLatticeParameters(PeaksWorkspace=ws+'_peaksLattice',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+'_peaksLattice', Tolerance='0.12')
# 3d integration to centroid peaks
CentroidPeaksMD(InputWorkspace=ws+'_MD2',CoordinatesToUse='Q (sample frame)',PeakRadius='0.01',PeaksWorkspace=ws+'_peaksLattice',OutputWorkspace=ws+'_peaksLattice')
# Integrate peaks in Q space using spheres
IntegratePeaksMD(InputWorkspace=ws+'_MD2',PeakRadius='0.12',BackgroundRadius='0.18',BackgroundStartRadius='0.15',PeaksWorkspace=ws+'_peaksLattice',OutputWorkspace=ws+'_peaksLattice')
# Save for SHELX
SaveHKL(InputWorkspace=ws+'_peaksLattice', Filename=ws+'.hkl')

# Find peaks again for FFT
FindPeaksMD(InputWorkspace=ws+'_MD2',MaxPeaks='100',OutputWorkspace=ws+'_peaksFFT')
# 3d integration to centroid peaks
CentroidPeaksMD(InputWorkspace=ws+'_MD2',CoordinatesToUse='Q (sample frame)',PeakRadius='0.12',PeaksWorkspace=ws+'_peaksFFT',OutputWorkspace=ws+'_peaksFFT')
# Find the UB matrix using FFT
FindUBUsingFFT(PeaksWorkspace=ws+'_peaksFFT',MinD=3.,MaxD=14.)

## TODO conventional cell

# And index to HKL
IndexPeaks(PeaksWorkspace=ws+'_peaksFFT', Tolerance='0.12')
# 3d integration to centroid peaks
CentroidPeaksMD(InputWorkspace=ws+'_MD2',CoordinatesToUse='Q (sample frame)',PeakRadius='0.01',PeaksWorkspace=ws+'_peaksFFT',OutputWorkspace=ws+'_peaksFFT')
# Integrate peaks in Q space using spheres
IntegratePeaksMD(InputWorkspace=ws+'_MD2',PeakRadius='0.12',BackgroundRadius='0.18',BackgroundStartRadius='0.15',PeaksWorkspace=ws+'_peaksFFT',OutputWorkspace=ws+'_peaksFFT')
# Save for SHELX
Expand All @@ -45,9 +48,11 @@
ConvertToDiffractionMDWorkspace(InputWorkspace=ws,OutputWorkspace=ws+'_HKL',
OutputDimensions='HKL',LorentzCorrection='0', SplitInto='2',SplitThreshold='150')
# Bin to a regular grid
BinMD(InputWorkspace=ws+'_HKL',AlignedDim0='H, -20, 0, 200',AlignedDim1='K, -10, 10, 200',AlignedDim2='L, -20, 0, 200',OutputWorkspace=ws+'_binned')
BinMD(InputWorkspace=ws+'_HKL',AlignedDim0='H, -20, 0, 800',AlignedDim1='K, -7, 3, 100',
AlignedDim2='L, -10, 0, 800',OutputWorkspace=ws+'_binned')
# Show in slice Viewer
sv = plotSlice(ws+'_binned', xydim=('H','L'), slicepoint=[0, -2, 0], colorscalelog=True)
sv.setColorMapBackground(0,0,0)
# Save that for later viewing in paraview
#SaveMD(InputWorkspace=ws+'_HKL', Filename=ws+'_MD_HKL.nxs')

Expand Down

0 comments on commit 1b5e289

Please sign in to comment.