diff --git a/Config/config.json b/Config/config.json index 7631451..3a50b61 100644 --- a/Config/config.json +++ b/Config/config.json @@ -4,6 +4,6 @@ "Time_in_beam_s": 5, "Time_out_of_beam_s": 10, "Exposure_time": 0.0004, - "Img_Processing": 1, - "pixel_size_mu": 0.275 + "Img_Processing": 0, + "pixel_size_mu": 1.1 } \ No newline at end of file diff --git a/Scripts/__pycache__/metrology_functions.cpython-313.pyc b/Scripts/__pycache__/metrology_functions.cpython-313.pyc index ba1842a..ae582a8 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 1e5d429..f8ce4b7 100644 --- a/Scripts/metrology_functions.py +++ b/Scripts/metrology_functions.py @@ -68,9 +68,10 @@ def init_image_processing_yes_no(): return config.get("Img_Processing",0) def safe_meas_settings(save_path): data = myu.load_object(config_path) - save_path = os.path.join(save_path, get_datestr(),'json') + save_path = os.path.join(save_path, get_datestr(),f'conf_{get_datestr()}.json') with open(save_path,"w") as f: json.dump(data,f) + f.close() def gaussian_2d(coords, amplitude, x0, y0, sigma_x, sigma_y, offset): x, y = coords @@ -453,4 +454,3 @@ print(camera_seting.get_exposure_time())""" - diff --git a/data/data20250718_alignment_tests/20250718_081844_static_0/conf_20250718.json b/data/data20250718_alignment_tests/20250718_081844_static_0/conf_20250718.json new file mode 100644 index 0000000..b9f8517 --- /dev/null +++ b/data/data20250718_alignment_tests/20250718_081844_static_0/conf_20250718.json @@ -0,0 +1 @@ +{"Number_of_cycles": 10, "Amplitude_mm": 1, "Time_in_beam_s": 5, "Time_out_of_beam_s": 10, "Exposure_time": 0.0004, "Img_Processing": 0, "pixel_size_mu": 1.1} \ No newline at end of file diff --git a/notebooks/sample.ipynb b/notebooks/sample.ipynb index 70b66ab..74fa091 100644 --- a/notebooks/sample.ipynb +++ b/notebooks/sample.ipynb @@ -89,8 +89,8 @@ "source_hidden": true }, "ExecuteTime": { - "end_time": "2025-07-18T06:17:20.013396Z", - "start_time": "2025-07-18T06:17:19.780362Z" + "end_time": "2025-07-18T06:30:22.209542Z", + "start_time": "2025-07-18T06:30:21.916896Z" } }, "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": "38edebb931b140518ff4daa682014c05" + "model_id": "183d23fd35de432f9a49f33bcc7562ac" } }, "metadata": {}, @@ -340,7 +340,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "a11e18fc170a431cbfedf222e968019d" + "model_id": "4536bd4f0d5e408ea9f9b908c12cf274" } }, "metadata": {}, @@ -349,12 +349,12 @@ { "data": { "text/plain": [ - "BoundedIntText(value=1000, description='Nr of cycles:', max=1000, min=1)" + "BoundedIntText(value=10, description='Nr of cycles:', max=1000, min=1)" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "95246584dfa3402e8d99dd34b6b1544f" + "model_id": "dba5ac98900f41b4b862a416a4c02e8d" } }, "metadata": {}, @@ -368,7 +368,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "1de56a1ff3b1431784c6fa373a209370" + "model_id": "66ce169800eb45fbae83d67b827b95a2" } }, "metadata": {}, @@ -382,7 +382,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "780c61c3a4aa4b57a0ae6cdef23c91e0" + "model_id": "d228d3816825452c81a83f0f2841f7ea" } }, "metadata": {}, @@ -396,7 +396,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "99fc92db8180499e9ad5bc1a82fe2325" + "model_id": "f53aca50cd3147b49dff846c0c407c69" } }, "metadata": {}, @@ -405,12 +405,12 @@ { "data": { "text/plain": [ - "ToggleButton(value=True, description='Processing', tooltip='Toggle processing on/off')" + "ToggleButton(value=False, description='Processing', tooltip='Toggle processing on/off')" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "54808c66489c408e900cce9fbf4da3b2" + "model_id": "47994b4e86404ecba24f0127a13a3947" } }, "metadata": {}, @@ -424,7 +424,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "49cefb0c51c14074806df59775c809bf" + "model_id": "180883139468449fa35b941927cd1cf9" } }, "metadata": {}, @@ -438,7 +438,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "9909b94b1c1e4494b6761f3a9f024cab" + "model_id": "3313a9c428f3419f954c6786b90b3db7" } }, "metadata": {}, @@ -452,7 +452,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "361a881d49af4571aa4d693f35a6451b" + "model_id": "98648a9238a44467bb3af1e710715279" } }, "metadata": {}, @@ -466,7 +466,7 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "0497555cf4d64422b76e797ed6443759" + "model_id": "e3430d4d4144414388791d6a1a83c57f" } }, "metadata": {}, @@ -480,14 +480,14 @@ "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, - "model_id": "f20d62b2877143f7b3656f5069921684" + "model_id": "623839136ae84c748c4487ed261ac572" } }, "metadata": {}, "output_type": "display_data" } ], - "execution_count": 3 + "execution_count": 1 }, { "cell_type": "markdown", @@ -551,10 +551,6 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "ExecuteTime": { - "end_time": "2025-07-18T06:17:16.504322Z", - "start_time": "2025-07-18T06:17:16.449495Z" } }, "source": [ @@ -623,20 +619,8 @@ "plt.tight_layout()\n", "fig_temp.canvas.draw_idle()" ], - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'myu' is not defined", - "output_type": "error", - "traceback": [ - "\u001B[31m---------------------------------------------------------------------------\u001B[39m", - "\u001B[31mNameError\u001B[39m Traceback (most recent call last)", - "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[2]\u001B[39m\u001B[32m, line 8\u001B[39m\n\u001B[32m 2\u001B[39m get_ipython().run_line_magic(\u001B[33m'\u001B[39m\u001B[33mmatplotlib\u001B[39m\u001B[33m'\u001B[39m, \u001B[33m'\u001B[39m\u001B[33mwidget\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 5\u001B[39m \u001B[38;5;66;03m# Load the newest file\u001B[39;00m\n\u001B[32m 6\u001B[39m \n\u001B[32m 7\u001B[39m \u001B[38;5;66;03m# Load file\u001B[39;00m\n\u001B[32m----> \u001B[39m\u001B[32m8\u001B[39m file_path = \u001B[43mmyu\u001B[49m.find_newest_dat_file(data_folder)\n\u001B[32m 9\u001B[39m times, temps = myu.load_temp_data(file_path)\n\u001B[32m 11\u001B[39m \u001B[38;5;66;03m# Initial plot range setup\u001B[39;00m\n", - "\u001B[31mNameError\u001B[39m: name 'myu' is not defined" - ] - } - ], - "execution_count": 2 + "outputs": [], + "execution_count": null }, { "cell_type": "markdown", @@ -754,10 +738,6 @@ "metadata": { "jupyter": { "source_hidden": true - }, - "ExecuteTime": { - "end_time": "2025-07-18T06:17:14.135022Z", - "start_time": "2025-07-18T06:17:13.794913Z" } }, "source": [ @@ -888,20 +868,8 @@ "plt.tight_layout()\n", "plt.show()\n" ], - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'myu' is not defined", - "output_type": "error", - "traceback": [ - "\u001B[31m---------------------------------------------------------------------------\u001B[39m", - "\u001B[31mNameError\u001B[39m Traceback (most recent call last)", - "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[1]\u001B[39m\u001B[32m, line 8\u001B[39m\n\u001B[32m 4\u001B[39m config = myu.load_object(config_path)\n\u001B[32m 5\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m config.get(\u001B[33m\"\u001B[39m\u001B[33mpixel_size_mu\u001B[39m\u001B[33m\"\u001B[39m)\n\u001B[32m----> \u001B[39m\u001B[32m8\u001B[39m axis_path_1 = \u001B[43mmyu\u001B[49m.get_latest_measurement_dir(\u001B[32m1\u001B[39m)\n\u001B[32m 9\u001B[39m \u001B[38;5;28mprint\u001B[39m(axis_path_1)\n\u001B[32m 10\u001B[39m \u001B[38;5;66;03m#axis_path_1 = r\"C:\\Users\\berti_r\\Python_Projects\\StagePerformaceDocu\\data\\data20250717_alignment_tests\\20250717_085115_static_0\" #uncomment for specific path\u001B[39;00m\n", - "\u001B[31mNameError\u001B[39m: name 'myu' is not defined" - ] - } - ], - "execution_count": 1 + "outputs": [], + "execution_count": null }, { "cell_type": "code",