Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
kmap
xsocs
Commits
27b69f4a
Commit
27b69f4a
authored
Mar 13, 2018
by
Thomas Vincent
Browse files
Update spec parsing/merge to work with silx 0.7.0
parent
d7d69d34
Changes
2
Hide whitespace changes
Inline
Side-by-side
xsocs/process/merge/KmapMerger.py
View file @
27b69f4a
...
...
@@ -384,7 +384,7 @@ class KmapMerger(object):
except
KeyError
:
raise
ValueError
(
'Scan ID {0} not found.'
)
command
=
scan
[
'title'
][()]
.
decode
()
command
=
scan
[
'title'
][()]
try
:
return
parse_scan_command
(
command
)
...
...
@@ -617,8 +617,7 @@ class KmapMerger(object):
def
parse_scan_command
(
command
):
_COMMAND_LINE_PATTERN
=
(
'^(?P<id>[0-9]*) '
'(?P<command>[^ ]*) '
_COMMAND_LINE_PATTERN
=
(
'^(?P<command>[^ ]*) '
'(?P<motor_0>[^ ]*) '
'(?P<motor_0_start>[^ ]*) '
'(?P<motor_0_end>[^ ]*) '
...
...
@@ -686,7 +685,7 @@ def _add_edf_data(scan_id,
entry_h5f
.
copy_group
(
spec_h5_fn
,
scan_id
,
entry
)
with
h5py
.
File
(
spec_h5_fn
)
as
spec_h5
:
command
=
spec_h5
[
scan_id
][
'title'
][()]
.
decode
()
command
=
spec_h5
[
scan_id
][
'title'
][()]
command_params
=
parse_scan_command
(
command
)
entry_h5f
.
set_scan_params
(
entry
,
**
command_params
)
...
...
xsocs/process/merge/KmapSpecParser.py
View file @
27b69f4a
...
...
@@ -38,7 +38,7 @@ from collections import namedtuple
from
threading
import
Thread
import
h5py
from
silx.io
import
spectoh5
from
silx.io
import
convert
# regular expression matching the imageFile comment line
...
...
@@ -210,11 +210,11 @@ def _spec_to_h5(spec_filename, h5_filename):
:param h5_filename: name of the HDF5 file to create.
:type h5_filename: str
.. seealso : silx.io.convert
_spec_h5
.convert
.. seealso : silx.io.convert.convert
"""
spectoh5
.
convert
(
spec_filename
,
h5_filename
,
mode
=
'w'
)
convert
.
convert
(
spec_filename
,
h5_filename
,
mode
=
'w'
)
# ########################################################################
...
...
@@ -256,7 +256,6 @@ def _spec_get_img_filenames(spec_h5_filename):
for
k_scan
,
v_scan
in
h5_f
.
items
():
header
=
v_scan
[
'instrument/specfile/scan_header'
][()]
header
=
header
.
decode
().
split
(
'
\n
'
)
imgfile_match
=
[
m
for
line
in
header
if
line
.
startswith
(
'#C imageFile'
)
for
m
in
[
regx
.
match
(
line
.
strip
())]
if
m
]
...
...
Write
Preview
Supports
Markdown
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