From 98f4ee3349a633d6e43d85451b81f1a6343b1f94 Mon Sep 17 00:00:00 2001 From: gac-alvra Date: Thu, 24 Feb 2022 13:20:12 +0100 Subject: [PATCH] added some paramters; transpose the images; run a first processing outside the profiler --- procprof/procprof.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/procprof/procprof.py b/procprof/procprof.py index f251edf..eac5aa6 100755 --- a/procprof/procprof.py +++ b/procprof/procprof.py @@ -33,18 +33,23 @@ def main(fn_proc, fn_imgs): imgs = np.load(fn_imgs) pulse_id = timestamp = x_axis = y_axis = None - parameters = { - "camera_name": "test" + parameters = { #TODO: this should be read from a json config, like in the pipeline + "camera_name": "test", + "roi_background": [0, 2048, 50, 350], + "roi_signal": [0, 2048, 550, 850], + "project_axis": 1 } def test(): for i, img in enumerate(imgs): # print(i) res = proc( - img, + img.T, pulse_id, timestamp, x_axis, y_axis, parameters ) + proc(imgs[0].T, pulse_id, timestamp, x_axis, y_axis, parameters) + timestamp = datetime.now().strftime("%Y%m%d-%H%M%S") os.makedirs("prof", exist_ok=True) fn_base_res = f"prof/{fn_proc}-{timestamp}" @@ -75,7 +80,7 @@ def write_stats(p, fn): # timing -def func_timeit(func, fn, repeat=3, number=1): +def func_timeit(func, fn, repeat=5, number=10): t = timeit.Timer(func) res = t.repeat(repeat=repeat, number=number) res = np.array(res)