Commit 0f4c87d9 authored by payno's avatar payno
Browse files

Merge branch '0.4' of https://gitlab.esrf.fr/tomotools/nxtomomill into 0.4

parents 46570566 83ab35a9
......@@ -108,20 +108,19 @@ def main(argv):
"--z_trans_key", default=EDF_Z_TRANS, help="z translation key in EDF HEADER"
)
print("******set up***********")
options = parser.parse_args(argv[1:])
conv = utils.get_tuple_of_keys_from_cmd
file_keys = converter.EDFFileKeys(
motor_mne_key=conv(options.motor_mne_key),
motor_pos_key=conv(options.motor_pos_key),
motor_mne_key=options.motor_mne_key,
motor_pos_key=options.motor_pos_key,
ref_names=conv(options.refs_name_keys),
to_ignore=conv(options.ignore_file_containing),
rot_angle_key=conv(options.rot_angle_key),
rot_angle_key=options.rot_angle_key,
dark_names=conv(options.dark_names),
x_trans_key=conv(options.x_trans_key),
y_trans_key=conv(options.y_trans_key),
z_trans_key=conv(options.z_trans_key),
x_trans_key=options.x_trans_key,
y_trans_key=options.y_trans_key,
z_trans_key=options.z_trans_key,
)
input_dir = options.scan_path
......
......@@ -154,6 +154,12 @@ def main(argv):
action="store_true",
default=False,
)
parser.add_argument(
"--entries",
help="Specify (root) entries to be converted. By default it will try "
"to convert all existing entries.",
default=None,
)
parser.add_argument(
"--raises-error",
help="Raise errors if some data are not met instead of providing some"
......@@ -172,21 +178,25 @@ def main(argv):
)
parser.add_argument(
"--x_trans_keys",
"--x-trans-keys",
default=",".join(H5_X_TRANS_KEYS),
help="x translation key in bliss HDF5 file",
)
parser.add_argument(
"--y_trans_keys",
"--y-trans-keys",
default=",".join(H5_Y_TRANS_KEYS),
help="y translation key in bliss HDF5 file",
)
parser.add_argument(
"--z_trans_keys",
"--z-trans-keys",
default=",".join(H5_Z_TRANS_KEYS),
help="z translation key in bliss HDF5 file",
)
parser.add_argument(
"--valid_camera_names",
"--valid-camera-names",
default=None,
help="Valid NXDetector dataset name to be considered. Otherwise will"
"try to deduce them from NX_class attibute (value should be"
......@@ -194,49 +204,63 @@ def main(argv):
)
parser.add_argument(
"--rot_angle_keys",
"--rot-angle-keys",
default=",".join(H5_ROT_ANGLE_KEYS),
help="Valid dataset name for rotation angle",
)
parser.add_argument(
"--acq_expo_time_keys",
"--acq-expo-time-keys",
default=",".join(H5_ACQ_EXPO_TIME_KEYS),
help="Valid dataset name for acquisition exposure time",
)
parser.add_argument(
"--x_pixel_size_key", default=H5_X_PIXEL_SIZE, help="X pixel size key to read"
"--x_pixel_size_key",
"--x-pixel-size-key",
default=H5_X_PIXEL_SIZE,
help="X pixel size key to read",
)
parser.add_argument(
"--y_pixel_size_key", default=H5_Y_PIXEL_SIZE, help="Y pixel size key to read"
"--y_pixel_size_key",
"--y-pixel-size-key",
default=H5_Y_PIXEL_SIZE,
help="Y pixel size key to read",
)
# scan titles
parser.add_argument(
"--init_titles",
"--init-titles",
default=",".join(H5_INIT_TITLES),
help="Titles corresponding to init scans",
)
parser.add_argument(
"--init_zserie_titles",
"--init-zserie-titles",
default=",".join(H5_ZSERIE_INIT_TITLES),
help="Titles corresponding to zserie init scans",
)
parser.add_argument(
"--dark_titles",
"--dark-titles",
default=",".join(H5_DARK_TITLES),
help="Titles corresponding to dark scans",
)
parser.add_argument(
"--ref_titles",
"--ref-titles",
default=",".join(H5_REF_TITLES),
help="Titles corresponding to ref scans",
)
parser.add_argument(
"--proj_titles",
"--proj-titles",
default=",".join(H5_PROJ_TITLES),
help="Titles corresponding to projection scans",
)
parser.add_argument(
"--align_titles",
"--align-titles",
default=",".join(H5_ALIGNMENT_TITLES),
help="Titles corresponding to alignment scans",
)
......@@ -294,6 +318,11 @@ def main(argv):
else:
callback_det_sel = None
if options.entries is not None:
entries = conv(options.entries)
else:
entries = None
h5_to_nx(
input_file_path=options.input_file_path,
output_file=options.output_file,
......@@ -307,6 +336,7 @@ def main(argv):
raise_error_if_issue=options.raises_error,
detector_sel_callback=callback_det_sel,
ask_before_overwrite=not options.overwrite,
entries=entries,
)
exit(0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment