Files
cristallina/retrieve.ipynb

465 lines
30 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "8960fc34-a3b8-4f3a-85a4-22ea697ee38a",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "1a5fa748-9641-4c93-b0bf-9a2a3ac58745",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-05-22 at 08:16:27 | INFO | Loading started.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b]0;⊚slic\u0007could not set up DBusNotify: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-05-22 at 08:16:32 | INFO | Connected to stand server\n",
"2023-05-22 at 08:16:33 | INFO | Using undulator (Aramis) offset to PSSS energy of 13 eV.\n",
"2023-05-22 at 08:16:33 | INFO | Running at cristallina with pgroup p21147.\n",
"2023-05-22 at 08:16:33 | INFO | Loading finished.\n"
]
}
],
"source": [
"%run cristallina.py"
]
},
{
"cell_type": "markdown",
"id": "69ae9d05-4a12-40b0-b0a7-d5436eaf23ea",
"metadata": {},
"source": [
"We recorded at 1 Hz with the CTA and 6000 repetions."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "09065809-9077-46b1-8fea-a13c0a92e2a2",
"metadata": {},
"outputs": [],
"source": [
"shots = 6000 # repetitions from CTA"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "1713739a-6399-43fa-ad60-1ef2a0903d1a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">array</span><span style=\"font-weight: bold\">([</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">120000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">180000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">240000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">300000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">360000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">420000</span>., <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">480000</span>.,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">540000</span>.<span style=\"font-weight: bold\">])</span>\n",
"</pre>\n"
],
"text/plain": [
"\n",
"\u001b[1;35marray\u001b[0m\u001b[1m(\u001b[0m\u001b[1m[\u001b[0m\u001b[1;36m120000\u001b[0m., \u001b[1;36m180000\u001b[0m., \u001b[1;36m240000\u001b[0m., \u001b[1;36m300000\u001b[0m., \u001b[1;36m360000\u001b[0m., \u001b[1;36m420000\u001b[0m., \u001b[1;36m480000\u001b[0m.,\n",
" \u001b[1;36m540000\u001b[0m.\u001b[1m]\u001b[0m\u001b[1m)\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"pids = shots*100\n",
"\n",
"missing = np.arange(2,10)*pids/10\n",
"missing\n"
]
},
{
"cell_type": "markdown",
"id": "a15fc525-b909-43a1-a105-bf13272a3257",
"metadata": {},
"source": [
"Missing are the images from pids 12000 to 18000, 18000 to 24000 and so on. Already recorded are the first 60000.\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "0b0d72f1-9528-4077-89f1-1476b4b74411",
"metadata": {},
"outputs": [],
"source": [
"# with scratch pgroup:\n",
"\n",
"daq_test = SFAcquisition(\n",
" instrument,\n",
" \"p19150\",\n",
" default_channels=bs_channels,\n",
" default_pvs=pvs,\n",
" default_detectors=detectors,\n",
" rate_multiplicator=100,\n",
")\n",
"\n",
"slow_daq_test = SFAcquisition(\n",
" instrument,\n",
" \"p19150\",\n",
" default_channels=bs_channels,\n",
" default_pvs=pvs,\n",
" default_detectors=detectors,\n",
" rate_multiplicator=100,\n",
")\n",
"\n",
"slow_daq = SFAcquisition(\n",
" instrument,\n",
" pgroup,\n",
" default_channels=bs_channels,\n",
" default_pvs=pvs,\n",
" default_detectors=detectors,\n",
" rate_multiplicator=100,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d1db9525-bb0e-4c32-8aa5-752091928bbd",
"metadata": {},
"outputs": [],
"source": [
"pgroup = \"p21147\" # SAXS\n",
"\n",
"if False:\n",
" res = daq.retrieve(\n",
" \"CTA_pulses\",\n",
" np.arange(CTA_sequence_start_PID, CTA_sequence_start_PID + n_pulses * 10),\n",
" run_number=run_number,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "77d93f9d-2a11-4059-966f-4640f1ea86b0",
"metadata": {},
"outputs": [
{
"ename": "BrokerError",
"evalue": "An error happened on the server:\nUnknown error",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mBrokerError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[11], line 5\u001b[0m\n\u001b[1;32m 1\u001b[0m CTA_sequence_start_PID \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m18111678900\u001b[39m\n\u001b[1;32m 3\u001b[0m length \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m200\u001b[39m\n\u001b[0;32m----> 5\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mslow_daq_test\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mCTA_pulses\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[43m \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marange\u001b[49m\u001b[43m(\u001b[49m\u001b[43mCTA_sequence_start_PID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mCTA_sequence_start_PID\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mlength\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[43m \u001b[49m\u001b[43mrun_number\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 9\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/sfacquisition.py:125\u001b[0m, in \u001b[0;36mSFAcquisition.retrieve\u001b[0;34m(self, filename, pulseids, run_number)\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m is_continuous(pulseids):\n\u001b[1;32m 123\u001b[0m params[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mselected_pulse_ids\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m pulseids\n\u001b[0;32m--> 125\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maddress\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 127\u001b[0m res_run_number \u001b[38;5;241m=\u001b[39m res[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 128\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m res_run_number \u001b[38;5;241m==\u001b[39m run_number, \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mreceived \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mres_run_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m and expected \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrun_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m run numbers not identical\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:251\u001b[0m, in \u001b[0;36mretrieve\u001b[0;34m(address, *args, **kwargs)\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mretrieve\u001b[39m(address, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 250\u001b[0m requrl \u001b[38;5;241m=\u001b[39m address\u001b[38;5;241m.\u001b[39mrstrip(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/retrieve_from_buffers\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 251\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[43mpost_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequrl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 252\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(\n\u001b[1;32m 253\u001b[0m run_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 254\u001b[0m acq_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124macquisition_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 255\u001b[0m total_acq_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munique_acquisition_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 256\u001b[0m filenames \u001b[38;5;241m=\u001b[39m response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfiles\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 257\u001b[0m )\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m res\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:275\u001b[0m, in \u001b[0;36mpost_request\u001b[0;34m(requrl, params, timeout)\u001b[0m\n\u001b[1;32m 273\u001b[0m params \u001b[38;5;241m=\u001b[39m json_validate(params)\n\u001b[1;32m 274\u001b[0m response \u001b[38;5;241m=\u001b[39m requests\u001b[38;5;241m.\u001b[39mpost(requrl, json\u001b[38;5;241m=\u001b[39mparams, timeout\u001b[38;5;241m=\u001b[39mtimeout)\u001b[38;5;241m.\u001b[39mjson()\n\u001b[0;32m--> 275\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mvalidate_response\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:289\u001b[0m, in \u001b[0;36mvalidate_response\u001b[0;34m(resp)\u001b[0m\n\u001b[1;32m 287\u001b[0m message \u001b[38;5;241m=\u001b[39m resp\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmessage\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUnknown error\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 288\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAn error happened on the server:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(message)\n\u001b[0;32m--> 289\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m BrokerError(msg)\n",
"\u001b[0;31mBrokerError\u001b[0m: An error happened on the server:\nUnknown error"
]
}
],
"source": [
"CTA_sequence_start_PID = 18111678900\n",
"\n",
"length = 200\n",
"\n",
"res = slow_daq_test.retrieve(\n",
" \"CTA_pulses\",\n",
" np.arange(CTA_sequence_start_PID, CTA_sequence_start_PID + length),\n",
" run_number=None,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "0733b5e8-b7f0-4693-b772-670ee62d6e35",
"metadata": {},
"outputs": [
{
"ename": "BrokerError",
"evalue": "An error happened on the server:\nUnknown error",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mBrokerError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[11], line 6\u001b[0m\n\u001b[1;32m 2\u001b[0m CTA_sequence_start_PID \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m18111618800\u001b[39m\n\u001b[1;32m 4\u001b[0m length \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1000\u001b[39m\n\u001b[0;32m----> 6\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mslow_daq\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mCTA_pulses\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 8\u001b[0m \u001b[43m \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marange\u001b[49m\u001b[43m(\u001b[49m\u001b[43mCTA_sequence_start_PID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mCTA_sequence_start_PID\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mlength\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 9\u001b[0m \u001b[43m \u001b[49m\u001b[43mrun_number\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1120\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 10\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/sfacquisition.py:125\u001b[0m, in \u001b[0;36mSFAcquisition.retrieve\u001b[0;34m(self, filename, pulseids, run_number)\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m is_continuous(pulseids):\n\u001b[1;32m 123\u001b[0m params[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mselected_pulse_ids\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m pulseids\n\u001b[0;32m--> 125\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[43mretrieve\u001b[49m\u001b[43m(\u001b[49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43maddress\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 127\u001b[0m res_run_number \u001b[38;5;241m=\u001b[39m res[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 128\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m res_run_number \u001b[38;5;241m==\u001b[39m run_number, \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mreceived \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mres_run_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m and expected \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mrun_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m run numbers not identical\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:251\u001b[0m, in \u001b[0;36mretrieve\u001b[0;34m(address, *args, **kwargs)\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mretrieve\u001b[39m(address, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 250\u001b[0m requrl \u001b[38;5;241m=\u001b[39m address\u001b[38;5;241m.\u001b[39mrstrip(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/retrieve_from_buffers\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 251\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[43mpost_request\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequrl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 252\u001b[0m res \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mdict\u001b[39m(\n\u001b[1;32m 253\u001b[0m run_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 254\u001b[0m acq_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124macquisition_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 255\u001b[0m total_acq_number \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124munique_acquisition_number\u001b[39m\u001b[38;5;124m\"\u001b[39m]),\n\u001b[1;32m 256\u001b[0m filenames \u001b[38;5;241m=\u001b[39m response[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfiles\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 257\u001b[0m )\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m res\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:275\u001b[0m, in \u001b[0;36mpost_request\u001b[0;34m(requrl, params, timeout)\u001b[0m\n\u001b[1;32m 273\u001b[0m params \u001b[38;5;241m=\u001b[39m json_validate(params)\n\u001b[1;32m 274\u001b[0m response \u001b[38;5;241m=\u001b[39m requests\u001b[38;5;241m.\u001b[39mpost(requrl, json\u001b[38;5;241m=\u001b[39mparams, timeout\u001b[38;5;241m=\u001b[39mtimeout)\u001b[38;5;241m.\u001b[39mjson()\n\u001b[0;32m--> 275\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mvalidate_response\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/gfa/.mounts/sf_cristallina/applications/slic/slic-package/slic/core/acquisition/broker_client.py:289\u001b[0m, in \u001b[0;36mvalidate_response\u001b[0;34m(resp)\u001b[0m\n\u001b[1;32m 287\u001b[0m message \u001b[38;5;241m=\u001b[39m resp\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmessage\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUnknown error\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 288\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAn error happened on the server:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(message)\n\u001b[0;32m--> 289\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m BrokerError(msg)\n",
"\u001b[0;31mBrokerError\u001b[0m: An error happened on the server:\nUnknown error"
]
}
],
"source": [
"CTA_sequence_start_PID = 18111678900\n",
"CTA_sequence_start_PID = 18111618800\n",
"\n",
"length = 1000\n",
"\n",
"res = slow_daq.retrieve(\n",
" \"CTA_pulses\",\n",
" np.arange(CTA_sequence_start_PID, CTA_sequence_start_PID + length),\n",
" run_number=1120,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "a0b1dece-021b-4bf5-9031-3db06c56b8fb",
"metadata": {},
"outputs": [],
"source": [
"#CTA_sequence_start_PID = 18111678900\n",
"CTA_sequence_start_PID = 18111618800\n",
"CTA_sequence_start_PID = 18116377800\n",
"\n",
"CTA_sequence_start_PID = 18114660400 # works\n",
"CTA_sequence_start_PID = 18113444000 # fails \n",
"CTA_sequence_start_PID = 18114052200 # fails\n",
"\n",
"\n",
"CTA_sequence_start_PID = 18114660400 # works\n",
"\n",
"length = 60000\n",
"\n",
"\n",
"for start_pid in [18114720400, 18114780500, 18114840600, 18114900700, 18114960800,\n",
" 18115020900, 18115081000, 18115141100, 18115201200, 18115261300]:\n",
"\n",
" res = slow_daq.retrieve(\n",
" \"CTA_pulses\",\n",
" np.arange(start_pid, start_pid + length),\n",
" run_number=1129,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "684e664b-fe6d-404d-86b9-7a223fa990c3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Advanced run number to 1129.\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",
"\u001b[31m\u001b[1mOffline Channels:\n",
"-----------------\n",
"- SAR-CVME-TIFALL6:EvtSet\n",
"- SARFE10-PSSS059:FIT_ERR\n",
"- SARFE10-PSSS059:SPECTRUM_AVG_CENTER\n",
"- SARFE10-PSSS059:SPECTRUM_AVG_FWHM\n",
"- SARFE10-PSSS059:SPECTRUM_AVG_Y\n",
"\u001b[39m\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 1%|██ | 2/200 [00:03<05:02, 1.5s/@]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"run number: 1129\n",
"acq number: 1\n",
"total acq number: 1970\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- <span style=\"color: #800080; text-decoration-color: #800080\">/sf/cristallina/data/p21147/raw/run1129/data/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">acq0001.PVDATA.h5</span>\n",
"- <span style=\"color: #800080; text-decoration-color: #800080\">/sf/cristallina/data/p21147/raw/run1129/data/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">acq0001.BSDATA.h5</span>\n",
"- <span style=\"color: #800080; text-decoration-color: #800080\">/sf/cristallina/data/p21147/raw/run1129/data/</span><span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">acq0001.JF16T03V01.h5</span>\n",
"</pre>\n"
],
"text/plain": [
"\n",
"DAQTask: done\n",
"\n",
"Output files:\n",
"-------------\n",
"- \u001b[35m/sf/cristallina/data/p21147/raw/run1129/data/\u001b[0m\u001b[95macq0001.PVDATA.h5\u001b[0m\n",
"- \u001b[35m/sf/cristallina/data/p21147/raw/run1129/data/\u001b[0m\u001b[95macq0001.BSDATA.h5\u001b[0m\n",
"- \u001b[35m/sf/cristallina/data/p21147/raw/run1129/data/\u001b[0m\u001b[95macq0001.JF16T03V01.h5\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"slow_daq.acquire('something', n_pulses=2)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "3852ea6f-b014-402b-ba9c-fb5778a76e00",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">array</span><span style=\"font-weight: bold\">([</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114720400</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114780500</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114840600</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114900700</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114960800</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115020900</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115081000</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115141100</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115201200</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115261300</span><span style=\"font-weight: bold\">])</span>\n",
"</pre>\n"
],
"text/plain": [
"\n",
"\u001b[1;35marray\u001b[0m\u001b[1m(\u001b[0m\u001b[1m[\u001b[0m\u001b[1;36m18114720400\u001b[0m, \u001b[1;36m18114780500\u001b[0m, \u001b[1;36m18114840600\u001b[0m, \u001b[1;36m18114900700\u001b[0m, \u001b[1;36m18114960800\u001b[0m,\n",
" \u001b[1;36m18115020900\u001b[0m, \u001b[1;36m18115081000\u001b[0m, \u001b[1;36m18115141100\u001b[0m, \u001b[1;36m18115201200\u001b[0m, \u001b[1;36m18115261300\u001b[0m\u001b[1m]\u001b[0m\u001b[1m)\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"np.array([[18114720400],\n",
" [18114780500],\n",
" [18114840600],\n",
" [18114900700],\n",
" [18114960800],\n",
" [18115020900],\n",
" [18115081000],\n",
" [18115141100],\n",
" [18115201200],\n",
" [18115261300]]).flatten()\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "c4de9b27-2721-449b-a3e6-6658d3e611c8",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"<span style=\"font-weight: bold\">[</span>\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114720400</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114780500</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114840600</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114900700</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18114960800</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115020900</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115081000</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115141100</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115201200</span>,\n",
" <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">18115261300</span>\n",
"<span style=\"font-weight: bold\">]</span>\n",
"</pre>\n"
],
"text/plain": [
"\n",
"\u001b[1m[\u001b[0m\n",
" \u001b[1;36m18114720400\u001b[0m,\n",
" \u001b[1;36m18114780500\u001b[0m,\n",
" \u001b[1;36m18114840600\u001b[0m,\n",
" \u001b[1;36m18114900700\u001b[0m,\n",
" \u001b[1;36m18114960800\u001b[0m,\n",
" \u001b[1;36m18115020900\u001b[0m,\n",
" \u001b[1;36m18115081000\u001b[0m,\n",
" \u001b[1;36m18115141100\u001b[0m,\n",
" \u001b[1;36m18115201200\u001b[0m,\n",
" \u001b[1;36m18115261300\u001b[0m\n",
"\u001b[1m]\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"[18114720400, 18114780500, 18114840600, 18114900700, 18114960800,\n",
" 18115020900, 18115081000, 18115141100, 18115201200, 18115261300]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a8be60a2-d85b-4cbc-8e8b-ffd749b09d15",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"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.16"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}