Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
cf49b212
Commit
cf49b212
authored
Jun 01, 2021
by
Julia Garriga Ferrer
Committed by
Julia Garriga Ferrer
Jun 08, 2021
Browse files
[gui][rsm] Fix rsm angle transformations
parent
eabfd65d
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/rsmWidget.py
View file @
cf49b212
...
...
@@ -26,7 +26,7 @@
__authors__
=
[
"J. Garriga"
]
__license__
=
"MIT"
__date__
=
"
3
1/0
5
/2021"
__date__
=
"
0
1/0
6
/2021"
import
numpy
...
...
@@ -80,17 +80,19 @@ class RSMWidget(qt.QMainWindow):
if
self
.
_thread
.
data
is
not
None
:
self
.
_moments
=
self
.
_thread
.
data
ffz
=
self
.
dataset
.
get_metadata_values
(
POSITIONER_METADATA
,
"ffz"
)
mainx
=
self
.
dataset
.
get_metadata_values
(
POSITIONER_METADATA
,
"mainx"
)
mainx
=
-
self
.
dataset
.
get_metadata_values
(
POSITIONER_METADATA
,
"mainx"
)
d
=
0.051
s
,
h
,
w
=
self
.
dataset
.
get_data
().
shape
X
=
numpy
.
arange
(
-
int
(
h
/
2
),
int
(
h
/
2
),
dtype
=
numpy
.
float64
)
*
d
Y
=
numpy
.
arange
(
-
(
w
/
2
),
w
/
2
,
dtype
=
numpy
.
float64
)
*
d
teta
=
numpy
.
arctan2
(
ffz
+
X
,
mainx
)
az
=
numpy
.
arctan2
(
Y
,
mainx
)
xscale
=
(
teta
[
-
1
]
-
teta
[
0
])
/
h
yscale
=
(
az
[
-
1
]
-
az
[
0
])
/
w
teta_min
=
(
180
/
numpy
.
pi
)
*
numpy
.
arctan2
(
ffz
-
d
*
h
/
2
,
mainx
)
teta_max
=
(
180
/
numpy
.
pi
)
*
numpy
.
arctan2
(
ffz
+
d
*
h
/
2
,
mainx
)
az_min
=
-
(
180
/
numpy
.
pi
)
*
numpy
.
arctan2
(
d
*
w
/
2
,
numpy
.
sqrt
(
ffz
*
ffz
+
mainx
*
mainx
))
az_max
=
(
180
/
numpy
.
pi
)
*
numpy
.
arctan2
(
d
*
w
/
2
,
numpy
.
sqrt
(
ffz
*
ffz
+
mainx
*
mainx
))
xscale
=
(
teta_max
-
teta_min
)
/
h
yscale
=
(
az_max
-
az_min
)
/
w
self
.
_plotWidget
.
addImage
(
self
.
_moments
[
0
][
0
],
ylabel
=
"2 theta"
,
xlabel
=
"Azimuth"
,
origin
=
(
az
[
0
]
,
teta
[
0
]
),
scale
=
(
yscale
,
xscale
))
origin
=
(
az
_min
,
teta
_min
),
scale
=
(
yscale
,
xscale
))
else
:
print
(
"
\n
Computation aborted"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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