From 9c04904758622669e036350b0f7f137eda94bdc6 Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Fri, 3 Dec 2021 17:22:55 -0500 Subject: [PATCH 1/5] Progress on NYX on 2021-12-03 --- startup/50-objects.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/startup/50-objects.py b/startup/50-objects.py index 3df9082..04bb30a 100644 --- a/startup/50-objects.py +++ b/startup/50-objects.py @@ -11,3 +11,23 @@ detector = PilatusBase("XF:19IDC-ES{Det:Pil6M}", name="detector") vector = VectorProgram("XF:19IDC-ES{Gon:1-Vec}", name="vector") flyer = NYXFlyer(vector=vector, zebra=zebra, detector=detector) + + +scan_params = { + 'angle_start': 0, + 'exposure_period_per_image': 0.5, + 'detector_dead_time': 0.01, + 'scan_width': 1.0, + 'img_width': 0.2, + 'num_images': 5, + 'x_start_um': 0, + 'y_start_um': 0, + 'z_start_um': 0, + 'file_prefix': 'testjun', + 'data_directory_name': '/nyx-data/test/bluesky-2021-12-01', + 'file_number_start': 1, + 'x_beam': 1000, + 'y_beam': 1200, + 'wavelength': 0.9876, + 'det_distance_m': 0.25, + } From d31ca789ff794fbbb7fb8540e9be55e213e2c24b Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Tue, 7 Dec 2021 16:38:35 -0500 Subject: [PATCH 2/5] Working prototype of the flyer and handler with 1 frame --- startup/00-base.py | 5 +++++ startup/50-objects.py | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/startup/00-base.py b/startup/00-base.py index ca0be25..876f4cf 100644 --- a/startup/00-base.py +++ b/startup/00-base.py @@ -64,3 +64,8 @@ def wait_for_connection(self, timeout=DEFAULT_CONNECTION_TIMEOUT): RE.md["beamline_name"] = "NYX" RE.md["facility"] = "NSLS-II" + +# TODO: comment out when in production. +from bluesky.utils import ts_msg_hook +RE.msg_hook = ts_msg_hook +print(f"\n\t{__file__}: Using 'ts_msg_hook'...\n") diff --git a/startup/50-objects.py b/startup/50-objects.py index 04bb30a..df1a094 100644 --- a/startup/50-objects.py +++ b/startup/50-objects.py @@ -24,10 +24,26 @@ 'y_start_um': 0, 'z_start_um': 0, 'file_prefix': 'testjun', - 'data_directory_name': '/nyx-data/test/bluesky-2021-12-01', + # 'data_directory_name': '/nyx-data/test/bluesky-2021-12-01', + 'data_directory_name': '/nyx-data/test/juntest', 'file_number_start': 1, 'x_beam': 1000, 'y_beam': 1200, 'wavelength': 0.9876, 'det_distance_m': 0.25, } + +# In [2]: hdr.start +# Out[2]: +# {'uid': '5d7b5855-382c-4043-aa67-a7e026392543', +# 'time': 1638912272.5825405, +# 'beamline_attenuators': {}, +# 'optinal_comments': '', +# 'scan_id': 21, +# 'facility': 'NSLS-II', +# 'beamline_beamsize': 'low_divergence', +# 'beamline_name': 'NYX', +# 'beamline_sample_environement': 'in-vacuum', +# 'beamline_id': 'SST-1 RSoXS', +# 'plan_type': 'generator', +# 'plan_name': 'fly'} From 13ad807a19ae90cf7064e15a587ce51b3032c96a Mon Sep 17 00:00:00 2001 From: Maksim Rakitin Date: Fri, 17 Dec 2021 16:36:49 -0500 Subject: [PATCH 3/5] Register `AD_PILATUS` handler explicitly --- startup/00-base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/startup/00-base.py b/startup/00-base.py index 876f4cf..e9390d9 100644 --- a/startup/00-base.py +++ b/startup/00-base.py @@ -69,3 +69,10 @@ def wait_for_connection(self, timeout=DEFAULT_CONNECTION_TIMEOUT): from bluesky.utils import ts_msg_hook RE.msg_hook = ts_msg_hook print(f"\n\t{__file__}: Using 'ts_msg_hook'...\n") + + +# Temp workaround to register the handler (does not work via entrypoints in +# setup.py for some reason...) + +from nyxtools.handlers import PilatusHandlerMX +db.reg.register_handler("AD_PILATUS_MX", PilatusHandlerMX) From cd44b229a2c7c1389f89ca8ab3e58e795a6d06f7 Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Wed, 5 Jan 2022 09:55:26 -0500 Subject: [PATCH 4/5] fix branch name - flyer-test already merged --- .ci/bl-specific.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/bl-specific.sh b/.ci/bl-specific.sh index bca9cdb..6f0a16c 100644 --- a/.ci/bl-specific.sh +++ b/.ci/bl-specific.sh @@ -6,4 +6,4 @@ export AZURE_TESTING=1 pip install -vv git+https://github.com/NSLS-II-AMX/mxtools@main -pip install -vv git+https://github.com/NSLS-II-NYX/nyxtools@flyer-test +pip install -vv git+https://github.com/NSLS-II-NYX/nyxtools@main From a88e50c7adc4f580437198944723c4d077cd1f4a Mon Sep 17 00:00:00 2001 From: Jun Aishima Date: Wed, 12 Jan 2022 17:10:15 -0500 Subject: [PATCH 5/5] Update startup/50-objects.py Co-authored-by: Maksim Rakitin --- startup/50-objects.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/startup/50-objects.py b/startup/50-objects.py index df1a094..295016f 100644 --- a/startup/50-objects.py +++ b/startup/50-objects.py @@ -13,25 +13,26 @@ flyer = NYXFlyer(vector=vector, zebra=zebra, detector=detector) -scan_params = { - 'angle_start': 0, - 'exposure_period_per_image': 0.5, - 'detector_dead_time': 0.01, - 'scan_width': 1.0, - 'img_width': 0.2, - 'num_images': 5, - 'x_start_um': 0, - 'y_start_um': 0, - 'z_start_um': 0, - 'file_prefix': 'testjun', - # 'data_directory_name': '/nyx-data/test/bluesky-2021-12-01', - 'data_directory_name': '/nyx-data/test/juntest', - 'file_number_start': 1, - 'x_beam': 1000, - 'y_beam': 1200, - 'wavelength': 0.9876, - 'det_distance_m': 0.25, - } +# NOTE: This is a sample `scan_params` dictionary, change as you need. +# scan_params = { +# 'angle_start': 0, +# 'exposure_period_per_image': 0.5, +# 'detector_dead_time': 0.01, +# 'scan_width': 1.0, +# 'img_width': 0.2, +# 'num_images': 5, +# 'x_start_um': 0, +# 'y_start_um': 0, +# 'z_start_um': 0, +# 'file_prefix': 'testjun', +# # 'data_directory_name': '/nyx-data/test/bluesky-2021-12-01', +# 'data_directory_name': '/nyx-data/test/juntest', +# 'file_number_start': 1, +# 'x_beam': 1000, +# 'y_beam': 1200, +# 'wavelength': 0.9876, +# 'det_distance_m': 0.25, +# } # In [2]: hdr.start # Out[2]: