Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Whitfield, Ross
wand
Commits
8ec4f45b
Commit
8ec4f45b
authored
Apr 10, 2019
by
Whitfield, Ross
Browse files
Update calculate_HKL_range.py
parent
7b2befad
Changes
1
Hide whitespace changes
Inline
Side-by-side
calculate_HKL_range.py
View file @
8ec4f45b
w
s
=
mtd
[
'data'
]
w
orkspace_name
=
'data'
Uproj
=
[
1
,
0
,
0
]
Vproj
=
[
0
,
1
,
0
]
...
...
@@ -10,9 +10,10 @@ wavelength = 1.488
import
numpy
as
np
ws
=
mtd
[
workspace_name
]
s1
=
np
.
deg2rad
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
's1'
).
value
)
polar
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'twotheta'
).
value
)
azim
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
)
polar
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'twotheta'
).
value
)
[::
64
]
azim
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
)
[::
64
]
UB
=
ws
.
getExperimentInfo
(
0
).
sample
().
getOrientedLattice
().
getUB
()
k
=
1
/
wavelength
...
...
@@ -31,6 +32,8 @@ UBW = np.dot(UB, W)
HKL_min
=
np
.
array
([
1e9
,
1e9
,
1e9
])
HKL_max
=
np
.
array
([
-
1e9
,
-
1e9
,
-
1e9
])
t1
=
time
.
time
()
for
rot
in
s1
:
R
=
np
.
array
([[
np
.
cos
(
rot
),
0
,
np
.
sin
(
rot
)],
[
0
,
1
,
0
],
...
...
@@ -40,6 +43,7 @@ for rot in s1:
HKL_min
=
np
.
minimum
(
HKL_min
,
HKL
.
min
(
axis
=
1
))
HKL_max
=
np
.
maximum
(
HKL_max
,
HKL
.
max
(
axis
=
1
))
t2
=
time
.
time
()
fmt
=
'{:>12} min: {: .4f} max: {: .4f}'
print
(
fmt
.
format
(
str
(
Uproj
),
HKL_min
[
0
],
HKL_max
[
0
]))
print
(
fmt
.
format
(
str
(
Vproj
),
HKL_min
[
1
],
HKL_max
[
1
]))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment