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
01ace5d9
Commit
01ace5d9
authored
Apr 10, 2019
by
Whitfield, Ross
Browse files
Update .#calculate_HKL_range.py calculate_HKL_range.py
parent
79f0b6fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
.#calculate_HKL_range.py
deleted
120000 → 0
View file @
79f0b6fb
rwp
@
diffuse
.
17553
:
1554727402
\ No newline at end of file
calculate_HKL_range.py
View file @
01ace5d9
...
...
@@ -2,13 +2,38 @@ Uproj = [1, 0, 0]
Vproj
=
[
0
,
1
,
0
]
Wproj
=
[
0
,
0
,
1
]
wavelenght
=
1.488
ws
=
mtd
[
'ws'
]
ws
=
mtd
[
'data'
]
wavelength
=
1.488
################################################################################
import
numpy
as
np
s1
=
np
.
deg2rad
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
's1'
).
value
)
polar
=
np
.
deg2rad
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'twotheta'
).
value
)
azim
=
np
.
deg2rad
(
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
)
UB
=
ws
.
getExperimentInfo
(
0
).
sample
().
getOrientedLattice
().
getUB
()
k
=
1
/
wavelength
qlab
=
np
.
vstack
((
np
.
sin
(
polar
)
*
np
.
cos
(
azim
),
np
.
sin
(
polar
)
*
np
.
sin
(
azim
),
np
.
cos
(
polar
)
-
1
)).
T
*
-
k
W
=
np
.
eye
(
3
)
W
[:,
0
]
=
Uproj
W
[:,
1
]
=
Vproj
W
[:,
2
]
=
Wproj
UBW
=
np
.
dot
(
UB
,
W
)
Umin
=
for
rot
in
s1
:
R
=
np
.
array
([[
np
.
cos
(
rot
),
0
,
np
.
sin
(
rot
)],
[
0
,
1
,
0
],
[
-
np
.
sin
(
rot
),
0
,
np
.
cos
(
rot
)]])
RUBW
=
np
.
dot
(
R
,
UBW
)
HKL
=
np
.
dot
(
np
.
linalg
.
inv
(
RUBW
),
qlab
.
T
)
s1
=
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
's1'
).
value
twotheta
=
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'twotheta'
).
value
azimuthal
=
ws
.
getExperimentInfo
(
0
).
run
().
getProperty
(
'azimuthal'
).
value
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