Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
XRD
darfix
Commits
77c4738a
Commit
77c4738a
authored
Aug 05, 2021
by
Julia Garriga Ferrer
Browse files
[gui][grainplot] Add case for one dimension datasets
parent
760f1d7c
Pipeline
#52156
passed with stage
in 3 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/grainPlotWidget.py
View file @
77c4738a
...
...
@@ -92,7 +92,7 @@ class GrainPlotWidget(qt.QMainWindow):
self
.
_levelsWidget
.
setLayout
(
levelsLayout
)
self
.
_mosaicityPlot
=
Plot2D
(
parent
=
self
)
self
.
_exportButton
=
qt
.
QPushButton
(
"Export"
)
self
.
_exportButton
.
clicked
.
connect
(
self
.
_save
Maps
)
self
.
_exportButton
.
clicked
.
connect
(
self
.
export
Maps
)
layout
.
addWidget
(
self
.
_methodCB
)
layout
.
addWidget
(
self
.
_levelsWidget
)
layout
.
addWidget
(
self
.
_plotWidget
)
...
...
@@ -280,12 +280,12 @@ class GrainPlotWidget(qt.QMainWindow):
return
medfilt2d
(
img
)
def
_save
Maps
(
self
):
def
export
Maps
(
self
):
"""
Loads the file from a FileDialog.
"""
if
self
.
dataset
.
dims
.
ndim
>
1
:
if
self
.
dataset
and
self
.
dataset
.
dims
.
ndim
>
1
:
nx
=
{
"entry"
:
{
"data"
:
{
...
...
@@ -306,15 +306,37 @@ class GrainPlotWidget(qt.QMainWindow):
"@default"
:
"entry"
}
for
axis
,
dim
in
self
.
dataset
.
dims
:
nx
[
"entry"
][
"maps"
].
update
(
{
Method
.
COM
.
name
:
self
.
_moments
[
axis
][
0
],
Method
.
FWHM
.
name
:
self
.
_moments
[
axis
][
1
],
Method
.
SKEWNESS
.
name
:
self
.
_moments
[
axis
][
2
],
Method
.
KURTOSIS
.
name
:
self
.
_moments
[
axis
][
3
]
}
)
for
axis
,
dim
in
self
.
dataset
.
dims
:
nx
[
"entry"
][
"maps"
].
update
(
{
Method
.
COM
.
name
:
self
.
_moments
[
axis
][
0
],
Method
.
FWHM
.
name
:
self
.
_moments
[
axis
][
1
],
Method
.
SKEWNESS
.
name
:
self
.
_moments
[
axis
][
2
],
Method
.
KURTOSIS
.
name
:
self
.
_moments
[
axis
][
3
]
}
)
else
:
nx
=
{
"entry"
:
{
"data"
:
{
">"
+
Method
.
COM
.
name
:
"../maps/"
+
Method
.
COM
.
name
,
"@signal"
:
Method
.
COM
.
name
,
"@NX_class"
:
"NXdata"
},
"maps"
:
{
Method
.
COM
.
name
:
self
.
_moments
[
0
][
0
],
Method
.
FWHM
.
name
:
self
.
_moments
[
0
][
1
],
Method
.
SKEWNESS
.
name
:
self
.
_moments
[
0
][
2
],
Method
.
KURTOSIS
.
name
:
self
.
_moments
[
0
][
3
],
"@NX_class"
:
"NXcollection"
},
"@NX_class"
:
"NXentry"
,
"@default"
:
"data"
,
},
"@NX_class"
:
"NXroot"
,
"@default"
:
"entry"
}
fileDialog
=
qt
.
QFileDialog
()
...
...
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