added some paramters; transpose the images; run a first processing outside the profiler

This commit is contained in:
gac-alvra
2022-02-24 13:20:12 +01:00
parent 7247e37d7f
commit 98f4ee3349

View File

@ -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)