Skip to content

Commit

Permalink
Refactor observer measurement returns and include ability to access i…
Browse files Browse the repository at this point in the history
…mages
  • Loading branch information
ChristopherMayes committed Aug 28, 2023
1 parent 30ed8be commit bcdca1c
Show file tree
Hide file tree
Showing 6 changed files with 486 additions and 238 deletions.
74 changes: 39 additions & 35 deletions docs/examples/simulated_epics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,48 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2023-08-27 17:45:06,276 | INFO : Initialized config: LCLS2_OTR0H04\n",
"2023-08-27 17:45:06,278 | INFO : Serving: ['QUAD:HTR:120:BCTRL', 'QUAD:HTR:120:BACT', 'OTRS:HTR:330:Image:ArrayData', 'OTRS:HTR:330:Image:ArraySize1_RBV', 'OTRS:HTR:330:Image:ArraySize0_RBV', 'OTRS:HTR:330:RESOLUTION', 'sim_screen_sigma_x', 'sim_screen_sigma_y']\n",
"2023-08-27 17:45:16,412 | INFO : Setting QUAD:HTR:120:BCTRL = -6.0\n",
"2023-08-27 17:45:16,810 | INFO : Setting QUAD:HTR:120:BCTRL = -4.0\n",
"2023-08-27 17:45:17,111 | INFO : Setting QUAD:HTR:120:BCTRL = -2.0\n",
"2023-08-27 17:45:17,406 | INFO : Setting QUAD:HTR:120:BCTRL = 0.0\n",
"2023-08-27 17:45:17,702 | INFO : Setting QUAD:HTR:120:BCTRL = -0.7424975910795275\n",
"2023-08-27 17:45:17,996 | INFO : Setting QUAD:HTR:120:BCTRL = -0.20208132589960626\n",
"2023-08-27 17:45:18,323 | INFO : Setting QUAD:HTR:120:BCTRL = 0.338334939280315\n",
"2023-08-27 17:45:18,615 | INFO : Setting QUAD:HTR:120:BCTRL = 0.8787512044602364\n",
"2023-08-27 17:45:18,905 | INFO : Setting QUAD:HTR:120:BCTRL = 1.4191674696401575\n",
"2023-08-27 17:45:19,193 | INFO : Setting QUAD:HTR:120:BCTRL = 1.9595837348200786\n",
"2023-08-27 17:45:19,481 | INFO : Setting QUAD:HTR:120:BCTRL = 2.5\n",
"2023-08-27 17:45:19,809 | INFO : Setting QUAD:HTR:120:BCTRL = -1.823162654966067\n",
"2023-08-27 17:45:20,105 | INFO : Setting QUAD:HTR:120:BCTRL = -1.102635545805056\n",
"2023-08-27 17:45:20,397 | INFO : Setting QUAD:HTR:120:BCTRL = -0.3821084366440448\n",
"2023-08-27 17:45:20,687 | INFO : Setting QUAD:HTR:120:BCTRL = 1.0589457816779775\n",
"2023-08-27 17:45:20,974 | INFO : Setting QUAD:HTR:120:BCTRL = 1.7794728908389885\n",
"2023-08-27 17:45:21,315 | INFO : Setting QUAD:HTR:120:BCTRL = 2.9632139415827896\n",
"2023-08-27 17:45:21,607 | INFO : Setting QUAD:HTR:120:BCTRL = 3.5808325303598427\n",
"2023-08-27 17:45:21,896 | INFO : Setting QUAD:HTR:120:BCTRL = 4.198451119136895\n",
"2023-08-27 17:45:22,187 | INFO : Setting QUAD:HTR:120:BCTRL = 4.8160697079139485\n",
"2023-08-27 17:45:22,480 | INFO : Setting QUAD:HTR:120:BCTRL = 3.1175946649951527\n",
"2023-08-27 17:45:22,775 | INFO : Setting QUAD:HTR:120:BCTRL = 3.8587082629893357\n",
"2023-08-27 17:45:23,123 | INFO : Setting QUAD:HTR:120:BCTRL = 4.599821860983519\n",
"2023-08-27 17:45:23,420 | INFO : Setting QUAD:HTR:120:BCTRL = 5.340935458977701\n",
"2023-08-27 17:45:23,710 | INFO : Setting QUAD:HTR:120:BCTRL = 6.082049056971885\n",
"2023-08-27 17:45:24,000 | INFO : Setting QUAD:HTR:120:BCTRL = 6.823162654966067\n",
"2023-08-27 17:45:24,803 | INFO : Setting QUAD:HTR:120:BCTRL = 0.0\n"
"2023-08-28 15:51:08,866 | INFO : Initialized config: LCLS2_OTR0H04\n",
"2023-08-28 15:51:08,868 | INFO : Serving: ['QUAD:HTR:120:BCTRL', 'QUAD:HTR:120:BACT', 'OTRS:HTR:330:Image:ArrayData', 'OTRS:HTR:330:Image:ArraySize1_RBV', 'OTRS:HTR:330:Image:ArraySize0_RBV', 'OTRS:HTR:330:RESOLUTION', 'sim_screen_sigma_x', 'sim_screen_sigma_y']\n",
"2023-08-28 15:51:17,680 | INFO : Setting QUAD:HTR:120:BCTRL = -6.0\n",
"2023-08-28 15:51:18,089 | INFO : Setting QUAD:HTR:120:BCTRL = -4.0\n",
"2023-08-28 15:51:18,391 | INFO : Setting QUAD:HTR:120:BCTRL = -2.0\n",
"2023-08-28 15:51:18,688 | INFO : Setting QUAD:HTR:120:BCTRL = 0.0\n",
"2023-08-28 15:51:18,987 | INFO : Setting QUAD:HTR:120:BCTRL = -0.7473601104700353\n",
"2023-08-28 15:51:19,292 | INFO : Setting QUAD:HTR:120:BCTRL = -0.206133425391696\n",
"2023-08-28 15:51:19,619 | INFO : Setting QUAD:HTR:120:BCTRL = 0.3350932596866433\n",
"2023-08-28 15:51:19,921 | INFO : Setting QUAD:HTR:120:BCTRL = 0.8763199447649824\n",
"2023-08-28 15:51:20,212 | INFO : Setting QUAD:HTR:120:BCTRL = 1.4175466298433217\n",
"2023-08-28 15:51:20,508 | INFO : Setting QUAD:HTR:120:BCTRL = 1.958773314921661\n",
"2023-08-28 15:51:20,806 | INFO : Setting QUAD:HTR:120:BCTRL = 2.5\n",
"2023-08-28 15:51:21,136 | INFO : Setting QUAD:HTR:120:BCTRL = -1.8079271291778354\n",
"2023-08-28 15:51:21,435 | INFO : Setting QUAD:HTR:120:BCTRL = -1.0899392743148626\n",
"2023-08-28 15:51:21,734 | INFO : Setting QUAD:HTR:120:BCTRL = -0.37195141945189003\n",
"2023-08-28 15:51:22,031 | INFO : Setting QUAD:HTR:120:BCTRL = 1.0640242902740553\n",
"2023-08-28 15:51:22,327 | INFO : Setting QUAD:HTR:120:BCTRL = 1.782012145137028\n",
"2023-08-28 15:51:22,672 | INFO : Setting QUAD:HTR:120:BCTRL = 2.963908587210005\n",
"2023-08-28 15:51:22,972 | INFO : Setting QUAD:HTR:120:BCTRL = 3.5824533701566783\n",
"2023-08-28 15:51:23,268 | INFO : Setting QUAD:HTR:120:BCTRL = 4.200998153103352\n",
"2023-08-28 15:51:23,565 | INFO : Setting QUAD:HTR:120:BCTRL = 4.819542936050025\n",
"2023-08-28 15:51:23,869 | INFO : Setting QUAD:HTR:120:BCTRL = 3.115418161311119\n",
"2023-08-28 15:51:24,169 | INFO : Setting QUAD:HTR:120:BCTRL = 3.935975709725945\n",
"2023-08-28 15:51:24,527 | INFO : Setting QUAD:HTR:120:BCTRL = 4.756533258140771\n",
"2023-08-28 15:51:24,830 | INFO : Setting QUAD:HTR:120:BCTRL = 5.577090806555597\n",
"2023-08-28 15:51:25,597 | INFO : Setting QUAD:HTR:120:BCTRL = 1.2345\n",
"2023-08-28 15:51:26,162 | INFO : Setting QUAD:HTR:120:BCTRL = 0.0\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"KeyboardInterrupt\n",
"\n"
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 6\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mlogging\u001b[39;00m\n\u001b[1;32m 4\u001b[0m print_logging(level\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m10\u001b[39m)\n\u001b[0;32m----> 6\u001b[0m \u001b[43mstart_server\u001b[49m\u001b[43m(\u001b[49m\u001b[43mconfig_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mLCLS2_OTR0H04\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Code/GitHub/PyEmittance/pyemittance/simulation_server.py:156\u001b[0m, in \u001b[0;36mstart_server\u001b[0;34m(config_name, prefix)\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[38;5;66;03m# process CA transactions\u001b[39;00m\n\u001b[1;32m 155\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m--> 156\u001b[0m \u001b[43mserver\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m0.1\u001b[39;49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Code/mambaforge/envs/devel/lib/python3.9/site-packages/pcaspy/driver.py:843\u001b[0m, in \u001b[0;36mSimpleServer.process\u001b[0;34m(delay)\u001b[0m\n\u001b[1;32m 826\u001b[0m \u001b[38;5;129m@staticmethod\u001b[39m\n\u001b[1;32m 827\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mprocess\u001b[39m(delay):\n\u001b[1;32m 828\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 829\u001b[0m \u001b[38;5;124;03m Process server transactions.\u001b[39;00m\n\u001b[1;32m 830\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 841\u001b[0m \n\u001b[1;32m 842\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 843\u001b[0m \u001b[43mcas\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdelay\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/Code/mambaforge/envs/devel/lib/python3.9/site-packages/pcaspy/cas.py:712\u001b[0m, in \u001b[0;36mprocess\u001b[0;34m(delay)\u001b[0m\n\u001b[1;32m 711\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mprocess\u001b[39m(delay):\n\u001b[0;32m--> 712\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_cas\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mprocess\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdelay\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
Expand Down
Loading

0 comments on commit bcdca1c

Please sign in to comment.