Unverified Commit 99706746 authored by Henri Payno's avatar Henri Payno
Browse files

edf2nx: fix issues with the progress.

flat and projections can be write `interlace` and reseting the progress was a mess.
Simply avoid reseting the progress and only update advancement when write projection.
parent 3b39af12
Pipeline #60623 passed with stages
in 3 minutes and 15 seconds
......@@ -373,7 +373,7 @@ def edf_to_nx(
if progress is not None:
progress.set_name("write dark")
progress.set_max_advancement(len(dk_urls))
progress.reset(len(dk_urls))
def ignore(file_name):
for forbid in _edf_to_ignore:
......@@ -389,7 +389,7 @@ def edf_to_nx(
norm_dark = len(dk_urls) / scan.dark_n
dk_indexes = sorted(dk_urls.keys())
if progress is not None:
progress.set_max_advancement(len(dk_urls))
progress.reset(len(dk_urls))
for dk_index in dk_indexes:
dk_url = dk_urls[dk_index]
if ignore(os.path.basename(dk_url.file_path())):
......@@ -460,9 +460,6 @@ def edf_to_nx(
ztix,
):
nfr = nF
if progress is not None:
progress.set_name("write refs")
progress.set_max_advancement(len(refIndexes))
for ref_index in refIndexes:
int_rf = int(ref_index)
test_val = 0
......@@ -495,16 +492,13 @@ def edf_to_nx(
zDataset[nfr] = float(str_mot_val[ztix])
nfr += 1
if progress is not None:
progress.increase_advancement(i=1)
return nfr
# projections
proj_indexes = sorted(proj_urls.keys())
if progress is not None:
progress.set_name("write projections")
progress.set_max_advancement(len(proj_indexes))
progress.set_name("write projections and flats")
progress.reset(len(proj_indexes))
nproj = 0
iref_pj = 0
......
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