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
cf86a6e1
Commit
cf86a6e1
authored
Apr 11, 2019
by
Whitfield, Ross
Browse files
Update calculate_HKL_range.py
parent
8ec4f45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
calculate_HKL_range.py
View file @
cf86a6e1
...
...
@@ -12,8 +12,10 @@ 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
)[::
64
]
azim
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
)[::
64
]
polar
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'twotheta'
).
value
)
polar
=
np
.
hstack
((
polar
[::
64
],
polar
[
63
::
64
]))
azim
=
np
.
array
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
)
azim
=
np
.
hstack
((
azim
[::
64
],
azim
[
63
::
64
]))
UB
=
ws
.
getExperimentInfo
(
0
).
sample
().
getOrientedLattice
().
getUB
()
k
=
1
/
wavelength
...
...
@@ -32,8 +34,6 @@ 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
],
...
...
@@ -43,7 +43,6 @@ 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