diff --git a/Config/config.json b/Config/config.json index 6bcda31..cab6f65 100644 --- a/Config/config.json +++ b/Config/config.json @@ -1,5 +1,5 @@ { - "Number_of_cycles": 500, + "Number_of_cycles": 1000, "Amplitude_mm": 1, "Time_in_beam_s": 5, "Time_out_of_beam_s": 10, diff --git a/Scripts/__pycache__/metrology_functions.cpython-313.pyc b/Scripts/__pycache__/metrology_functions.cpython-313.pyc index a165ee7..e83ef52 100644 Binary files a/Scripts/__pycache__/metrology_functions.cpython-313.pyc and b/Scripts/__pycache__/metrology_functions.cpython-313.pyc differ diff --git a/Scripts/metrology_functions.py b/Scripts/metrology_functions.py index f47dc15..4dc35b2 100644 --- a/Scripts/metrology_functions.py +++ b/Scripts/metrology_functions.py @@ -367,7 +367,7 @@ def camera_thread_function( img_queue): camera.start() start_time = time.time() - for i in range(10): + for i in range(init_nr_of_cycles()): img_queue.put((camera.get_image(),time.time())) stop_time = time.time() elapsed_time = stop_time - start_time @@ -391,8 +391,7 @@ def static_test(motor_on_off=0): camera_thread = th.Thread(target=camera_thread_function, args=(img_queue,)) camera_thread.start() i = 0 - while camera_thread.is_alive(): - sleep(0.01) + camera_thread.join() while not img_queue.empty(): i = i+1 im,tim = img_queue.get() @@ -407,7 +406,7 @@ def static_test(motor_on_off=0): with open(savefile, 'a') as fh: fh.write(data_str) fh.close() - camera_thread.join() + def my_set_ev(): diff --git a/data/data20250717_alignment_tests/20250717_162404_static_0/static_0.dat b/data/data20250717_alignment_tests/20250717_162404_static_0/static_0.dat new file mode 100644 index 0000000..cb1581a --- /dev/null +++ b/data/data20250717_alignment_tests/20250717_162404_static_0/static_0.dat @@ -0,0 +1,10 @@ + 1 0.000000 0.000000 23.613 42.692 1752762244.393 + 2 0.000000 0.000000 23.551 42.823 1752762244.449 + 3 0.000000 0.000000 23.643 42.783 1752762244.506 + 4 0.000000 0.000000 23.539 42.809 1752762244.561 + 5 0.000000 0.000000 23.478 42.919 1752762244.618 + 6 0.000000 0.000000 23.563 42.784 1752762244.674 + 7 0.000000 0.000000 23.416 42.840 1752762244.731 + 8 0.000000 0.000000 23.629 42.841 1752762244.788 + 9 0.000000 0.000000 23.478 42.907 1752762244.844 + 10 0.000000 0.000000 23.554 42.825 1752762244.901 diff --git a/data/data20250717_alignment_tests/20250717_162558_static_0/static_0.dat b/data/data20250717_alignment_tests/20250717_162558_static_0/static_0.dat new file mode 100644 index 0000000..c76e96e --- /dev/null +++ b/data/data20250717_alignment_tests/20250717_162558_static_0/static_0.dat @@ -0,0 +1,10 @@ + 1 0.000000 0.000000 23.516 42.931 1752762358.634 + 2 0.000000 0.000000 23.630 42.827 1752762358.691 + 3 0.000000 0.000000 23.439 42.947 1752762358.747 + 4 0.000000 0.000000 23.560 42.964 1752762358.803 + 5 0.000000 0.000000 23.455 42.894 1752762358.860 + 6 0.000000 0.000000 23.545 42.918 1752762358.916 + 7 0.000000 0.000000 23.578 42.824 1752762358.972 + 8 0.000000 0.000000 23.447 43.033 1752762359.029 + 9 0.000000 0.000000 23.628 42.953 1752762359.085 + 10 0.000000 0.000000 23.478 42.873 1752762359.141 diff --git a/notebooks/sample.ipynb b/notebooks/sample.ipynb index aa558b7..6a4597d 100644 --- a/notebooks/sample.ipynb +++ b/notebooks/sample.ipynb @@ -89,8 +89,8 @@ "source_hidden": true }, "ExecuteTime": { - "end_time": "2025-07-17T14:13:34.725425Z", - "start_time": "2025-07-17T14:13:34.499524Z" + "end_time": "2025-07-17T14:27:13.704906Z", + "start_time": "2025-07-17T14:27:13.502595Z" } }, "source": [ @@ -313,7 +313,7 @@ "Connect to PLC\n", "is_open()=True\n", "get_local_address()=None\n", - "read_device_info()=('Plc30 App', )\n", + "read_device_info()=('Plc30 App', )\n", "GVL_APP.nAXIS_NUM=3\n", "Constructor for axis\n" ] @@ -326,7 +326,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "24e6d309a6fa4bf08355a4d9b16c5140" + "model_id": "fc4230427234482883aae709683738da" } }, "metadata": {}, @@ -340,7 +340,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "c7afe3bdcf394f1d867c3330e0203656" + "model_id": "71c9152bb2d8469bb15b15589486ce6b" } }, "metadata": {}, @@ -349,12 +349,12 @@ { "data": { "text/plain": [ - "BoundedIntText(value=500, description='Nr of cycles:', max=1000, min=1)" + "BoundedIntText(value=1000, description='Nr of cycles:', max=1000, min=1)" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "674c2ad7cc27438dbb50381677c4460b" + "model_id": "e9787f7a587f4da0989c1d3869c6b489" } }, "metadata": {}, @@ -368,7 +368,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "3a7767c1f7c0403a90815507626cb7d4" + "model_id": "c0f8b09d8f46420e8495efe5845cfc91" } }, "metadata": {}, @@ -382,7 +382,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "d34235c2d58a42a6a07c6c7c83553e4a" + "model_id": "12ec486c732e4ca78d2e1cfcc9a2ccbb" } }, "metadata": {}, @@ -396,7 +396,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "c58b963fbf24430e86e5a41e792940e0" + "model_id": "9a698c4d24e149ed91e21ed2d4e95017" } }, "metadata": {}, @@ -410,7 +410,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "d2935b4152c343c0af0327dbfbc9a318" + "model_id": "a330539dd8b94877a0f3216ff108c755" } }, "metadata": {}, @@ -424,7 +424,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "c4007ab71ec94cd682c3eb9a7a089eff" + "model_id": "4089210bf6024e9fb17ccb32d3a40617" } }, "metadata": {}, @@ -438,7 +438,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "de9fd9d529d4439f86053c7cd04f764a" + "model_id": "a14d3eac97a04fed99438cb904870560" } }, "metadata": {}, @@ -452,7 +452,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "51f5422cd751446ebd8a43237487e3f8" + "model_id": "8d488488da5d4658847e20c7913502d8" } }, "metadata": {}, @@ -466,7 +466,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "a6aecc0a05de4ccb8836e160d385376d" + "model_id": "8ece0ce356be48f5a4f7553a747438da" } }, "metadata": {}, @@ -480,7 +480,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "748a252c15184b26bb7202e02156790a" + "model_id": "e66524cc588e4556818212361003d1c8" } }, "metadata": {},