added some paramters; transpose the images; run a first processing outside the profiler
This commit is contained in:
@ -33,18 +33,23 @@ def main(fn_proc, fn_imgs):
|
|||||||
imgs = np.load(fn_imgs)
|
imgs = np.load(fn_imgs)
|
||||||
|
|
||||||
pulse_id = timestamp = x_axis = y_axis = None
|
pulse_id = timestamp = x_axis = y_axis = None
|
||||||
parameters = {
|
parameters = { #TODO: this should be read from a json config, like in the pipeline
|
||||||
"camera_name": "test"
|
"camera_name": "test",
|
||||||
|
"roi_background": [0, 2048, 50, 350],
|
||||||
|
"roi_signal": [0, 2048, 550, 850],
|
||||||
|
"project_axis": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
for i, img in enumerate(imgs):
|
for i, img in enumerate(imgs):
|
||||||
# print(i)
|
# print(i)
|
||||||
res = proc(
|
res = proc(
|
||||||
img,
|
img.T,
|
||||||
pulse_id, timestamp, x_axis, y_axis, parameters
|
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")
|
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||||
os.makedirs("prof", exist_ok=True)
|
os.makedirs("prof", exist_ok=True)
|
||||||
fn_base_res = f"prof/{fn_proc}-{timestamp}"
|
fn_base_res = f"prof/{fn_proc}-{timestamp}"
|
||||||
@ -75,7 +80,7 @@ def write_stats(p, fn):
|
|||||||
|
|
||||||
# timing
|
# timing
|
||||||
|
|
||||||
def func_timeit(func, fn, repeat=3, number=1):
|
def func_timeit(func, fn, repeat=5, number=10):
|
||||||
t = timeit.Timer(func)
|
t = timeit.Timer(func)
|
||||||
res = t.repeat(repeat=repeat, number=number)
|
res = t.repeat(repeat=repeat, number=number)
|
||||||
res = np.array(res)
|
res = np.array(res)
|
||||||
|
Reference in New Issue
Block a user