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
nxtomomill
Commits
6b96a586
Unverified
Commit
6b96a586
authored
Nov 19, 2021
by
Henri Payno
Browse files
[h52nx] improve robustness when check if some parameter as already be defined
parent
7b21e382
Changes
1
Hide whitespace changes
Inline
Side-by-side
nxtomomill/converter/hdf5/acquisition/standardacquisition.py
View file @
6b96a586
...
...
@@ -541,8 +541,15 @@ class StandardAcquisition(BaseAcquisition):
def
_write_beam
(
self
,
root_node
,
request_input
,
input_callback
):
instrument_node
=
root_node
.
require_group
(
"instrument"
)
beam_node
=
instrument_node
.
require_group
(
"beam"
)
if
"energy"
in
self
.
configuration
.
param_already_defined
:
energy
=
float
(
self
.
configuration
.
param_already_defined
[
"energy"
])
if
(
TomoHDF5Config
.
EXTRA_PARAMS_ENERGY_DK
in
self
.
configuration
.
param_already_defined
):
energy
=
float
(
self
.
configuration
.
param_already_defined
[
TomoHDF5Config
.
EXTRA_PARAMS_ENERGY_DK
]
)
unit
=
"kev"
else
:
energy
,
unit
=
self
.
_get_energy
(
...
...
@@ -583,9 +590,14 @@ class StandardAcquisition(BaseAcquisition):
# write x and y pixel size
# if magnified pixel size is found then we right this value.
# otherwise will take pixel size (if found)
if
"x_pixel_size"
in
self
.
configuration
.
param_already_defined
:
if
(
TomoHDF5Config
.
EXTRA_PARAMS_X_PIXEL_SIZE_DK
in
self
.
configuration
.
param_already_defined
):
x_pixel_size
=
float
(
self
.
configuration
.
param_already_defined
[
"x_pixel_size"
]
self
.
configuration
.
param_already_defined
[
TomoHDF5Config
.
EXTRA_PARAMS_X_PIXEL_SIZE_DK
]
)
unit
=
"m"
else
:
...
...
@@ -594,9 +606,14 @@ class StandardAcquisition(BaseAcquisition):
detector_node
[
"x_pixel_size"
]
=
x_pixel_size
detector_node
[
"x_pixel_size"
].
attrs
[
"unit"
]
=
unit
if
"y_pixel_size"
in
self
.
configuration
.
param_already_defined
:
if
(
TomoHDF5Config
.
EXTRA_PARAMS_Y_PIXEL_SIZE_DK
in
self
.
configuration
.
param_already_defined
):
y_pixel_size
=
float
(
self
.
configuration
.
param_already_defined
[
"y_pixel_size"
]
self
.
configuration
.
param_already_defined
[
TomoHDF5Config
.
EXTRA_PARAMS_Y_PIXEL_SIZE_DK
]
)
unit
=
"m"
else
:
...
...
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