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
tomotools
tomoscan
Commits
b2063996
Commit
b2063996
authored
Mar 10, 2021
by
payno
Browse files
[HDF5TomoScan] add "start_time" and "end_time" properties
parent
a571caa2
Pipeline
#42793
passed with stages
in 10 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/hdf5scan.py
View file @
b2063996
...
...
@@ -109,6 +109,10 @@ class HDF5TomoScan(TomoScanBase):
_ENERGY_PATH
=
"beam/incident_energy"
_START_TIME_PATH
=
"start_time"
_END_TIME_START
=
"end_time"
_SCHEME
=
"silx"
_EPSILON_ROT_ANGLE
=
0.02
...
...
@@ -178,6 +182,8 @@ class HDF5TomoScan(TomoScanBase):
self
.
_fov
=
None
self
.
_energy
=
None
self
.
_estimated_cor_frm_motor
=
None
self
.
_start_time
=
None
self
.
_end_time
=
None
@
staticmethod
def
get_master_file
(
scan_path
):
...
...
@@ -695,6 +701,28 @@ class HDF5TomoScan(TomoScanBase):
self
.
_energy
=
self
.
_get_value
(
energy_dataset
,
default_unit
=
"keV"
)
return
self
.
_energy
@
property
def
start_time
(
self
):
if
self
.
_start_time
is
None
and
self
.
master_file
and
os
.
path
.
exists
:
self
.
_check_hdf5scan_validity
()
with
HDF5File
(
self
.
master_file
,
"r"
,
swmr
=
True
)
as
h5_file
:
if
self
.
_START_TIME_PATH
in
h5_file
[
self
.
_entry
]:
self
.
_start_time
=
h5py_read_dataset
(
h5_file
[
self
.
_entry
][
self
.
_START_TIME_PATH
]
)
return
self
.
_start_time
@
property
def
end_time
(
self
):
if
self
.
_end_time
is
None
and
self
.
master_file
and
os
.
path
.
exists
:
self
.
_check_hdf5scan_validity
()
with
HDF5File
(
self
.
master_file
,
"r"
,
swmr
=
True
)
as
h5_file
:
if
self
.
_END_TIME_START
in
h5_file
[
self
.
_entry
]:
self
.
_end_time
=
h5py_read_dataset
(
h5_file
[
self
.
_entry
][
self
.
_END_TIME_START
]
)
return
self
.
_end_time
@
property
def
frames
(
self
)
->
typing
.
Union
[
None
,
tuple
]:
"""return tuple of frames. Frames contains """
...
...
payno
@payno
mentioned in issue
#20 (closed)
·
Apr 06, 2021
mentioned in issue
#20 (closed)
mentioned in issue #20
Toggle commit list
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