From 9564803184f04dd236ea54505b6ee1e05dd46313 Mon Sep 17 00:00:00 2001 From: Lloyd Dakin Date: Fri, 4 Oct 2024 12:00:22 -0700 Subject: [PATCH] improved normalization loading feel --- datalab/datalab_session/data_operations/normalization.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/datalab/datalab_session/data_operations/normalization.py b/datalab/datalab_session/data_operations/normalization.py index d9f7a8f..e250f6e 100644 --- a/datalab/datalab_session/data_operations/normalization.py +++ b/datalab/datalab_session/data_operations/normalization.py @@ -47,14 +47,13 @@ def operate(self): image_data_list = self.get_fits_npdata(input) output_files = [] - for index, image in enumerate(image_data_list): + for index, image in enumerate(image_data_list, start=1): median = np.median(image) normalized_image = image / median output = create_output(self.cache_key, normalized_image, index=index, comment=f'Product of Datalab Normalization on file {input[index]["basename"]}') output_files.append(output) - - self.set_operation_progress(0.80) + self.set_operation_progress(0.5 + index/len(image_data_list) * 0.4) self.set_output(output_files) log.info(f'Normalization output: {self.get_output()}')