14
14
import numpy
15
15
from mantid .simpleapi import *
16
16
from mantid .dataobjects import PeaksWorkspace , LeanElasticPeaksWorkspace
17
+ from mantid .geometry import UnitCell
17
18
18
19
19
20
class TOPAZPeakFinding (systemtesting .MantidSystemTest ):
@@ -22,6 +23,8 @@ def requiredMemoryMB(self):
22
23
return 2000
23
24
24
25
def runTest (self ):
26
+ unitcell_exp = UnitCell (4.714 , 6.06 , 10.40 ) # orthorhombic
27
+
25
28
# Load then convert to Q in the lab frame
26
29
LoadEventNexus (Filename = r"TOPAZ_3132_event.nxs" , OutputWorkspace = "topaz_3132" )
27
30
ConvertToDiffractionMDWorkspace (
@@ -113,12 +116,12 @@ def runTest(self):
113
116
w = mtd ["topaz_3132" ]
114
117
s = w .sample ()
115
118
ol = s .getOrientedLattice ()
116
- self .assertDelta (ol .a (), 4.714 , 0.01 , "Correct lattice a value not found." )
117
- self .assertDelta (ol .b (), 6.06 , 0.01 , "Correct lattice b value not found." )
118
- self .assertDelta (ol .c (), 10.42 , 0.01 , "Correct lattice c value not found." )
119
- self .assertDelta (ol .alpha (), 90 , 0.4 , "Correct lattice angle alpha value not found." )
120
- self .assertDelta (ol .beta (), 90 , 0.4 , "Correct lattice angle beta value not found." )
121
- self .assertDelta (ol .gamma (), 90 , 0.4 , "Correct lattice angle gamma value not found." )
119
+ self .assertDelta (ol .a (), unitcell_exp . a () , 0.01 , "Correct lattice a value not found." )
120
+ self .assertDelta (ol .b (), unitcell_exp . b () , 0.01 , "Correct lattice b value not found." )
121
+ self .assertDelta (ol .c (), unitcell_exp . c () , 0.01 , "Correct lattice c value not found." )
122
+ self .assertDelta (ol .alpha (), unitcell_exp . alpha () , 0.4 , "Correct lattice angle alpha value not found." )
123
+ self .assertDelta (ol .beta (), unitcell_exp . beta () , 0.4 , "Correct lattice angle beta value not found." )
124
+ self .assertDelta (ol .gamma (), unitcell_exp . gamma () , 0.4 , "Correct lattice angle gamma value not found." )
122
125
123
126
# Compare new and old UBs
124
127
newUB = numpy .array (mtd ["topaz_3132" ].sample ().getOrientedLattice ().getUB ())
@@ -155,12 +158,12 @@ def runTest(self):
155
158
w = mtd ["topaz_3132" ]
156
159
s = w .sample ()
157
160
ol = s .getOrientedLattice ()
158
- self .assertDelta (ol .a (), 4.714 , 0.01 , "Correct lattice a value not found." )
159
- self .assertDelta (ol .b (), 6.06 , 0.01 , "Correct lattice b value not found." )
160
- self .assertDelta (ol .c (), 10.42 , 0.01 , "Correct lattice c value not found." )
161
- self .assertDelta (ol .alpha (), 90 , 0.4 , "Correct lattice angle alpha value not found." )
162
- self .assertDelta (ol .beta (), 90 , 0.4 , "Correct lattice angle beta value not found." )
163
- self .assertDelta (ol .gamma (), 90 , 0.4 , "Correct lattice angle gamma value not found." )
161
+ self .assertDelta (ol .a (), unitcell_exp . a () , 0.01 , "Correct lattice a value not found." )
162
+ self .assertDelta (ol .b (), unitcell_exp . b () , 0.01 , "Correct lattice b value not found." )
163
+ self .assertDelta (ol .c (), unitcell_exp . c () , 0.01 , "Correct lattice c value not found." )
164
+ self .assertDelta (ol .alpha (), unitcell_exp . alpha () , 0.4 , "Correct lattice angle alpha value not found." )
165
+ self .assertDelta (ol .beta (), unitcell_exp . beta () , 0.4 , "Correct lattice angle beta value not found." )
166
+ self .assertDelta (ol .gamma (), unitcell_exp . gamma () , 0.4 , "Correct lattice angle gamma value not found." )
164
167
165
168
# Compare new and old UBs
166
169
newUB = numpy .array (mtd ["topaz_3132" ].sample ().getOrientedLattice ().getUB ())
0 commit comments