reordered operations

This commit is contained in:
2024-09-04 17:30:43 +02:00
parent 35c50b472f
commit f18af38dc6

View File

@ -3,11 +3,18 @@ from .thresh import threshold
def calc_apply_aggregation(results, data, pixel_mask_pf, aggregator):
# last round was ready, restart
if aggregator.is_ready():
aggregator.reset()
calc_apply_threshold(results, data) # changes data in place
data = calc_aggregate(results, data, aggregator)
calc_mask_pixels(data, pixel_mask_pf) # changes data in place
aggregation_ready = calc_aggregation_ready(results, aggregator)
return data, aggregation_ready
aggregator.nmax = results.get("aggregation_max")
aggregation_is_ready = aggregator.is_ready()
return data, aggregation_is_ready
@ -50,14 +57,3 @@ def calc_aggregate(results, data, aggregator):
def calc_aggregation_ready(results, aggregator):
aggregator.nmax = results.get("aggregation_max")
if not aggregator.is_ready():
return False
aggregator.reset()
return True