From d0c1621109a65887af93a75f13d8286a583e28c7 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 28 Aug 2024 10:08:18 +0200 Subject: [PATCH] consistency: removed special case that sends the raw data `image` instead of the processed image `data` [special case triggered if apply_aggregation and apply_threshold are off, but both can still be not applied if the respective parameters (aggregation_max, threshold_min, threshold_max) are not given, which would send `data`] --- dap/algos/aggregation.py | 7 +++---- dap/worker.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dap/algos/aggregation.py b/dap/algos/aggregation.py index dae7358..ae83523 100644 --- a/dap/algos/aggregation.py +++ b/dap/algos/aggregation.py @@ -4,15 +4,15 @@ from .mask import calc_mask_pixels from .thresh import threshold -def calc_apply_aggregation(results, data, pixel_mask_pf, image, aggregator): - data = calc_data(results, data, image, aggregator) +def calc_apply_aggregation(results, data, pixel_mask_pf, aggregator): + data = calc_data(results, data, aggregator) calc_mask_pixels(data, pixel_mask_pf) # changes data in place aggregation_ready = calc_aggregation_ready(results, data, aggregator) return data, aggregation_ready -def calc_data(results, data, image, aggregator): +def calc_data(results, data, aggregator): if data.dtype == np.uint16: return data @@ -23,7 +23,6 @@ def calc_data(results, data, image, aggregator): aggregator.reset() if not apply_aggregation and not apply_threshold: - data = image return data calc_apply_threshold(results, data) # changes data in place diff --git a/dap/worker.py b/dap/worker.py index f11fd0d..492ce39 100644 --- a/dap/worker.py +++ b/dap/worker.py @@ -115,7 +115,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host calc_peakfinder_analysis(results, pfdata, pixel_mask_pf) # ??? - data, aggregation_is_ready = calc_apply_aggregation(results, data, pixel_mask_pf, image, aggregator) + data, aggregation_is_ready = calc_apply_aggregation(results, data, pixel_mask_pf, aggregator) results["type"] = str(data.dtype) results["shape"] = data.shape