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
c29af11d
Commit
c29af11d
authored
Feb 12, 2020
by
Julia Garriga Ferrer
Browse files
[io] Changes name of functions to read and write components into Nexus file
parent
6cd97d67
Pipeline
#21168
passed with stage
in 1 minute and 58 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
darfix/gui/displayComponentsWidget.py
View file @
c29af11d
...
...
@@ -37,7 +37,7 @@ from silx.gui.plot import ScatterView, StackView, Plot1D
from
silx.gui.widgets.FrameBrowser
import
HorizontalSliderWithBrowser
import
darfix
from
darfix.io.utils
import
write_
proces
s
from
darfix.io.utils
import
write_
component
s
class
DisplayComponentsWidget
(
qt
.
QMainWindow
):
...
...
@@ -172,8 +172,8 @@ class DisplayComponentsWidget(qt.QMainWindow):
fileDialog
.
setOption
(
fileDialog
.
DontUseNativeDialog
)
fileDialog
.
setDefaultSuffix
(
".h5"
)
if
fileDialog
.
exec_
():
write_
proces
s
(
fileDialog
.
selectedFiles
()[
0
],
'entry'
,
self
.
dimensions
,
self
.
W
,
self
.
components
,
1
)
write_
component
s
(
fileDialog
.
selectedFiles
()[
0
],
'entry'
,
self
.
dimensions
,
self
.
W
,
self
.
components
,
1
)
def
_activeCurveChanged
(
self
,
prev_legend
=
None
,
legend
=
None
):
if
legend
:
...
...
darfix/gui/linkComponentsWidget.py
View file @
c29af11d
...
...
@@ -38,7 +38,7 @@ from silx.gui.plot import StackView
import
darfix
from
darfix.core.componentsMatching
import
ComponentsMatching
,
Method
from
darfix.gui.datasetSelectionWidget
import
FilenameSelectionWidget
from
darfix.io.utils
import
read_
proces
s
from
darfix.io.utils
import
read_
component
s
import
logging
_logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -127,7 +127,7 @@ class LinkComponentsWidget(qt.QWidget):
msg
.
exec_
()
return
dimensions
,
components
,
W
=
read_
proces
s
(
filename
)
dimensions
,
components
,
W
=
read_
component
s
(
filename
)
self
.
_linked_sv
.
hide
()
self
.
_sv1
.
setStack
(
components
)
...
...
@@ -148,7 +148,7 @@ class LinkComponentsWidget(qt.QWidget):
if
filename
==
''
:
return
dimensions
,
components
,
W
=
read_
proces
s
(
filename
)
dimensions
,
components
,
W
=
read_
component
s
(
filename
)
self
.
_linked_sv
.
hide
()
self
.
_sv2
.
setStack
(
components
)
...
...
darfix/io/utils.py
View file @
c29af11d
...
...
@@ -72,7 +72,7 @@ def advancement_display(iteration, total, prefix='', suffix='', decimals=1, leng
print
()
def
read_
proces
s
(
h5_file
):
def
read_
component
s
(
h5_file
):
with
h5py
.
File
(
h5_file
,
"r"
)
as
nx
:
# find the default NXentry group
nx_entry
=
nx
[
nx
.
attrs
[
"default"
]]
...
...
@@ -89,8 +89,8 @@ def read_process(h5_file):
return
dimensions
,
components
,
W
def
write_
proces
s
(
h5_file
,
entry
,
dimensions
,
W
,
data
,
processing_order
,
data_path
=
'/'
,
overwrite
=
True
):
def
write_
component
s
(
h5_file
,
entry
,
dimensions
,
W
,
data
,
processing_order
,
data_path
=
'/'
,
overwrite
=
True
):
"""
Write a stack of components and its parameters into .h5
...
...
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