acquisition examples and cleanup

This commit is contained in:
2023-11-13 11:31:57 +01:00
parent 2b61757705
commit afde091b4e
17 changed files with 43027 additions and 163 deletions

View File

@ -0,0 +1,890 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "e03fa003-fac5-44f7-b42f-2b718f6b966a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b]0;⊚slic\u0007"
]
}
],
"source": [
"from slic.core.adjustable import Adjustable, PVAdjustable, DummyAdjustable\n",
"from slic.core.scanner import Scanner\n",
"\n",
"from slic.core.acquisition import BSAcquisition, PVAcquisition, SFAcquisition\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "cbd7faac-ff24-4e99-bb00-3536d868663f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-10-03 at 11:58:38 | INFO | Loading started.\n",
"**** The executable \"caRepeater\" couldn't be located\n",
"**** because of errno = \"No such file or directory\".\n",
"**** You may need to modify your PATH environment variable.\n",
"**** Unable to start \"CA Repeater\" process.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b]0;⊚slic\u0007"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-10-03 at 11:58:41 | WARNING | Cannot connect to stand server on saresc-vcons-02.psi.ch. Caught HTTPConnectionPool(host='saresc-vcons-02.psi.ch', port=9090): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa618d15640>: Failed to establish a new connection: [Errno 111] Connection refused')).\n",
"2023-10-03 at 11:58:41 | WARNING | No transmission value reported from {attenuator.ID}\n",
"2023-10-03 at 11:58:42 | INFO | Using undulator (Aramis) offset to PSSS energy of 0 eV.\n",
"2023-10-03 at 11:58:42 | INFO | Running at cristallina with pgroup p19150.\n",
"2023-10-03 at 11:58:42 | INFO | Loading finished.\n",
"CA client library is unable to contact CA repeater after 50 tries.\n",
"Silence this message by starting a CA repeater daemon\n",
"or by calling ca_pend_event() and or ca_poll() more often.\n"
]
}
],
"source": [
"# %run /sf/cristallina/applications/slic/cristallina/cristallina.py"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "1dae028f-116d-42ea-aead-298be9f01de3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dummy at: 0\n"
]
}
],
"source": [
"# setup dummy axis\n",
"dummy = DummyAdjustable()\n",
"print(f\"dummy at: {dummy.get_current_value()}\")\n",
"\n",
"# setup scanner\n",
"scanner = Scanner(data_base_dir=\"/tmp/scan_data\", scan_info_dir=\"/tmp/scan_info\")"
]
},
{
"cell_type": "markdown",
"id": "207bcb99-d34f-47c5-a417-4de42dfc253e",
"metadata": {},
"source": [
"# BS acquisition"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "7396532a-dd7b-4acf-8aa9-c12662405d00",
"metadata": {},
"outputs": [],
"source": [
"bs_example_channels = ['SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', \"SARFE10-PBIG050-EVR0:CALCI\", \"SARES30-CAMS156-XE:x_fit_amplitude\",] # \"SARES30-CAMS156-XE:FPICTURE\"]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "099cd6df-26d6-43e7-bf80-87eabc0a42b5",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Directory \"/tmp/scan_info\" does not exist, creating it...\n",
"Directory \"/tmp/scan_data/scan0000_test_bs\" does not exist, creating it...\n",
"\u001b[32mScan step 1 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 0.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n",
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0000.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 2 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 1.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0001.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 3 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 2.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0002.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 4 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 3.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0003.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 5 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 4.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0004.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 6 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 5.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0005.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 7 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 6.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0006.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 8 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 7.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0007.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 9 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 8.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0008.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 10 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 9.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0009.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 11 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 10.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n",
"[WARNING] bsread.data.helpers - 'type' channel field not found. Parse as 64-bit floating-point number float64 (default).\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data Header: {'htype': 'bsr_d-1.1', 'channels': [{'name': 'SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', 'encoding': '>'}, {'name': 'SARFE10-PBIG050-EVR0:CALCI', 'encoding': '>'}]}\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0000_test_bs/scan0000_test_bs_step0010.h5\n",
"Acquisition done\n",
"\u001b[32mAll scan steps done\n",
"\u001b[39m"
]
},
{
"data": {
"text/plain": [
"perform the following scan:\n",
"===========================\n",
"\n",
"A: DummyAdjustable \"Dummy\" at 10.0\n",
"\n",
" # A\n",
"-- ----\n",
" 0 0.0\n",
" 1 1.0\n",
" 2 2.0\n",
" 3 3.0\n",
" 4 4.0\n",
" 5 5.0\n",
" 6 6.0\n",
" 7 7.0\n",
" 8 8.0\n",
" 9 9.0\n",
"10 10.0\n",
"\n",
"record 10 pulses per step to \"scan0000_test_bs\" via:\n",
"----------------------------------------------------\n",
"- BSAcquisition: example_instrument/example_pgroup"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# setup acquisition \n",
"acq = BSAcquisition('example_instrument', 'example_pgroup', default_channels=bs_example_channels, default_data_base_dir='/tmp')\n",
"\n",
"scanner.scan1D(dummy, 0, 10, step_size=1, n_pulses=10, filename='test_bs', acquisitions=[acq], step_info=None, return_to_initial_values=False)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "8df87c3c-5870-4dc5-9990-3d57187b8f40",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from slic.core.scanner.scanbackend import is_only_sfdaq, is_sfdaq\n",
"is_sfdaq([acq])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "34bc4109-0de2-4a4f-9bb3-0f8ea03973d9",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "13bc2a3c-e3c1-4b14-8cec-d0d4f334987a",
"metadata": {},
"source": [
"is_sfdaq([acq])"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "5a455e3a-ae7a-4d3c-9e14-b42c24de8f36",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit unresponsive\"\n",
" Context: \"SARES30-CPPM-MOBI2.psi.ch:5064\"\n",
" Source File: ../tcpiiu.cpp line 926\n",
" Current Time: Tue Oct 03 2023 17:51:00.456204338\n",
"..................................................................\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit unresponsive\"\n",
" Context: \"SARES30-CPPM-MOBI1.psi.ch:5064\"\n",
" Source File: ../tcpiiu.cpp line 926\n",
" Current Time: Tue Oct 03 2023 17:54:13.473023696\n",
"..................................................................\n",
"Unexpected problem with CA circuit to server \"SARES30-CPPM-MOBI1.psi.ch:5064\" was \"Connection reset by peer\" - disconnecting\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"SARES30-CPPM-MOBI1.psi.ch:5064\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Tue Oct 03 2023 17:54:42.135508142\n",
"..................................................................\n",
"Unexpected problem with CA circuit to server \"SARES30-CPPM-MOBI2.psi.ch:5064\" was \"No route to host\" - disconnecting\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"SARES30-CPPM-MOBI2.psi.ch:5064\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Tue Oct 03 2023 18:06:26.581725132\n",
"..................................................................\n"
]
}
],
"source": [
"is_sfdaq([acq])"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "e2c866cd-4051-4a1c-b4c8-a4372e14a180",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Directory \"/tmp/scan_data/scan0008_test_pv\" does not exist, creating it...\n",
"\u001b[32mScan step 1 of 11\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 0.0\n",
"Moved adjustables, starting acquisition\n",
"No channels specified, using default channel list.\n",
"Stopping because of: TaskError: Exception in Task\n",
"caused by ConnectionError: connection to the following PVs timed out (1 sec): SARES30-MOBI1:MOT_1.RBV, SARES30-MOBI1:MOT_2.RBV, SARES30-MOBI1:MOT_3.RBV, SARES30-MOBI1:MOT_5.RBV, SARFE10-PBPS053:MOTOR_X2, SAROP31-OPPI151:MOTOR_X.RBV, SAROP31-OPPI151:MOTOR_Y.RBV\n",
"Stopping caused: TaskError: Exception in Task\n",
"caused by ConnectionError: connection to the following PVs timed out (1 sec): SARES30-MOBI1:MOT_1.RBV, SARES30-MOBI1:MOT_2.RBV, SARES30-MOBI1:MOT_3.RBV, SARES30-MOBI1:MOT_5.RBV, SARFE10-PBPS053:MOTOR_X2, SAROP31-OPPI151:MOTOR_X.RBV, SAROP31-OPPI151:MOTOR_Y.RBV\n",
"Stopped current DAQ tasks:\n",
"\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /tmp/scan_data/scan0008_test_pv/scan0008_test_pv_step0000.h5\n",
"\n"
]
},
{
"data": {
"text/plain": [
"perform the following scan:\n",
"===========================\n",
"\n",
"A: DummyAdjustable \"Dummy\" at 0.0\n",
"\n",
" # A\n",
"-- ----\n",
" 0 0.0\n",
" 1 1.0\n",
" 2 2.0\n",
" 3 3.0\n",
" 4 4.0\n",
" 5 5.0\n",
" 6 6.0\n",
" 7 7.0\n",
" 8 8.0\n",
" 9 9.0\n",
"10 10.0\n",
"\n",
"record 10 pulses per step to \"scan0008_test_pv\" via:\n",
"----------------------------------------------------\n",
"- PVAcquisition: cristallina/p19150"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"scanner.scan1D(dummy, 0, 10, step_size=1, n_pulses=10, filename='test_pv', acquisitions=[acq], step_info=None, return_to_initial_values=False)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e35014f0-3e5d-49fb-bf7b-e8ffad4c92f2",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 8,
"id": "d5816898-f66e-4504-90cb-8d0e54ba3c23",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'pvs' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[8], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m acq \u001b[38;5;241m=\u001b[39m PVAcquisition(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexample_instrument\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexample_pgroup\u001b[39m\u001b[38;5;124m'\u001b[39m, default_channels\u001b[38;5;241m=\u001b[39m\u001b[43mpvs\u001b[49m, default_data_base_dir\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/tmp\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
"\u001b[0;31mNameError\u001b[0m: name 'pvs' is not defined"
]
}
],
"source": [
"acq = PVAcquisition('example_instrument', 'example_pgroup', default_channels=pvs, default_data_base_dir='/tmp')"
]
},
{
"cell_type": "markdown",
"id": "e16c139f-3422-41fc-8557-5cbe39115535",
"metadata": {},
"source": [
"# SFAcquisition example\n",
"\n",
"This requires an existing `pgroup`. The `default_data_base_dir` cannot be used to specify arbitrary directories as a target, instead the data is located in `/sf/<instrument>/data/<pgroup>/raw/run<XXXX>/data/acq<YYYY>.*.h5`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3e374115-4807-47cf-8a3e-034462011493",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
"id": "3d465878-2118-4dea-a24a-219ff4252d88",
"metadata": {},
"outputs": [],
"source": [
"# TODO: requires the stand client, need small howto how to start and configure or let it run all the time\n",
"from slic.core.acquisition.spreadsheet import Spreadsheet\n",
"\n",
"import os\n",
"os.chdir(\"/sf/cristallina/applications/slic/cristallina\")\n",
"# %run /sf/cristallina/applications/slic/cristallina/cristallina.py\n",
"from devices.diffractometer import diffractometer\n"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "c4f812f4-b6fa-463f-a367-121e139b972b",
"metadata": {},
"outputs": [],
"source": [
"spreadsheet = Spreadsheet({\"TD\": diffractometer.td},\n",
" placeholders=('comment', 'sample'),\n",
" host='saresc-vcons-02.psi.ch',\n",
" port=9090,)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "2c6852f5-9aa5-4d4b-8c1c-7558720f3e2e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Motor \"SARES30-CPCL-ECMC02:TD\" at 115.00409000000013 mm"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"diffractometer.td"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "026350d2-a6bf-4b02-abcc-f560b22bbdfb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
" a b c\n",
"0 2 3 4"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"spreadsheet.client.add_row(a=2, b=3, c=4)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "2dddb44b-689f-4cdb-858f-103610bef3c6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Advanced run number to 192 for SF DAQ on http://sf-daq:10002 (status: idle, last run: 192).\n",
" a b c run filename n_pulses comment sample scanned_adjs v_min v_max n_steps TD\n",
"0 2.0 3.0 4.0 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN\n",
"1 NaN NaN NaN 192.0 test_bs 10.0 Dummy 0.0 2.0 3.0 115.004265\n",
"\u001b[32mScan step 1 of 3\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 0.0\n",
"Moved adjustables, starting acquisition\n",
"Continuing run number 192.\n",
"No detectors specified, using default detector list.\n",
"No PVs specified, using default PV list.\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 49.7 Hz]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"run number: 192\n",
"acq number: 1\n",
"total acq number: 687\n",
"\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0001.BSDATA.h5\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0001.CAMERAS.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 2 of 3\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 1.0\n",
"Moved adjustables, starting acquisition\n",
"Continuing run number 192.\n",
"No detectors specified, using default detector list.\n",
"No PVs specified, using default PV list.\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 49.7 Hz]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"run number: 192\n",
"acq number: 2\n",
"total acq number: 688\n",
"\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0002.BSDATA.h5\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0002.CAMERAS.h5\n",
"Acquisition done\n",
"\u001b[32mScan step 3 of 3\n",
"\u001b[39mDummyAdjustable \"Dummy\" at 2.0\n",
"Moved adjustables, starting acquisition\n",
"Continuing run number 192.\n",
"No detectors specified, using default detector list.\n",
"No PVs specified, using default PV list.\n",
"No channels specified, using default channel list.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 49.7 Hz]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"run number: 192\n",
"acq number: 3\n",
"total acq number: 689\n",
"\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0003.BSDATA.h5\n",
"- /sf/cristallina/data/p19150/raw/run0192/data/acq0003.CAMERAS.h5\n",
"Acquisition done\n",
"\u001b[32mAll scan steps done\n",
"\u001b[39m"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
},
{
"data": {
"text/plain": [
"perform the following scan:\n",
"===========================\n",
"\n",
"A: DummyAdjustable \"Dummy\" at 2.0\n",
"\n",
"# A\n",
"- ---\n",
"0 0.0\n",
"1 1.0\n",
"2 2.0\n",
"\n",
"record 10 pulses per step to \"test_bs\" via:\n",
"-------------------------------------------\n",
"- SF DAQ on http://sf-daq:10002 (status: idle, last run: 192)"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# setup acquisition \n",
"\n",
"bs_example_channels = ['SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-AVG', \"SARFE10-PBIG050-EVR0:CALCI\", \"SARES30-CAMS156-XE:x_fit_amplitude\", \"SARES30-CAMS156-XE:FPICTURE\"]\n",
"\n",
"# this requires an existing pgroup\n",
"acq = SFAcquisition('example_instrument', 'p19150', default_channels=bs_example_channels, default_data_base_dir='/tmp', spreadsheet=spreadsheet)\n",
"scanner.scan1D(dummy, 0, 2, step_size=1, n_pulses=10, filename='test_bs', acquisitions=[acq], step_info=None, return_to_initial_values=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d5c65482-4b5e-4baa-943f-e35cf384b67c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:conda-slic]",
"language": "python",
"name": "conda-env-conda-slic-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"id": "bc11382b-bbae-4541-b117-58cc4cafd737",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Playing WAVE '/tmp/ImperialMarch60.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono\n"
]
}
],
"source": [
"import subprocess\n",
"res = subprocess.run([\"aplay\", \"/tmp/ImperialMarch60.wav\"])\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "baf1c729-d9e3-484a-bf51-b9eaa5e6f3ff",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Playing WAVE '/tmp/ImperialMarch60.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono\n"
]
}
],
"source": [
"proc = subprocess.Popen([\"aplay /tmp/ImperialMarch60.wav\"], shell=True,\n",
" stdin=None, stdout=None, stderr=None, close_fds=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "436cfe45-c941-45fa-82af-ad1a8b819eb3",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:conda-slic]",
"language": "python",
"name": "conda-env-conda-slic-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

248
acquisition/Untitled1.ipynb Normal file
View File

@ -0,0 +1,248 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "e0a0b5eb-b6bd-4fb7-abe9-8c61318260f7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b]0;⊚slic\u0007"
]
}
],
"source": [
"from slic.core.adjustable import Adjustable, PVAdjustable, DummyAdjustable\n",
"from slic.core.scanner import Scanner\n",
"from slic.core.acquisition import BSAcquisition, PVAcquisition, SFAcquisition\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "8f30e2a0-c4d7-4bdd-a0b5-48662d807568",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-10-29 at 21:54:56 | INFO | Loading started.\n",
"2023-10-29 at 21:54:57 | INFO | Connected to stand server\n",
"2023-10-29 at 21:54:58 | INFO | Using undulator (Aramis) offset to PSSS energy of -62 eV.\n",
"2023-10-29 at 21:54:58 | INFO | Running at cristallina with pgroup p21563.\n",
"2023-10-29 at 21:54:58 | INFO | Loading finished.\n"
]
}
],
"source": [
"%run /sf/cristallina/applications/slic/cristallina/cristallina.py\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "85a7d2d3-794a-49e1-9dec-2c85ebad7730",
"metadata": {},
"outputs": [],
"source": [
"# Run the scan only when gas monitor value larger than 10uJ (and smaller than 2000uJ):\n",
"# required fraction defines ammount of data recorded to save the step and move on to the next one\n",
"check_intensity_gas_monitor = PVCondition(\n",
" \"SARFE10-PBPG050:PHOTON-ENERGY-PER-PULSE-US\",\n",
" vmin=75,\n",
" vmax=2000,\n",
" wait_time=0.5,\n",
" required_fraction=0.8,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "a627e0fb-ecf2-4e14-8c8e-e470c9558059",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"check_intensity_gas_monitor.check()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "a0e05c2f-2b76-4a8f-8394-b04bb4d6b2f5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"8285.310467258269"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"undulators.get()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "2175e207-6df8-434c-8d00-985f1149dc27",
"metadata": {},
"outputs": [],
"source": [
"from slic.utils import typename, nice_linspace, nice_arange"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "18767387-ae51-4d1f-a4a1-1e0015016324",
"metadata": {},
"outputs": [],
"source": [
"center = 11.779\n",
"delta = 0.1\n",
"\n",
"#scan.scan1D(\n",
"# diffractometer.theta,\n",
"# center-delta,\n",
"# center+delta,\n",
"# step_size=0.025,"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "6d22b87f-2063-4cb7-bef0-55a4263d4890",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([11.679, 11.704, 11.729, 11.754, 11.779, 11.804, 11.829, 11.854,\n",
" 11.879, 11.904])"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"SAR-CPPM-EXPMX1.psi.ch:5064\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Wed Nov 01 2023 15:13:05.052862079\n",
"..................................................................\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit unresponsive\"\n",
" Context: \"SAR-CPPM-EXPMX1.psi.ch:5064\"\n",
" Source File: ../tcpiiu.cpp line 926\n",
" Current Time: Fri Nov 03 2023 09:09:46.672425316\n",
"..................................................................\n",
"Unexpected problem with CA circuit to server \"SAR-CPPM-EXPMX1.psi.ch:5064\" was \"No route to host\" - disconnecting\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"SAR-CPPM-EXPMX1.psi.ch:5064\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Fri Nov 03 2023 09:25:12.648406223\n",
"..................................................................\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"sf-saresc-cagw-01.psi.ch:5062\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Sun Nov 05 2023 12:20:46.598231213\n",
"..................................................................\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"sf-saresc-cagw-01.psi.ch:5062\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Sun Nov 05 2023 12:22:30.890766667\n",
"..................................................................\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit unresponsive\"\n",
" Context: \"SARES30-CPPM-MOBI1.psi.ch:5064\"\n",
" Source File: ../tcpiiu.cpp line 926\n",
" Current Time: Mon Nov 06 2023 11:43:52.744259068\n",
"..................................................................\n",
"Unexpected problem with CA circuit to server \"SARES30-CPPM-MOBI1.psi.ch:5064\" was \"Connection reset by peer\" - disconnecting\n",
"CA.Client.Exception...............................................\n",
" Warning: \"Virtual circuit disconnect\"\n",
" Context: \"SARES30-CPPM-MOBI1.psi.ch:5064\"\n",
" Source File: ../cac.cpp line 1237\n",
" Current Time: Mon Nov 06 2023 11:44:07.434289668\n",
"..................................................................\n"
]
}
],
"source": [
"positions = nice_arange(center-delta, center+delta+0.025, 0.025)\n",
"positions\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "d995a8be-f9e7-46c5-add4-7b8717f14c9b",
"metadata": {},
"outputs": [],
"source": [
"positions = [11.779, 11.679, 11.704, 11.729, 11.754, 11.804, 11.829, 11.854,\n",
" 11.879]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ccb7f011-65d2-41e9-9c83-0d1e8ab3a9d8",
"metadata": {},
"outputs": [],
"source": [
"scan.ascan_list("
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:conda-slic]",
"language": "python",
"name": "conda-env-conda-slic-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -0,0 +1,10 @@
""" Multiple DAQs with different rates"""
from slic.core.acquisition import SFAcquisition
rates = {'100Hz': 1, '50Hz': 2, '25Hz': 4, '10Hz': 10, '5Hz': 20, '1Hz': 100}
def generate_DAQS(instrument, pgroup,bs_channels, pvs, detectors):
DAQS = {name:SFAcquisition(instrument, pgroup, default_channels=bs_channels, default_pvs=pvs, default_detectors=detectors, rate_multiplicator=r) for (name, r) in rates.items()}
return DAQS

View File

@ -0,0 +1,128 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "d1bead0c-2489-4672-ab51-5e75974dd4ab",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'attenuator' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mattenuator\u001b[49m\u001b[38;5;241m.\u001b[39mfoils\n",
"\u001b[0;31mNameError\u001b[0m: name 'attenuator' is not defined"
]
}
],
"source": [
"attenuator.foils\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b2a73dd0-1136-44b7-b625-e5fdcd8ec8dc",
"metadata": {},
"outputs": [],
"source": [
"attenuator.foils.pv_names.get()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b1e94427-0f7d-4dd9-b61a-3d65135445ff",
"metadata": {},
"outputs": [],
"source": [
"attenuator.foils.pv_index.get()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "66d002ac-1625-4b0d-91c5-f7daa1bd941b",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'attenuator' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mattenuator\u001b[49m\u001b[38;5;241m.\u001b[39mfoils\u001b[38;5;241m.\u001b[39mpv_index\u001b[38;5;241m.\u001b[39mget()\n",
"\u001b[0;31mNameError\u001b[0m: name 'attenuator' is not defined"
]
}
],
"source": [
"attenuator.foils.pv_index.get()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "b0f5509a-944a-4a2e-a6d1-56785beb359a",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'attenuator' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[3], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mattenuator\u001b[49m\u001b[38;5;241m.\u001b[39mfoils\u001b[38;5;241m.\u001b[39mpv_index\u001b[38;5;241m.\u001b[39mget()\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m# 0 := None\u001b[39;00m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# 1 := 2\u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# 2 := 3\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# 3 := 4\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# 4 := 5\u001b[39;00m\n",
"\u001b[0;31mNameError\u001b[0m: name 'attenuator' is not defined"
]
}
],
"source": [
"attenuator.foils.pv_index.get()\n",
"\n",
"# 0 := None\n",
"# 1 := 2\n",
"# 2 := 3\n",
"# 3 := 4\n",
"# 4 := 5\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "aa5aee6a-5b3f-4693-8b52-7e142872449b",
"metadata": {},
"outputs": [],
"source": [
"attenuator.foils.pv_names"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:conda-analysis_edge] *",
"language": "python",
"name": "conda-env-conda-analysis_edge-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@ -19,7 +19,9 @@ N_UNDS = list(range(3, 15 + 1))
# energy_offset = 20.37839
# Cristallina without calibration
energy_offset = 0
# offset is the difference between PSSS and undulator setpoint
# sign convention: Undulator - PSSS
energy_offset = -62 # eV
# move the PSSS motor according to the energy

View File

@ -29,13 +29,14 @@ detectors = [
detectors_with_config = DetectorConfig(detectors)
detectors_with_config["JF16T03V01"]['save_dap_results'] = True
detectors_with_config["JF16T03V01"]['disabled_modules'] = [0, 1] # bottom module:0, middle module:1, top module:2
detectors_with_config["JF16T03V01"]['remove_raw_files'] = True
# detectors_with_config["JF16T03V01"]['disabled_modules'] = [0, 1] # bottom module:0, middle module:1, top module:2
camera_channels = [
# "SARES30-CAMS156-PCO1:FPICTURE", # PCO edge camera for the wavefront analysis (from Alvra)
# "SARES30-CAMS156-SMX-OAV:FPICTURE", # SwissMX OAV camera picture
"SARES30-CAMS156-XE:FPICTURE", # X-ray eye
# "SARES30-CAMS156-XE:FPICTURE", # X-ray eye
]
####################
@ -142,7 +143,7 @@ channels_PSSS059 = [
"SARFE10-PSSS059:SPECTRUM_Y_SUM",
"SARFE10-PSSS059:SPECTRUM_X",
"SARFE10-PSSS059:SPECTRUM_Y",
# "SARFE10-PSSS059:FPICTURE",
#"SARFE10-PSSS059:FPICTURE",
"SARFE10-PSSS059:processing_parameters",
]
@ -280,7 +281,7 @@ bs_channels = (
camera_channels
+ channels_gas_monitor
# + channels_RF
# + channels_Xeye
+ channels_Xeye
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113

View File

@ -264,10 +264,10 @@ pvs_OLAS147 = [
###################
# Slits OAPU149
pvs_OAPU149 = [
"SAROP31-OAPU149:MOTOR_X.VAL",
"SAROP31-OAPU149:MOTOR_X.RBV",
"SAROP31-OAPU149:MOTOR_Y.VAL",
"SAROP31-OAPU149:MOTOR_Y.RBV",
"SAROP31-OAPU149:MOTOR_W.RBV",
"SAROP31-OAPU149:MOTOR_H.RBV",
]
###################
@ -408,6 +408,16 @@ pvs_smaract_juraj = [
"SARES30-XSMA156:Rz:MOTRBV",
]
pvs_diffractometer_1 = [
"SARES30-CPCL-ECMC02:ROT2THETA-PosAct",
"SARES30-CPCL-ECMC02:ROTTHETA-PosAct",
"SARES30-CPCL-ECMC02:TRXBASE-PosAct",
"SARES30-CPCL-ECMC02:TRY-PosAct",
"SARES30-CPCL-ECMC02:TRX-PosAct",
"SARES30-CPCL-ECMC02:TRZ-PosAct",
"SARES30-CPCL-ECMC02:TD-PosAct",
]
pvs = (
pvs_machine
# + pvs_RF
@ -438,6 +448,7 @@ pvs = (
+ pvs_standa
+ pvs_newport_300
+ pvs_smaract_xyz
+ pvs_diffractometer_1
# + pvs_Bernina
)

View File

@ -208,7 +208,8 @@ instrument = "cristallina"
# pgroup = "p21261" # CrQ PMS-3 July 2023
# pgroup = "p21528" # Cr-MX Colletier 2023-09-05
pgroup = "p21516" # Beamline commissioning September 26-27, 2023
pgroup = "p21516" # Beamline commissioning September 26-27, Noveber 7 2023
# pgroup = "p21563" # Dil-Sc / diffractometer / tilted bunch / LiErF4 (/ TmVO4)
# setup pgroup specific logger
setup_logging_pgroup(pgroup)
@ -226,15 +227,9 @@ daq = SFAcquisition(
# There is a new EPICS buffer, so the archiver is no longer used. This makes sure we are taking PVs from the right place.
daq.update_config_pvs()
slow_daq_test = SFAcquisition(
instrument,
"p19150",
default_channels=bs_channels,
default_pvs=pvs,
default_detectors=detectors,
rate_multiplicator=100,
)
from acquisition import multiple_daqs
DAQS = multiple_daqs.generate_DAQS(instrument, pgroup,bs_channels, pvs, detectors)
# daq = FakeAcquisition(instrument, pgroup)
# daqPV = PVAcquisition(instrument, pgroup, default_channels=channels_ks) # workaround for KS not going to DB

38
devices/diffractometer.py Normal file
View File

@ -0,0 +1,38 @@
""" Diffractometer
motorized axis:
SARES30-CPCL-ECMC02:ROT2THETA
SARES30-CPCL-ECMC02:ROTTHETA
SARES30-CPCL-ECMC02:TRXBASE
SARES30-CPCL-ECMC02:TRYBASE
"""
from slic.core.adjustable import Adjustable
from slic.core.device import Device, SimpleDevice
from slic.devices.general.motor import Motor
class Diffractometer(Device):
def __init__(self, ID, motor_naming="MOTOR", **kwargs):
super().__init__(ID, **kwargs)
self.twotheta = Motor("SARES30-CPCL-ECMC02:ROT2THETA") # , ID=None, name=None, units=None, internal=False):
self.theta = Motor("SARES30-CPCL-ECMC02:ROTTHETA") # , ID=None, name=None, units=None, internal=False):
self.trx_base = Motor("SARES30-CPCL-ECMC02:TRXBASE") # , ID=None, name=None, units=None, internal=False):
self.try_base = Motor("SARES30-CPCL-ECMC02:TRYBASE") # , ID=None, name=None, units=None, internal=False):
self.tr_x = Motor("SARES30-CPCL-ECMC02:TRX")
self.tr_y = Motor("SARES30-CPCL-ECMC02:TRY")
self.td = Motor("SARES30-CPCL-ECMC02:TD")
diffractometer = Diffractometer("diffractometer")
# Set speed:
# diffractometer.theta._motor.VELO = 0.25

View File

@ -1,15 +1,28 @@
# Channels to save at Cristallina endstation
# Channels to save at Cristallina endstation, Bill's temporary implementations
##########################################################################################################
##########################################################################################################
##########################################################################################################
# BS channels
# JF configurations
from slic.core.acquisition.detcfg import DetectorConfig
# TODO: JF settings regarding raw conversion, compression, etc.
detectors = [
"JF16T03V01",
]
ROIs = {'direct_beam': [200,400,500,600]}
detectors_with_config_ROI_only = DetectorConfig(detectors)
detectors_with_config_ROI_only["JF16T03V01"]['save_dap_results'] = False
detectors_with_config_ROI_only["JF16T03V01"]['disabled_modules'] = [0, 1] # bottom module:0, middle module:1, top module:2
detectors_with_config_ROI_only["JF16T03V01"]['roi'] = ROIs
#detectors_with_config_ROI_only["JF16T03V01"]['remove_raw_files'] = True
##########################################################################################################
##########################################################################################################
##########################################################################################################
# BS channels, updated 05.11.2023 from official channel list and adapted
camera_channels = [
# "SARES30-CAMS156-PCO1:FPICTURE", # PCO edge camera for the wavefront analysis (from Alvra)
# "SARES30-CAMS156-SMX-OAV:FPICTURE", # SwissMX OAV camera picture
@ -25,6 +38,7 @@ channels_gas_monitor = [
"SARFE10-PBIG050-EVR0:CALCI", # good for correlations with total beam intensity
"SARFE10-PBPG050:HAMP-INTENSITY-CAL",
]
# RF phases and amplitudes
channels_RF = [
"SINSB01-RLLE-DSP:PHASE-VS",
@ -96,7 +110,26 @@ channels_RF = [
"S30CB14-RLLE-DSP:AMPLT-VS",
]
channels_Xeye = ["SARES30-CAMS156-XE:intensity"]
channels_Xeye = [
"SARES30-CAMS156-XE:intensity",
# "SARES30-CAMS156-XE:x_center_of_mass",
"SARES30-CAMS156-XE:x_fit_amplitude",
"SARES30-CAMS156-XE:x_fit_mean",
"SARES30-CAMS156-XE:x_fit_offset",
"SARES30-CAMS156-XE:x_fit_standard_deviation",
# "SARES30-CAMS156-XE:x_fwhm",
"SARES30-CAMS156-XE:x_profile",
# "SARES30-CAMS156-XE:x_rms",
# "SARES30-CAMS156-XE:y_center_of_mass",
"SARES30-CAMS156-XE:y_fit_amplitude",
"SARES30-CAMS156-XE:y_fit_mean",
"SARES30-CAMS156-XE:y_fit_offset",
"SARES30-CAMS156-XE:y_fit_standard_deviation",
# "SARES30-CAMS156-XE:y_fwhm",
"SARES30-CAMS156-XE:y_profile",
# "SARES30-CAMS156-XE:y_rms",
"SARES30-CAMS156-XE:FPICTURE",
]
######################
# PBPS053
@ -119,12 +152,8 @@ channels_PSSS059 = [
"SARFE10-PSSS059:SPECTRUM_Y_SUM",
"SARFE10-PSSS059:SPECTRUM_X",
"SARFE10-PSSS059:SPECTRUM_Y",
# "SARFE10-PSSS059:FPICTURE",
# "SARFE10-PSSS059:FIT_ERR",
#"SARFE10-PSSS059:FPICTURE",
"SARFE10-PSSS059:processing_parameters",
# "SARFE10-PSSS059:SPECTRUM_AVG_CENTER",
# "SARFE10-PSSS059:SPECTRUM_AVG_FWHM",
# "SARFE10-PSSS059:SPECTRUM_AVG_Y",
]
###################################
@ -139,6 +168,7 @@ channels_Bernina = [
"SAROP21-PPRM113:x_fit_mean",
"SAROP21-PPRM113:y_fit_mean",
]
###################################
# Beam position monitor PBPS113
channels_PBPS113 = [
@ -170,6 +200,13 @@ channels_PBPS113_waveforms = [
"SAROP31-PBPS113:Lnk9Ch15-WF-DATA",
]
###################################
# Diode PDIM 113
channels_PDIM113 = [
"SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD4",
]
####################
# Profile monitor PPRM113 (from _proc process)
channels_PPRM113 = [
@ -234,12 +271,40 @@ channels_PPRM150 = [
# "SAROP31-PPRM150:FPICTURE", # full pictures for debugging purposes at the moment, from _ib process
]
###################################
# Diode of PSCD153
channels_PSCD153_diode = [
"SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD4",
]
#######################
# Cristallina event reciever
channels_EVR = [
"SAR-CVME-TIFALL6:EvtSet",
]
channels_Xeye = [
"SARES30-CAMS156-XE:intensity",
# "SARES30-CAMS156-XE:x_center_of_mass",
"SARES30-CAMS156-XE:x_fit_amplitude",
"SARES30-CAMS156-XE:x_fit_mean",
"SARES30-CAMS156-XE:x_fit_offset",
"SARES30-CAMS156-XE:x_fit_standard_deviation",
# "SARES30-CAMS156-XE:x_fwhm",
"SARES30-CAMS156-XE:x_profile",
# "SARES30-CAMS156-XE:x_rms",
# "SARES30-CAMS156-XE:y_center_of_mass",
"SARES30-CAMS156-XE:y_fit_amplitude",
"SARES30-CAMS156-XE:y_fit_mean",
"SARES30-CAMS156-XE:y_fit_offset",
"SARES30-CAMS156-XE:y_fit_standard_deviation",
# "SARES30-CAMS156-XE:y_fwhm",
"SARES30-CAMS156-XE:y_profile",
# "SARES30-CAMS156-XE:y_rms",
"SARES30-CAMS156-XE:FPICTURE",
]
#######################
# Digitizer
channels_digitizer = [
@ -254,6 +319,124 @@ channels_digitizer = [
]
##########################################################################################################
# Bernina channels
#######################
# Profile monitor PPRM113 (from _proc process)
channels_PPRM113_Bernina = [
"SAROP21-PPRM113:intensity",
# "SAROP21-PPRM113:x_center_of_mass",
# "SAROP21-PPRM113:x_fit_amplitude",
# "SAROP21-PPRM113:x_fit_mean",
# "SAROP21-PPRM113:x_fit_offset",
# "SAROP21-PPRM113:x_fit_standard_deviation",
# "SAROP21-PPRM113:x_fwhm",
# "SAROP21-PPRM113:x_profile",
# "SAROP21-PPRM113:x_rms",
# "SAROP21-PPRM113:y_center_of_mass",
# "SAROP21-PPRM113:y_fit_amplitude",
# "SAROP21-PPRM113:y_fit_mean",
# "SAROP21-PPRM113:y_fit_offset",
# "SAROP21-PPRM113:y_fit_standard_deviation",
# "SAROP21-PPRM113:y_fwhm",
# "SAROP21-PPRM113:y_profile",
# "SAROP21-PPRM113:y_rms",
# "SAROP21-PPRM113:FPICTURE", # full pictures for debugging purposes at the moment, from _ib process
]
###########################
# Beam position monitor Bernina
channels_PBPS103_Bernina = [
"SAROP21-PBPS103:INTENSITY",
"SAROP21-PBPS103:XPOS",
"SAROP21-PBPS103:YPOS",
]
##########################################################################################################
# special bs channel configurations
####################
bs_channels_OAPU107_scan = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
+ channels_PPRM150
)
bs_channels_OAPU149_scan = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
+ channels_PPRM150
)
bs_channels_pbps_snapshot = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
)
bs_channels_PBPS_tests = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
+ channels_Xeye
)
bs_channels_OATA_tests = (
channels_gas_monitor
+ channels_PBPS053
# + channels_PSSS059
# + channels_PBPS113
# + channels_PBPS149
+ channels_PSCD153_diode
)
bs_channels_OATA_tests_JF = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
)
bs_channels_PPRM150 = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PPRM150
)
bs_channels_jf_direct_beam = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
+ channels_EVR
)
bs_channels_DCM_Bernina = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PPRM113_Bernina
+ channels_PBPS103_Bernina
)
##########################################################################################################
##########################################################################################################
##########################################################################################################
@ -379,6 +562,27 @@ pvs_PBPS053 = [
"SARFE10-PBPS053:MOTOR_PROBE",
]
###################
# Spectrometer PSSS059
pvs_PSSS059 = [
"SARFE10-PSSS055:MOTOR_X1.RBV",
"SARFE10-PSSS055:MOTOR_Y1.RBV",
"SARFE10-PSSS055:MOTOR_ROT_X1.RBV",
"SARFE10-PSSS055:MOTOR_PROBE.RBV",
"SARFE10-PSSS059:MOTOR_X3.RBV",
"SARFE10-PSSS059:MOTOR_Y3.RBV",
"SARFE10-PSSS059:MOTOR_ROT_X3.RBV",
"SARFE10-PSSS059:MOTOR_Y4.RBV",
"SARFE10-PSSS059:MOTOR_ROT_X4.RBV",
"SARFE10-PSSS059:MOTOR_X5.RBV",
"SARFE10-PSSS059:MOTOR_Y5.RBV",
"SARFE10-PSSS059:MOTOR_Z5.RBV",
"SARFE10-PSSS055:GRATING_SP",
"SARFE10-PSSS059:CRYSTAL_SP",
"SARFE10-PSSS059:SPC_ROI_YMIN",
"SARFE10-PSSS059:SPC_ROI_YMAX",
]
####################
# Upstream attenuator OATT053
pvs_OATT053 = [
@ -405,42 +609,6 @@ pvs_PPRM053 = [
"SARFE10-PPRM053:MOTOR_PROBE.RBV",
]
###################
# Bernina mono
pvs_Bernina = [
"SAROP21-ARAMIS:ENERGY_SP",
"SAROP21-ARAMIS:ENERGY",
"SAROP21-PBPS103:MOTOR_X1.DRBV",
"SAROP21-PBPS103:MOTOR_Y1.DRBV",
"SAROP21-PBPS103:MOTOR_X1.RBV",
"SAROP21-PBPS103:MOTOR_Y1.RBV",
"SAROP21-PBPS103:MOTOR_PROBE.RBV",
"SAROP21-PPRM113:MOTOR_PROBE.RBV"
]
####################
# Single shot spectrometer PSS059
pvs_PSSS059 = [
"SARFE10-PSSS055:MOTOR_X1.RBV",
"SARFE10-PSSS055:MOTOR_Y1.RBV",
"SARFE10-PSSS055:MOTOR_ROT_X1.RBV",
"SARFE10-PSSS055:MOTOR_PROBE.RBV",
"SARFE10-PSSS059:MOTOR_X3.RBV",
"SARFE10-PSSS059:MOTOR_Y3.RBV",
"SARFE10-PSSS059:MOTOR_ROT_X3.RBV",
"SARFE10-PSSS059:MOTOR_Y4.RBV",
"SARFE10-PSSS059:MOTOR_ROT_X4.RBV",
"SARFE10-PSSS059:MOTOR_X5.RBV",
"SARFE10-PSSS059:MOTOR_Y5.RBV",
"SARFE10-PSSS059:MOTOR_Z5.RBV",
"SARFE10-PSSS055:GRATING_SP",
"SARFE10-PSSS059:CRYSTAL_SP",
"SARFE10-PSSS059:SPC_ROI_YMIN",
"SARFE10-PSSS059:SPC_ROI_YMAX",
]
####################
# First Cristallina horizontal offset mirror OOMH067
pvs_OOMH067 = [
@ -506,6 +674,12 @@ pvs_PBPS113 = [
"SAROP31-PBPS113:MOTOR_PROBE.RBV",
]
####################
# Diode PDIM113
pvs_PDIM113 = [
"SAROP31-PDIM113:MOTOR_PROBE.RBV"
]
###################
# Beam profile monitor PPRM113
pvs_PPRM113 = [
@ -521,10 +695,10 @@ pvs_OLAS147 = [
###################
# Slits OAPU149
pvs_OAPU149 = [
"SAROP31-OAPU149:MOTOR_X.VAL",
"SAROP31-OAPU149:MOTOR_X.RBV",
"SAROP31-OAPU149:MOTOR_Y.VAL",
"SAROP31-OAPU149:MOTOR_Y.RBV",
"SAROP31-OAPU149:MOTOR_W.RBV",
"SAROP31-OAPU149:MOTOR_H.RBV",
]
###################
@ -566,6 +740,7 @@ pvs_OPPI151 = [
"SAROP31-OPPI151:MOTOR_Y.RBV",
]
####################
## Horizontal offset mirror ODMV152
pvs_ODMV152 = [
@ -581,13 +756,6 @@ pvs_ODMV152 = [
"SAROP31-ODMV152:TX.RBV",
]
#######################
# from _proc process
pvs_PPRM150 = [
"SAROP31-PPRM150:MOTOR_PROBE.RBV",
]
###########################
# Vertical KB mirror OKBV153
pvs_OKBV153 = [
@ -607,7 +775,6 @@ pvs_OKBV153 = [
####################
# Screen between the KB's PSCD153
# Not implemented yet
pvs_PSCD153 = [
"SAROP31-PSCD153:MOTOR_PROBE.RBV"
]
@ -636,6 +803,13 @@ pvs_standa = [
"SARES30-MOBI1:MOT_3.RBV",
]
####################
# Newport 300 mm stage
pvs_newport_300 = [
"SARES30-MOBI1:MOT_5.RBV",
]
###############################
# Smaract stages mini XYZ from SwissMX
pvs_smaract_xyz = [
@ -665,7 +839,74 @@ pvs_smaract_juraj = [
"SARES30-XSMA156:Rz:MOTRBV",
]
pvs = (
pvs_diffractometer_1 = [
"SARES30-CPCL-ECMC02:ROT2THETA-PosAct",
"SARES30-CPCL-ECMC02:ROTTHETA-PosAct",
"SARES30-CPCL-ECMC02:TRXBASE-PosAct",
"SARES30-CPCL-ECMC02:TRY-PosAct",
"SARES30-CPCL-ECMC02:TRX-PosAct",
"SARES30-CPCL-ECMC02:TRZ-PosAct",
"SARES30-CPCL-ECMC02:TD-PosAct",
]
##########################################################################################################
# Bernina
###################
# Slits OAPU092
pvs_OAPU092 = [
"SAROP21-OAPU092:MOTOR_X.RBV",
"SAROP21-OAPU092:MOTOR_Y.RBV",
"SAROP21-OAPU092:MOTOR_W.RBV",
"SAROP21-OAPU092:MOTOR_H.RBV",
]
###################
# Bernina mono
pvs_ODCM098 = [
"SAROP21-ARAMIS:ENERGY_SP",
"SAROP21-ARAMIS:ENERGY",
"SAROP21-PBPS103:MOTOR_X1.DRBV",
"SAROP21-PBPS103:MOTOR_Y1.DRBV",
"SAROP21-PBPS103:MOTOR_X1.RBV",
"SAROP21-PBPS103:MOTOR_Y1.RBV",
"SAROP21-PBPS103:MOTOR_PROBE.RBV",
"SAROP21-PPRM113:MOTOR_PROBE.RBV"
]
###################
# Beam position and intensity monitor PBPS149
pvs_PBPS103 = [
"SAROP21-PBPS103:MOTOR_X1.DRBV",
"SAROP21-PBPS103:MOTOR_Y1.DRBV",
"SAROP21-PBPS103:MOTOR_X1.RBV",
"SAROP21-PBPS103:MOTOR_Y1.RBV",
"SAROP21-PBPS103:MOTOR_PROBE.RBV",
]
###################
# Slits OAPU102
pvs_OAPU102 = [
"SAROP21-OAPU102:MOTOR_X.RBV",
"SAROP21-OAPU102:MOTOR_Y.RBV",
"SAROP21-OAPU102:MOTOR_W.RBV",
"SAROP21-OAPU102:MOTOR_H.RBV",
]
####################
# Pulse picker OPPI113
pvs_OPPI113 = [
"SAROP21-OPPI113:MOTOR_X1.RBV",
"SAROP21-OPPI113:MOTOR_Y1.RBV",
]
##########################################################################################################
# special pvs configurations
####################
pvs_cristallina = (
pvs_machine
# + pvs_RF
# + pvs_undulator
@ -681,6 +922,7 @@ pvs = (
+ pvs_PPRM085
+ pvs_OAPU107
+ pvs_PBPS113
+ pvs_PDIM113
+ pvs_PPRM113
+ pvs_OLAS147
+ pvs_OAPU149
@ -702,66 +944,12 @@ pvs = (
# + pvs_smaract_juraj
##########################
#########################
####################
detectors_jf_direct_beam_012 = [
"JF16T03V01",
]
####################
bs_channels_OAPU107_scan = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS113
+ channels_PPRM150
)
bs_channels_OAPU149_scan = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS113
+ channels_PPRM150
)
bs_channels_pbps_snapshot = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
)
bs_channels_PPRM150 = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PPRM150
+ ["SAROP31-PPRM150:FPICTURE"]
)
bs_channels_jf_direct_beam = (
channels_gas_monitor
+ channels_PBPS053
+ channels_PSSS059
+ channels_PBPS113
+ channels_PBPS149
+ channels_EVR
)
####################
pvs_channels_PPRM150 = (
pvs_gas_monitor
pvs_bernina = (
pvs_machine
# + pvs_RF
# + pvs_undulator
+ pvs_gas_monitor
+ pvs_OAPU044
+ pvs_PBPS053
+ pvs_OATT053
@ -769,36 +957,13 @@ pvs_channels_PPRM150 = (
+ pvs_PSSS059
+ pvs_OOMH067
+ pvs_PSCR068
+ pvs_OOMH084
+ pvs_PPRM085
+ pvs_OAPU107
+ pvs_PBPS113
+ pvs_PPRM113
+ pvs_OLAS147
+ pvs_OAPU149
+ pvs_PBPS149
+ pvs_PPRM150
)
pvs_channels_jf_direct_beam = (
pvs_gas_monitor
+ pvs_OAPU044
+ pvs_PBPS053
+ pvs_OATT053
+ pvs_PPRM053
+ pvs_PSSS059
+ pvs_OOMH067
+ pvs_OOMH084
+ pvs_PPRM085
+ pvs_OAPU107
+ pvs_PBPS113
+ pvs_PPRM113
+ pvs_OAPU149
+ pvs_PBPS149
+ pvs_OATA150
+ pvs_OPPI151
+ pvs_ODMV152
+ pvs_OKBV153
+ pvs_PSCD153
+ pvs_OKBH154
+ pvs_OAPU092
# + pvs_OOMV092
# + pvs_PPRM094
# + pvs_PSCR097
+ pvs_ODCM098
+ pvs_OAPU102
+ pvs_PBPS103
+ pvs_OPPI113
# + pvs_PPRM113_Bernina
)

26
move_newport.py Normal file
View File

@ -0,0 +1,26 @@
# move Newport in steps
import time
import numpy as np
from cristallina import newport
print(newport)
# temporarily disable limits
newport.z.set_epics_limits(-300, 300)
# directions: minus is towards 25 pin connector
# newport.z.mv(-140).wait()
newport.z.reset_current_value_to(0)
# 305 mm travel
x_steps = np.arange(1, 310, 10)
for x in x_steps:
print(f"at: {x}")
newport.z.mv(x).wait()
time.sleep(3)