Commit 16cdd72d authored by Thomas Vincent's avatar Thomas Vincent

add merge image_roi to script helper

parent cb8a453b
......@@ -78,6 +78,11 @@ chan_per_deg = [318., 318.]
# direct beam position in the detector coordinates
center_chan = [140, 322]
# Detector image ROI to save as (row, column, height, width), example:
# image_roi = [100, 100, 200, 200]
# Set to None to save the whole image:
image_roi = None
# checks if some of the output files already exist
# set it to True if you dont care about overwriting files
overwrite = False
......@@ -92,7 +97,8 @@ merge_scan_data(output_dir,
scan_ids=scan_ids,
img_dir=img_base,
version=version,
overwrite=overwrite)
overwrite=overwrite,
image_roi=image_roi)
t_merge = time.time() - t_merge
print('Total time spent : {0}'.format(t_merge))
......@@ -47,7 +47,8 @@ def merge_scan_data(output_dir,
nr_padding=None,
nr_offset=None,
compression='lzf',
overwrite=False):
overwrite=False,
image_roi=None):
"""
Creates a "master" HDF5 file and one HDF5 per scan. Those scan HDF5 files
contain spec data (from *spec_fname*) as well as the associated
......@@ -108,6 +109,11 @@ def merge_scan_data(output_dir,
in the SPEC file.
:type nr_offset: int
:param image_roi:
Detector image ROI (origin_row, origin_column, height, width) to save,
or None (default) to save the whole image
:type image_roi: Union[List[int],None]
:returns: a list of scan IDs that were merged
:rtype: *list*
"""
......@@ -145,6 +151,7 @@ def merge_scan_data(output_dir,
merger.chan_per_deg = chan_per_deg
merger.n_proc = n_proc
merger.compression = compression
merger.image_roi = image_roi
merger.select(scan_ids, clear=True)
......
Markdown is supported
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