Commit 195a23c4 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

DatasetAnalyzer: fix lookup_files

parent 67ee8faf
Pipeline #36198 passed with stages
in 14 minutes and 34 seconds
......@@ -254,12 +254,6 @@ class HDF5DatasetAnalyzer(DatasetAnalyzer):
def _compute_or_load_flats(self):
h5_entry = self.hdf5_entry or "entry"
h5_path = posixpath.join(h5_entry, "flat_field_images")
if self.processes_file is None:
lookup_files = None
else:
lookup_files = [
DataUrl(file_path=self.processes_file, data_path=h5_path)
]
# In this case, we always want to return a dict of DataUrl,
# so we have to write the final flats/darks somewhere.
# Therefore results_url cannot be None when instantiating NXFlatField.
......@@ -267,6 +261,15 @@ class HDF5DatasetAnalyzer(DatasetAnalyzer):
results_file = self._get_results_file()
results_url = DataUrl(file_path=results_file, data_path=h5_path)
lookup_files = None
if self.processes_file is not None:
lookup_files = [DataUrl(file_path=self.processes_file, data_path=h5_path)]
else:
if os.path.isfile(results_file):
# We use an existing "results file" as lookup file.
# NXFlatField wont overwrite it if it has the good configuration
lookup_files = [DataUrl(file_path=results_file, data_path=h5_path)]
self._nxflatfield = NXFlatField(
self._get_dataset_hdf5_url(),
self.dataset_scanner.image_key,
......
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