def Find_UB_Latt(rnum, a, b, c, alpha, beta, gamma, Tolerance, Centering, CellType): mantid.FindUBUsingLatticeParameters('WISH000' + str(rnum) + '_find_peaks', a=a, b=b, c=c, alpha=alpha, beta=beta, gamma=gamma) mantid.SelectCellOfType(PeaksWorkspace='WISH000' + str(rnum) + '_find_peaks', Centering=Centering, Apply=True, CellType=CellType) # OptimizeCrystalPlacement(PeaksWorkspace='WISH000'+str(rnum)+'_find_peaks', ModifiedPeaksWorkspace='WISH000' # +str(rnum)+'_find_peaks', AdjustSampleOffsets=True) mantid.OptimizeLatticeForCellType(PeaksWorkspace='WISH000' + str(rnum) + '_find_peaks', Apply=True, CellType=CellType, Tolerance=Tolerance)
SplitThreshold=150) # Find peaks PeaksLattice = mantid.FindPeaksMD(InputWorkspace=LabQ, MaxPeaks=100) # 3d integration to centroid peaks PeaksLattice = mantid.CentroidPeaksMD(InputWorkspace=LabQ, PeakRadius=0.12, PeaksWorkspace=PeaksLattice) # Find the UB matrix using the peaks and known lattice parameters mantid.FindUBUsingLatticeParameters(PeaksWorkspace=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 mantid.IndexPeaks(PeaksWorkspace=PeaksLattice, Tolerance=0.12) # Integrate peaks in Q space using spheres PeaksLattice_Integrated = mantid.IntegratePeaksMD(InputWorkspace=LabQ, PeakRadius=0.12, BackgroundOuterRadius=0.18, BackgroundInnerRadius=0.15, PeaksWorkspace=PeaksLattice)
# Note: Reduced tolerance on FindUBUsingFFT will omit peaks not near the lattice. This seems to help # find the Niggli cell correctly, with all angle 60 degrees, and all sides 3.99 # if use_fft: mantid.FindUBUsingFFT(PeaksWorkspace=peaks_qLab, MinD='3', MaxD='5', Tolerance=0.08) print('\nNiggli cell found from FindUBUsingFFT:') if use_cubic_lat_par: mantid.FindUBUsingLatticeParameters(PeaksWorkspace=peaks_qLab, a=5.6402, b=5.6402, c=5.6402, alpha=90, beta=90, gamma=90, NumInitial=25, Tolerance=0.12) print('\nCubic cell found directly from FindUBUsingLatticeParameters') if use_Niggli_lat_par: mantid.FindUBUsingLatticeParameters(PeaksWorkspace=peaks_qLab, a=3.9882, b=3.9882, c=3.9882, alpha=60, beta=60, gamma=60, NumInitial=25,