1 | # Basic parameters for Triphylite Crystal |
---|
2 | #Name of the workspaces to create |
---|
3 | ws_name = "TOPAZ_3132" |
---|
4 | filename = ws_name +"_event.nxs" |
---|
5 | ws = LoadEventNexus(Filename=filename,FilterByTofMin=3000, FilterByTofMax=16000) |
---|
6 | |
---|
7 | # ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
---|
8 | # Part 1. Basic Reduction |
---|
9 | |
---|
10 | # Spherical Absorption and Lorentz Corrections |
---|
11 | ws = AnvredCorrection(InputWorkspace=ws, LinearScatteringCoef=0.451, LinearAbsorptionCoef=0.993, Radius=0.14) |
---|
12 | |
---|
13 | # Convert to Q space |
---|
14 | LabQ = ConvertToDiffractionMDWorkspace(InputWorkspace=ws, LorentzCorrection='0', |
---|
15 | OutputDimensions='Q (lab frame)', SplitInto=2, SplitThreshold=150) |
---|
16 | |
---|
17 | # Find peaks |
---|
18 | PeaksLattice = FindPeaksMD(InputWorkspace=LabQ,MaxPeaks=100) |
---|
19 | |
---|
20 | # 3d integration to centroid peaks |
---|
21 | PeaksLattice = CentroidPeaksMD(InputWorkspace=LabQ, |
---|
22 | PeakRadius=0.12, PeaksWorkspace=PeaksLattice) |
---|
23 | |
---|
24 | # Find the UB matrix using the peaks and known lattice parameters |
---|
25 | FindUBUsingLatticeParameters(PeaksWorkspace=PeaksLattice, a=10.3522, b=6.0768, c=4.7276, |
---|
26 | alpha=90, beta=90, gamma=90, NumInitial=20, Tolerance=0.12) |
---|
27 | |
---|
28 | # And index to HKL |
---|
29 | IndexPeaks(PeaksWorkspace=PeaksLattice, Tolerance=0.12) |
---|
30 | |
---|
31 | |
---|
32 | PeaksLattice_Integrated_Clusters, ClusterImages = IntegratePeaksHybrid(InputWorkspace=LabQ, PeaksWorkspace=PeaksLattice, BackgroundOuterRadius=0.4) |
---|
33 | |
---|
34 | svw = plotSlice(ClusterImage) |
---|
35 | sv = svw.getSlicer() |
---|
36 | pp_all = sv.setPeaksWorkspaces([PeaksLattice_Integrated_Clusters,PeaksLattice_Integrated]) |
---|
37 | pp = pp_all.getPeaksPresenter(PeaksLattice_Integrated_Clusters) |
---|