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
tomotools
tomoscan
Commits
79caeb74
Commit
79caeb74
authored
Feb 25, 2020
by
Pierre Paleo
Browse files
HDF5TomoScan: add energy property
parent
ed88c5f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/hdf5scan.py
View file @
79caeb74
...
...
@@ -90,6 +90,8 @@ class HDF5TomoScan(TomoScanBase):
_DISTANCE_PATH
=
'instrument/detector/distance'
_ENERGY_PATH
=
'beam/incident_energy'
_SCHEME
=
'silx'
_EPSILON_ROT_ANGLE
=
0.02
...
...
@@ -148,6 +150,7 @@ class HDF5TomoScan(TomoScanBase):
self
.
_image_keys
=
None
self
.
_rotation_angles
=
None
self
.
_distance
=
None
self
.
_energy
=
None
@
staticmethod
def
get_master_file
(
scan_path
):
...
...
@@ -477,6 +480,15 @@ class HDF5TomoScan(TomoScanBase):
self
.
_distance
=
self
.
_get_value
(
distance_dataset
,
default_unit
=
'm'
)
return
self
.
_distance
@
property
def
energy
(
self
)
->
typing
.
Union
[
None
,
float
]:
if
(
self
.
_energy
is
None
and
self
.
master_file
and
os
.
path
.
exists
(
self
.
master_file
)):
with
h5py
.
File
(
self
.
master_file
,
'r'
)
as
h5_file
:
energy_dataset
=
h5_file
[
self
.
_entry
][
self
.
_ENERGY_PATH
]
self
.
_energy
=
self
.
_get_value
(
energy_dataset
,
default_unit
=
'keV'
)
return
self
.
_energy
@
property
def
frames
(
self
)
->
typing
.
Union
[
None
,
tuple
]:
"""return tuple of frames. Frames contains """
...
...
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