You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1604 lines
105 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. {
  2. "cells": [
  3. {
  4. "attachments": {},
  5. "cell_type": "markdown",
  6. "metadata": {},
  7. "source": [
  8. "# Import supporting package"
  9. ]
  10. },
  11. {
  12. "cell_type": "code",
  13. "execution_count": 1,
  14. "metadata": {},
  15. "outputs": [],
  16. "source": [
  17. "import xarray as xr\n",
  18. "import numpy as np\n",
  19. "\n",
  20. "from uncertainties import ufloat\n",
  21. "from uncertainties import unumpy as unp\n",
  22. "from uncertainties import umath\n",
  23. "\n",
  24. "import matplotlib.pyplot as plt\n",
  25. "\n",
  26. "from DataContainer.ReadData import read_hdf5_file\n",
  27. "from Analyser.ImagingAnalyser import ImageAnalyser\n",
  28. "from Analyser.FitAnalyser import FitAnalyser\n",
  29. "from ToolFunction.ToolFunction import *\n",
  30. "\n",
  31. "from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
  32. "xr.plot.dataarray_plot.errorbar = errorbar\n",
  33. "xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar\n",
  34. "\n",
  35. "imageAnalyser = ImageAnalyser()"
  36. ]
  37. },
  38. {
  39. "attachments": {},
  40. "cell_type": "markdown",
  41. "metadata": {},
  42. "source": [
  43. "## Start a client for parallel computing"
  44. ]
  45. },
  46. {
  47. "cell_type": "code",
  48. "execution_count": 2,
  49. "metadata": {},
  50. "outputs": [
  51. {
  52. "name": "stderr",
  53. "output_type": "stream",
  54. "text": [
  55. "D:\\Program Files\\Python\\Python38\\Lib\\site-packages\\distributed\\node.py:182: UserWarning: Port 8787 is already in use.\n",
  56. "Perhaps you already have a cluster running?\n",
  57. "Hosting the HTTP server on port 59390 instead\n",
  58. " warnings.warn(\n"
  59. ]
  60. },
  61. {
  62. "data": {
  63. "text/html": [
  64. "<div>\n",
  65. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
  66. " <div style=\"margin-left: 48px;\">\n",
  67. " <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
  68. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-9a0ca19d-ecb4-11ed-af18-9c7bef43b4fb</p>\n",
  69. " <table style=\"width: 100%; text-align: left;\">\n",
  70. "\n",
  71. " <tr>\n",
  72. " \n",
  73. " <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
  74. " <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
  75. " \n",
  76. " </tr>\n",
  77. "\n",
  78. " \n",
  79. " <tr>\n",
  80. " <td style=\"text-align: left;\">\n",
  81. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59390/status\" target=\"_blank\">http://127.0.0.1:59390/status</a>\n",
  82. " </td>\n",
  83. " <td style=\"text-align: left;\"></td>\n",
  84. " </tr>\n",
  85. " \n",
  86. "\n",
  87. " </table>\n",
  88. "\n",
  89. " \n",
  90. " <button style=\"margin-bottom: 12px;\" data-commandlinker-command=\"dask:populate-and-launch-layout\" data-commandlinker-args='{\"url\": \"http://127.0.0.1:59390/status\" }'>\n",
  91. " Launch dashboard in JupyterLab\n",
  92. " </button>\n",
  93. " \n",
  94. "\n",
  95. " \n",
  96. " <details>\n",
  97. " <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
  98. " <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
  99. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
  100. " </div>\n",
  101. " <div style=\"margin-left: 48px;\">\n",
  102. " <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
  103. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">40e09024</p>\n",
  104. " <table style=\"width: 100%; text-align: left;\">\n",
  105. " <tr>\n",
  106. " <td style=\"text-align: left;\">\n",
  107. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:59390/status\" target=\"_blank\">http://127.0.0.1:59390/status</a>\n",
  108. " </td>\n",
  109. " <td style=\"text-align: left;\">\n",
  110. " <strong>Workers:</strong> 6\n",
  111. " </td>\n",
  112. " </tr>\n",
  113. " <tr>\n",
  114. " <td style=\"text-align: left;\">\n",
  115. " <strong>Total threads:</strong> 60\n",
  116. " </td>\n",
  117. " <td style=\"text-align: left;\">\n",
  118. " <strong>Total memory:</strong> 55.88 GiB\n",
  119. " </td>\n",
  120. " </tr>\n",
  121. " \n",
  122. " <tr>\n",
  123. " <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
  124. " <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
  125. "</tr>\n",
  126. "\n",
  127. " \n",
  128. " </table>\n",
  129. "\n",
  130. " <details>\n",
  131. " <summary style=\"margin-bottom: 20px;\">\n",
  132. " <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
  133. " </summary>\n",
  134. "\n",
  135. " <div style=\"\">\n",
  136. " <div>\n",
  137. " <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
  138. " <div style=\"margin-left: 48px;\">\n",
  139. " <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
  140. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-616be11d-c546-4d58-ad88-3bacd53b13c0</p>\n",
  141. " <table style=\"width: 100%; text-align: left;\">\n",
  142. " <tr>\n",
  143. " <td style=\"text-align: left;\">\n",
  144. " <strong>Comm:</strong> tcp://127.0.0.1:59391\n",
  145. " </td>\n",
  146. " <td style=\"text-align: left;\">\n",
  147. " <strong>Workers:</strong> 6\n",
  148. " </td>\n",
  149. " </tr>\n",
  150. " <tr>\n",
  151. " <td style=\"text-align: left;\">\n",
  152. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:59390/status\" target=\"_blank\">http://127.0.0.1:59390/status</a>\n",
  153. " </td>\n",
  154. " <td style=\"text-align: left;\">\n",
  155. " <strong>Total threads:</strong> 60\n",
  156. " </td>\n",
  157. " </tr>\n",
  158. " <tr>\n",
  159. " <td style=\"text-align: left;\">\n",
  160. " <strong>Started:</strong> Just now\n",
  161. " </td>\n",
  162. " <td style=\"text-align: left;\">\n",
  163. " <strong>Total memory:</strong> 55.88 GiB\n",
  164. " </td>\n",
  165. " </tr>\n",
  166. " </table>\n",
  167. " </div>\n",
  168. " </div>\n",
  169. "\n",
  170. " <details style=\"margin-left: 48px;\">\n",
  171. " <summary style=\"margin-bottom: 20px;\">\n",
  172. " <h3 style=\"display: inline;\">Workers</h3>\n",
  173. " </summary>\n",
  174. "\n",
  175. " \n",
  176. " <div style=\"margin-bottom: 20px;\">\n",
  177. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  178. " <div style=\"margin-left: 48px;\">\n",
  179. " <details>\n",
  180. " <summary>\n",
  181. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
  182. " </summary>\n",
  183. " <table style=\"width: 100%; text-align: left;\">\n",
  184. " <tr>\n",
  185. " <td style=\"text-align: left;\">\n",
  186. " <strong>Comm: </strong> tcp://127.0.0.1:59424\n",
  187. " </td>\n",
  188. " <td style=\"text-align: left;\">\n",
  189. " <strong>Total threads: </strong> 10\n",
  190. " </td>\n",
  191. " </tr>\n",
  192. " <tr>\n",
  193. " <td style=\"text-align: left;\">\n",
  194. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59428/status\" target=\"_blank\">http://127.0.0.1:59428/status</a>\n",
  195. " </td>\n",
  196. " <td style=\"text-align: left;\">\n",
  197. " <strong>Memory: </strong> 9.31 GiB\n",
  198. " </td>\n",
  199. " </tr>\n",
  200. " <tr>\n",
  201. " <td style=\"text-align: left;\">\n",
  202. " <strong>Nanny: </strong> tcp://127.0.0.1:59394\n",
  203. " </td>\n",
  204. " <td style=\"text-align: left;\"></td>\n",
  205. " </tr>\n",
  206. " <tr>\n",
  207. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  208. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-ybrgy95q\n",
  209. " </td>\n",
  210. " </tr>\n",
  211. "\n",
  212. " \n",
  213. "\n",
  214. " \n",
  215. "\n",
  216. " </table>\n",
  217. " </details>\n",
  218. " </div>\n",
  219. " </div>\n",
  220. " \n",
  221. " <div style=\"margin-bottom: 20px;\">\n",
  222. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  223. " <div style=\"margin-left: 48px;\">\n",
  224. " <details>\n",
  225. " <summary>\n",
  226. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
  227. " </summary>\n",
  228. " <table style=\"width: 100%; text-align: left;\">\n",
  229. " <tr>\n",
  230. " <td style=\"text-align: left;\">\n",
  231. " <strong>Comm: </strong> tcp://127.0.0.1:59422\n",
  232. " </td>\n",
  233. " <td style=\"text-align: left;\">\n",
  234. " <strong>Total threads: </strong> 10\n",
  235. " </td>\n",
  236. " </tr>\n",
  237. " <tr>\n",
  238. " <td style=\"text-align: left;\">\n",
  239. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59427/status\" target=\"_blank\">http://127.0.0.1:59427/status</a>\n",
  240. " </td>\n",
  241. " <td style=\"text-align: left;\">\n",
  242. " <strong>Memory: </strong> 9.31 GiB\n",
  243. " </td>\n",
  244. " </tr>\n",
  245. " <tr>\n",
  246. " <td style=\"text-align: left;\">\n",
  247. " <strong>Nanny: </strong> tcp://127.0.0.1:59395\n",
  248. " </td>\n",
  249. " <td style=\"text-align: left;\"></td>\n",
  250. " </tr>\n",
  251. " <tr>\n",
  252. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  253. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-ms_3izxs\n",
  254. " </td>\n",
  255. " </tr>\n",
  256. "\n",
  257. " \n",
  258. "\n",
  259. " \n",
  260. "\n",
  261. " </table>\n",
  262. " </details>\n",
  263. " </div>\n",
  264. " </div>\n",
  265. " \n",
  266. " <div style=\"margin-bottom: 20px;\">\n",
  267. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  268. " <div style=\"margin-left: 48px;\">\n",
  269. " <details>\n",
  270. " <summary>\n",
  271. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
  272. " </summary>\n",
  273. " <table style=\"width: 100%; text-align: left;\">\n",
  274. " <tr>\n",
  275. " <td style=\"text-align: left;\">\n",
  276. " <strong>Comm: </strong> tcp://127.0.0.1:59434\n",
  277. " </td>\n",
  278. " <td style=\"text-align: left;\">\n",
  279. " <strong>Total threads: </strong> 10\n",
  280. " </td>\n",
  281. " </tr>\n",
  282. " <tr>\n",
  283. " <td style=\"text-align: left;\">\n",
  284. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59437/status\" target=\"_blank\">http://127.0.0.1:59437/status</a>\n",
  285. " </td>\n",
  286. " <td style=\"text-align: left;\">\n",
  287. " <strong>Memory: </strong> 9.31 GiB\n",
  288. " </td>\n",
  289. " </tr>\n",
  290. " <tr>\n",
  291. " <td style=\"text-align: left;\">\n",
  292. " <strong>Nanny: </strong> tcp://127.0.0.1:59396\n",
  293. " </td>\n",
  294. " <td style=\"text-align: left;\"></td>\n",
  295. " </tr>\n",
  296. " <tr>\n",
  297. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  298. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-qteiamcm\n",
  299. " </td>\n",
  300. " </tr>\n",
  301. "\n",
  302. " \n",
  303. "\n",
  304. " \n",
  305. "\n",
  306. " </table>\n",
  307. " </details>\n",
  308. " </div>\n",
  309. " </div>\n",
  310. " \n",
  311. " <div style=\"margin-bottom: 20px;\">\n",
  312. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  313. " <div style=\"margin-left: 48px;\">\n",
  314. " <details>\n",
  315. " <summary>\n",
  316. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
  317. " </summary>\n",
  318. " <table style=\"width: 100%; text-align: left;\">\n",
  319. " <tr>\n",
  320. " <td style=\"text-align: left;\">\n",
  321. " <strong>Comm: </strong> tcp://127.0.0.1:59421\n",
  322. " </td>\n",
  323. " <td style=\"text-align: left;\">\n",
  324. " <strong>Total threads: </strong> 10\n",
  325. " </td>\n",
  326. " </tr>\n",
  327. " <tr>\n",
  328. " <td style=\"text-align: left;\">\n",
  329. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59426/status\" target=\"_blank\">http://127.0.0.1:59426/status</a>\n",
  330. " </td>\n",
  331. " <td style=\"text-align: left;\">\n",
  332. " <strong>Memory: </strong> 9.31 GiB\n",
  333. " </td>\n",
  334. " </tr>\n",
  335. " <tr>\n",
  336. " <td style=\"text-align: left;\">\n",
  337. " <strong>Nanny: </strong> tcp://127.0.0.1:59397\n",
  338. " </td>\n",
  339. " <td style=\"text-align: left;\"></td>\n",
  340. " </tr>\n",
  341. " <tr>\n",
  342. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  343. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-r2y5vxh3\n",
  344. " </td>\n",
  345. " </tr>\n",
  346. "\n",
  347. " \n",
  348. "\n",
  349. " \n",
  350. "\n",
  351. " </table>\n",
  352. " </details>\n",
  353. " </div>\n",
  354. " </div>\n",
  355. " \n",
  356. " <div style=\"margin-bottom: 20px;\">\n",
  357. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  358. " <div style=\"margin-left: 48px;\">\n",
  359. " <details>\n",
  360. " <summary>\n",
  361. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
  362. " </summary>\n",
  363. " <table style=\"width: 100%; text-align: left;\">\n",
  364. " <tr>\n",
  365. " <td style=\"text-align: left;\">\n",
  366. " <strong>Comm: </strong> tcp://127.0.0.1:59425\n",
  367. " </td>\n",
  368. " <td style=\"text-align: left;\">\n",
  369. " <strong>Total threads: </strong> 10\n",
  370. " </td>\n",
  371. " </tr>\n",
  372. " <tr>\n",
  373. " <td style=\"text-align: left;\">\n",
  374. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59435/status\" target=\"_blank\">http://127.0.0.1:59435/status</a>\n",
  375. " </td>\n",
  376. " <td style=\"text-align: left;\">\n",
  377. " <strong>Memory: </strong> 9.31 GiB\n",
  378. " </td>\n",
  379. " </tr>\n",
  380. " <tr>\n",
  381. " <td style=\"text-align: left;\">\n",
  382. " <strong>Nanny: </strong> tcp://127.0.0.1:59398\n",
  383. " </td>\n",
  384. " <td style=\"text-align: left;\"></td>\n",
  385. " </tr>\n",
  386. " <tr>\n",
  387. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  388. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-3ykst_31\n",
  389. " </td>\n",
  390. " </tr>\n",
  391. "\n",
  392. " \n",
  393. "\n",
  394. " \n",
  395. "\n",
  396. " </table>\n",
  397. " </details>\n",
  398. " </div>\n",
  399. " </div>\n",
  400. " \n",
  401. " <div style=\"margin-bottom: 20px;\">\n",
  402. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  403. " <div style=\"margin-left: 48px;\">\n",
  404. " <details>\n",
  405. " <summary>\n",
  406. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
  407. " </summary>\n",
  408. " <table style=\"width: 100%; text-align: left;\">\n",
  409. " <tr>\n",
  410. " <td style=\"text-align: left;\">\n",
  411. " <strong>Comm: </strong> tcp://127.0.0.1:59423\n",
  412. " </td>\n",
  413. " <td style=\"text-align: left;\">\n",
  414. " <strong>Total threads: </strong> 10\n",
  415. " </td>\n",
  416. " </tr>\n",
  417. " <tr>\n",
  418. " <td style=\"text-align: left;\">\n",
  419. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59429/status\" target=\"_blank\">http://127.0.0.1:59429/status</a>\n",
  420. " </td>\n",
  421. " <td style=\"text-align: left;\">\n",
  422. " <strong>Memory: </strong> 9.31 GiB\n",
  423. " </td>\n",
  424. " </tr>\n",
  425. " <tr>\n",
  426. " <td style=\"text-align: left;\">\n",
  427. " <strong>Nanny: </strong> tcp://127.0.0.1:59399\n",
  428. " </td>\n",
  429. " <td style=\"text-align: left;\"></td>\n",
  430. " </tr>\n",
  431. " <tr>\n",
  432. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  433. " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-egpqiwk3\n",
  434. " </td>\n",
  435. " </tr>\n",
  436. "\n",
  437. " \n",
  438. "\n",
  439. " \n",
  440. "\n",
  441. " </table>\n",
  442. " </details>\n",
  443. " </div>\n",
  444. " </div>\n",
  445. " \n",
  446. "\n",
  447. " </details>\n",
  448. "</div>\n",
  449. "\n",
  450. " </details>\n",
  451. " </div>\n",
  452. "</div>\n",
  453. " </details>\n",
  454. " \n",
  455. "\n",
  456. " </div>\n",
  457. "</div>"
  458. ],
  459. "text/plain": [
  460. "<Client: 'tcp://127.0.0.1:59391' processes=6 threads=60, memory=55.88 GiB>"
  461. ]
  462. },
  463. "execution_count": 2,
  464. "metadata": {},
  465. "output_type": "execute_result"
  466. }
  467. ],
  468. "source": [
  469. "from dask.distributed import Client\n",
  470. "client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
  471. "client"
  472. ]
  473. },
  474. {
  475. "attachments": {},
  476. "cell_type": "markdown",
  477. "metadata": {},
  478. "source": [
  479. "# Read data"
  480. ]
  481. },
  482. {
  483. "attachments": {},
  484. "cell_type": "markdown",
  485. "metadata": {},
  486. "source": [
  487. "## Set file path"
  488. ]
  489. },
  490. {
  491. "cell_type": "code",
  492. "execution_count": 3,
  493. "metadata": {},
  494. "outputs": [],
  495. "source": [
  496. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/03/0043/*.h5\"\n",
  497. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/2023-04-18_0003_Evaporative_Cooling_000.h5\"\n",
  498. "\n",
  499. "# filepath = \"//DyLabNAS/Data/Repetition_scan/2023/04/21/0002/*.h5\"\n",
  500. "\n",
  501. "filepath = r\"./testData/0002/*.h5\"\n",
  502. "\n",
  503. "# filepath = r\"./testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5\"\n",
  504. "\n",
  505. "# filepath = r'd:/Jianshun Gao/Simulations/analyseScripts/testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5'\n",
  506. "\n",
  507. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
  508. "\n",
  509. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\""
  510. ]
  511. },
  512. {
  513. "cell_type": "code",
  514. "execution_count": 4,
  515. "metadata": {},
  516. "outputs": [],
  517. "source": [
  518. "groupList = [\n",
  519. " \"images/MOT_3D_Camera/in_situ_absorption\",\n",
  520. " # \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
  521. "]\n",
  522. "\n",
  523. "dskey = {\n",
  524. " \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_1\",\n",
  525. " # \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
  526. "}\n",
  527. "\n",
  528. "dataSetDict = {\n",
  529. " dskey[groupList[i]]: read_hdf5_file(filepath, groupList[i])\n",
  530. " for i in range(len(groupList))\n",
  531. "}"
  532. ]
  533. },
  534. {
  535. "attachments": {},
  536. "cell_type": "markdown",
  537. "metadata": {},
  538. "source": [
  539. "## Rechunk the data for parallel computing"
  540. ]
  541. },
  542. {
  543. "cell_type": "code",
  544. "execution_count": 5,
  545. "metadata": {},
  546. "outputs": [],
  547. "source": [
  548. "dataSet = dataSetDict[\"camera_1\"]\n",
  549. "\n",
  550. "scanAxis = dataSet.scanAxis\n",
  551. "\n",
  552. "# dataSet = dataSet.chunk(\n",
  553. "# {\n",
  554. "# # \"compZ_current_sg\": \"auto\",\n",
  555. "# \"sin_mod_freq\": \"auto\",\n",
  556. "# \"runs\": 2,\n",
  557. "# \"x\": \"auto\",\n",
  558. "# \"y\": \"auto\",\n",
  559. "# }\n",
  560. "# )"
  561. ]
  562. },
  563. {
  564. "attachments": {},
  565. "cell_type": "markdown",
  566. "metadata": {},
  567. "source": [
  568. "# Calculate absorption imaging"
  569. ]
  570. },
  571. {
  572. "attachments": {},
  573. "cell_type": "markdown",
  574. "metadata": {},
  575. "source": [
  576. "## get OD images"
  577. ]
  578. },
  579. {
  580. "cell_type": "code",
  581. "execution_count": 6,
  582. "metadata": {},
  583. "outputs": [
  584. {
  585. "data": {
  586. "text/html": [
  587. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  588. "<defs>\n",
  589. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  590. "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
  591. "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
  592. "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
  593. "</symbol>\n",
  594. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  595. "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
  596. "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
  597. "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
  598. "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
  599. "</symbol>\n",
  600. "</defs>\n",
  601. "</svg>\n",
  602. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  603. " *\n",
  604. " */\n",
  605. "\n",
  606. ":root {\n",
  607. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  608. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  609. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  610. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  611. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  612. " --xr-background-color: var(--jp-layout-color0, white);\n",
  613. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  614. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  615. "}\n",
  616. "\n",
  617. "html[theme=dark],\n",
  618. "body[data-theme=dark],\n",
  619. "body.vscode-dark {\n",
  620. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  621. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  622. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  623. " --xr-border-color: #1F1F1F;\n",
  624. " --xr-disabled-color: #515151;\n",
  625. " --xr-background-color: #111111;\n",
  626. " --xr-background-color-row-even: #111111;\n",
  627. " --xr-background-color-row-odd: #313131;\n",
  628. "}\n",
  629. "\n",
  630. ".xr-wrap {\n",
  631. " display: block !important;\n",
  632. " min-width: 300px;\n",
  633. " max-width: 700px;\n",
  634. "}\n",
  635. "\n",
  636. ".xr-text-repr-fallback {\n",
  637. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  638. " display: none;\n",
  639. "}\n",
  640. "\n",
  641. ".xr-header {\n",
  642. " padding-top: 6px;\n",
  643. " padding-bottom: 6px;\n",
  644. " margin-bottom: 4px;\n",
  645. " border-bottom: solid 1px var(--xr-border-color);\n",
  646. "}\n",
  647. "\n",
  648. ".xr-header > div,\n",
  649. ".xr-header > ul {\n",
  650. " display: inline;\n",
  651. " margin-top: 0;\n",
  652. " margin-bottom: 0;\n",
  653. "}\n",
  654. "\n",
  655. ".xr-obj-type,\n",
  656. ".xr-array-name {\n",
  657. " margin-left: 2px;\n",
  658. " margin-right: 10px;\n",
  659. "}\n",
  660. "\n",
  661. ".xr-obj-type {\n",
  662. " color: var(--xr-font-color2);\n",
  663. "}\n",
  664. "\n",
  665. ".xr-sections {\n",
  666. " padding-left: 0 !important;\n",
  667. " display: grid;\n",
  668. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  669. "}\n",
  670. "\n",
  671. ".xr-section-item {\n",
  672. " display: contents;\n",
  673. "}\n",
  674. "\n",
  675. ".xr-section-item input {\n",
  676. " display: none;\n",
  677. "}\n",
  678. "\n",
  679. ".xr-section-item input + label {\n",
  680. " color: var(--xr-disabled-color);\n",
  681. "}\n",
  682. "\n",
  683. ".xr-section-item input:enabled + label {\n",
  684. " cursor: pointer;\n",
  685. " color: var(--xr-font-color2);\n",
  686. "}\n",
  687. "\n",
  688. ".xr-section-item input:enabled + label:hover {\n",
  689. " color: var(--xr-font-color0);\n",
  690. "}\n",
  691. "\n",
  692. ".xr-section-summary {\n",
  693. " grid-column: 1;\n",
  694. " color: var(--xr-font-color2);\n",
  695. " font-weight: 500;\n",
  696. "}\n",
  697. "\n",
  698. ".xr-section-summary > span {\n",
  699. " display: inline-block;\n",
  700. " padding-left: 0.5em;\n",
  701. "}\n",
  702. "\n",
  703. ".xr-section-summary-in:disabled + label {\n",
  704. " color: var(--xr-font-color2);\n",
  705. "}\n",
  706. "\n",
  707. ".xr-section-summary-in + label:before {\n",
  708. " display: inline-block;\n",
  709. " content: 'â–º';\n",
  710. " font-size: 11px;\n",
  711. " width: 15px;\n",
  712. " text-align: center;\n",
  713. "}\n",
  714. "\n",
  715. ".xr-section-summary-in:disabled + label:before {\n",
  716. " color: var(--xr-disabled-color);\n",
  717. "}\n",
  718. "\n",
  719. ".xr-section-summary-in:checked + label:before {\n",
  720. " content: 'â–¼';\n",
  721. "}\n",
  722. "\n",
  723. ".xr-section-summary-in:checked + label > span {\n",
  724. " display: none;\n",
  725. "}\n",
  726. "\n",
  727. ".xr-section-summary,\n",
  728. ".xr-section-inline-details {\n",
  729. " padding-top: 4px;\n",
  730. " padding-bottom: 4px;\n",
  731. "}\n",
  732. "\n",
  733. ".xr-section-inline-details {\n",
  734. " grid-column: 2 / -1;\n",
  735. "}\n",
  736. "\n",
  737. ".xr-section-details {\n",
  738. " display: none;\n",
  739. " grid-column: 1 / -1;\n",
  740. " margin-bottom: 5px;\n",
  741. "}\n",
  742. "\n",
  743. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  744. " display: contents;\n",
  745. "}\n",
  746. "\n",
  747. ".xr-array-wrap {\n",
  748. " grid-column: 1 / -1;\n",
  749. " display: grid;\n",
  750. " grid-template-columns: 20px auto;\n",
  751. "}\n",
  752. "\n",
  753. ".xr-array-wrap > label {\n",
  754. " grid-column: 1;\n",
  755. " vertical-align: top;\n",
  756. "}\n",
  757. "\n",
  758. ".xr-preview {\n",
  759. " color: var(--xr-font-color3);\n",
  760. "}\n",
  761. "\n",
  762. ".xr-array-preview,\n",
  763. ".xr-array-data {\n",
  764. " padding: 0 5px !important;\n",
  765. " grid-column: 2;\n",
  766. "}\n",
  767. "\n",
  768. ".xr-array-data,\n",
  769. ".xr-array-in:checked ~ .xr-array-preview {\n",
  770. " display: none;\n",
  771. "}\n",
  772. "\n",
  773. ".xr-array-in:checked ~ .xr-array-data,\n",
  774. ".xr-array-preview {\n",
  775. " display: inline-block;\n",
  776. "}\n",
  777. "\n",
  778. ".xr-dim-list {\n",
  779. " display: inline-block !important;\n",
  780. " list-style: none;\n",
  781. " padding: 0 !important;\n",
  782. " margin: 0;\n",
  783. "}\n",
  784. "\n",
  785. ".xr-dim-list li {\n",
  786. " display: inline-block;\n",
  787. " padding: 0;\n",
  788. " margin: 0;\n",
  789. "}\n",
  790. "\n",
  791. ".xr-dim-list:before {\n",
  792. " content: '(';\n",
  793. "}\n",
  794. "\n",
  795. ".xr-dim-list:after {\n",
  796. " content: ')';\n",
  797. "}\n",
  798. "\n",
  799. ".xr-dim-list li:not(:last-child):after {\n",
  800. " content: ',';\n",
  801. " padding-right: 5px;\n",
  802. "}\n",
  803. "\n",
  804. ".xr-has-index {\n",
  805. " font-weight: bold;\n",
  806. "}\n",
  807. "\n",
  808. ".xr-var-list,\n",
  809. ".xr-var-item {\n",
  810. " display: contents;\n",
  811. "}\n",
  812. "\n",
  813. ".xr-var-item > div,\n",
  814. ".xr-var-item label,\n",
  815. ".xr-var-item > .xr-var-name span {\n",
  816. " background-color: var(--xr-background-color-row-even);\n",
  817. " margin-bottom: 0;\n",
  818. "}\n",
  819. "\n",
  820. ".xr-var-item > .xr-var-name:hover span {\n",
  821. " padding-right: 5px;\n",
  822. "}\n",
  823. "\n",
  824. ".xr-var-list > li:nth-child(odd) > div,\n",
  825. ".xr-var-list > li:nth-child(odd) > label,\n",
  826. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  827. " background-color: var(--xr-background-color-row-odd);\n",
  828. "}\n",
  829. "\n",
  830. ".xr-var-name {\n",
  831. " grid-column: 1;\n",
  832. "}\n",
  833. "\n",
  834. ".xr-var-dims {\n",
  835. " grid-column: 2;\n",
  836. "}\n",
  837. "\n",
  838. ".xr-var-dtype {\n",
  839. " grid-column: 3;\n",
  840. " text-align: right;\n",
  841. " color: var(--xr-font-color2);\n",
  842. "}\n",
  843. "\n",
  844. ".xr-var-preview {\n",
  845. " grid-column: 4;\n",
  846. "}\n",
  847. "\n",
  848. ".xr-index-preview {\n",
  849. " grid-column: 2 / 5;\n",
  850. " color: var(--xr-font-color2);\n",
  851. "}\n",
  852. "\n",
  853. ".xr-var-name,\n",
  854. ".xr-var-dims,\n",
  855. ".xr-var-dtype,\n",
  856. ".xr-preview,\n",
  857. ".xr-attrs dt {\n",
  858. " white-space: nowrap;\n",
  859. " overflow: hidden;\n",
  860. " text-overflow: ellipsis;\n",
  861. " padding-right: 10px;\n",
  862. "}\n",
  863. "\n",
  864. ".xr-var-name:hover,\n",
  865. ".xr-var-dims:hover,\n",
  866. ".xr-var-dtype:hover,\n",
  867. ".xr-attrs dt:hover {\n",
  868. " overflow: visible;\n",
  869. " width: auto;\n",
  870. " z-index: 1;\n",
  871. "}\n",
  872. "\n",
  873. ".xr-var-attrs,\n",
  874. ".xr-var-data,\n",
  875. ".xr-index-data {\n",
  876. " display: none;\n",
  877. " background-color: var(--xr-background-color) !important;\n",
  878. " padding-bottom: 5px !important;\n",
  879. "}\n",
  880. "\n",
  881. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  882. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  883. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  884. " display: block;\n",
  885. "}\n",
  886. "\n",
  887. ".xr-var-data > table {\n",
  888. " float: right;\n",
  889. "}\n",
  890. "\n",
  891. ".xr-var-name span,\n",
  892. ".xr-var-data,\n",
  893. ".xr-index-name div,\n",
  894. ".xr-index-data,\n",
  895. ".xr-attrs {\n",
  896. " padding-left: 25px !important;\n",
  897. "}\n",
  898. "\n",
  899. ".xr-attrs,\n",
  900. ".xr-var-attrs,\n",
  901. ".xr-var-data,\n",
  902. ".xr-index-data {\n",
  903. " grid-column: 1 / -1;\n",
  904. "}\n",
  905. "\n",
  906. "dl.xr-attrs {\n",
  907. " padding: 0;\n",
  908. " margin: 0;\n",
  909. " display: grid;\n",
  910. " grid-template-columns: 125px auto;\n",
  911. "}\n",
  912. "\n",
  913. ".xr-attrs dt,\n",
  914. ".xr-attrs dd {\n",
  915. " padding: 0;\n",
  916. " margin: 0;\n",
  917. " float: left;\n",
  918. " padding-right: 10px;\n",
  919. " width: auto;\n",
  920. "}\n",
  921. "\n",
  922. ".xr-attrs dt {\n",
  923. " font-weight: normal;\n",
  924. " grid-column: 1;\n",
  925. "}\n",
  926. "\n",
  927. ".xr-attrs dt:hover span {\n",
  928. " display: inline-block;\n",
  929. " background: var(--xr-background-color);\n",
  930. " padding-right: 10px;\n",
  931. "}\n",
  932. "\n",
  933. ".xr-attrs dd {\n",
  934. " grid-column: 2;\n",
  935. " white-space: pre-wrap;\n",
  936. " word-break: break-all;\n",
  937. "}\n",
  938. "\n",
  939. ".xr-icon-database,\n",
  940. ".xr-icon-file-text2,\n",
  941. ".xr-no-icon {\n",
  942. " display: inline-block;\n",
  943. " vertical-align: middle;\n",
  944. " width: 1em;\n",
  945. " height: 1.5em !important;\n",
  946. " stroke-width: 0;\n",
  947. " stroke: currentColor;\n",
  948. " fill: currentColor;\n",
  949. "}\n",
  950. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
  951. "Dimensions: (runs: 3, x: 1200, y: 1920)\n",
  952. "Coordinates:\n",
  953. " * runs (runs) float64 0.0 1.0 2.0\n",
  954. "Dimensions without coordinates: x, y\n",
  955. "Data variables:\n",
  956. " atoms (runs, x, y) uint16 dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;\n",
  957. " background (runs, x, y) uint16 dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;\n",
  958. " dark (runs, x, y) uint16 dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;\n",
  959. " shotNum (runs) int64 0 1 2\n",
  960. " OD (runs, x, y) float64 dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;\n",
  961. "Attributes: (12/96)\n",
  962. " TOF_free: 0.02\n",
  963. " abs_img_freq: 110.858\n",
  964. " absorption_imaging_flag: True\n",
  965. " backup_data: True\n",
  966. " blink_off_time: nan\n",
  967. " blink_on_time: nan\n",
  968. " ... ...\n",
  969. " y_offset_img: 0\n",
  970. " z_offset: 0.189\n",
  971. " z_offset_img: 0.189\n",
  972. " runs: [0. 1. 2.]\n",
  973. " scanAxis: [&#x27;runs&#x27;]\n",
  974. " scanAxisLength: [3.]</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-f93fede0-0ffa-4c21-b9ba-c80d42838e9a' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f93fede0-0ffa-4c21-b9ba-c80d42838e9a' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>runs</span>: 3</li><li><span>x</span>: 1200</li><li><span>y</span>: 1920</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-3dec71c4-b180-4438-934e-50bc3c02d447' class='xr-section-summary-in' type='checkbox' checked><label for='section-3dec71c4-b180-4438-934e-50bc3c02d447' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>runs</span></div><div class='xr-var-dims'>(runs)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 1.0 2.0</div><input id='attrs-35d0177d-948f-4b66-b45d-edfed01c339f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-35d0177d-948f-4b66-b45d-edfed01c339f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6995abb3-bf0c-4aa7-9aa2-0c4082d0d6b1' class='xr-var-data-in' type='checkbox'><label for='data-6995abb3-bf0c-4aa7-9aa2-0c4082d0d6b1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0., 1., 2.])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6b5f08a3-382c-44dd-ac4e-312cf9dc366e' class='xr-section-summary-in' type='checkbox' checked><label for='section-6b5f08a3-382c-44dd-ac4e-312cf9dc366e' class='xr-section-summary' >Data variables: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>atoms</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-18c85580-860b-4be5-be6c-dfab7bdaa4b7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-18c85580-860b-4be5-be6c-dfab7bdaa4b7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0801c4a5-fd40-4956-924d-5871de1976c4' class='xr-var-data-in' type='checkbox'><label for='data-0801c4a5-fd40-4956-924d-5871de1976c4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
  975. " <tr>\n",
  976. " <td>\n",
  977. " <table style=\"border-collapse: collapse;\">\n",
  978. " <thead>\n",
  979. " <tr>\n",
  980. " <td> </td>\n",
  981. " <th> Array </th>\n",
  982. " <th> Chunk </th>\n",
  983. " </tr>\n",
  984. " </thead>\n",
  985. " <tbody>\n",
  986. " \n",
  987. " <tr>\n",
  988. " <th> Bytes </th>\n",
  989. " <td> 13.18 MiB </td>\n",
  990. " <td> 4.39 MiB </td>\n",
  991. " </tr>\n",
  992. " \n",
  993. " <tr>\n",
  994. " <th> Shape </th>\n",
  995. " <td> (3, 1200, 1920) </td>\n",
  996. " <td> (1, 1200, 1920) </td>\n",
  997. " </tr>\n",
  998. " <tr>\n",
  999. " <th> Dask graph </th>\n",
  1000. " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
  1001. " </tr>\n",
  1002. " <tr>\n",
  1003. " <th> Data type </th>\n",
  1004. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1005. " </tr>\n",
  1006. " </tbody>\n",
  1007. " </table>\n",
  1008. " </td>\n",
  1009. " <td>\n",
  1010. " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1011. "\n",
  1012. " <!-- Horizontal lines -->\n",
  1013. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1014. " <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1015. "\n",
  1016. " <!-- Vertical lines -->\n",
  1017. " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1018. " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
  1019. " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
  1020. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1021. "\n",
  1022. " <!-- Colored Rectangle -->\n",
  1023. " <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1024. "\n",
  1025. " <!-- Horizontal lines -->\n",
  1026. " <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1027. " <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
  1028. " <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
  1029. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1030. "\n",
  1031. " <!-- Vertical lines -->\n",
  1032. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1033. " <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1034. "\n",
  1035. " <!-- Colored Rectangle -->\n",
  1036. " <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1037. "\n",
  1038. " <!-- Horizontal lines -->\n",
  1039. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1040. " <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1041. "\n",
  1042. " <!-- Vertical lines -->\n",
  1043. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1044. " <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1045. "\n",
  1046. " <!-- Colored Rectangle -->\n",
  1047. " <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1048. "\n",
  1049. " <!-- Text -->\n",
  1050. " <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1051. " <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
  1052. " <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
  1053. "</svg>\n",
  1054. " </td>\n",
  1055. " </tr>\n",
  1056. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-48a73fd3-7731-4eb6-bcb7-d35cef143851' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-48a73fd3-7731-4eb6-bcb7-d35cef143851' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6d9bb466-2ed5-48b2-8991-b812f0633673' class='xr-var-data-in' type='checkbox'><label for='data-6d9bb466-2ed5-48b2-8991-b812f0633673' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
  1057. " <tr>\n",
  1058. " <td>\n",
  1059. " <table style=\"border-collapse: collapse;\">\n",
  1060. " <thead>\n",
  1061. " <tr>\n",
  1062. " <td> </td>\n",
  1063. " <th> Array </th>\n",
  1064. " <th> Chunk </th>\n",
  1065. " </tr>\n",
  1066. " </thead>\n",
  1067. " <tbody>\n",
  1068. " \n",
  1069. " <tr>\n",
  1070. " <th> Bytes </th>\n",
  1071. " <td> 13.18 MiB </td>\n",
  1072. " <td> 4.39 MiB </td>\n",
  1073. " </tr>\n",
  1074. " \n",
  1075. " <tr>\n",
  1076. " <th> Shape </th>\n",
  1077. " <td> (3, 1200, 1920) </td>\n",
  1078. " <td> (1, 1200, 1920) </td>\n",
  1079. " </tr>\n",
  1080. " <tr>\n",
  1081. " <th> Dask graph </th>\n",
  1082. " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
  1083. " </tr>\n",
  1084. " <tr>\n",
  1085. " <th> Data type </th>\n",
  1086. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1087. " </tr>\n",
  1088. " </tbody>\n",
  1089. " </table>\n",
  1090. " </td>\n",
  1091. " <td>\n",
  1092. " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1093. "\n",
  1094. " <!-- Horizontal lines -->\n",
  1095. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1096. " <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1097. "\n",
  1098. " <!-- Vertical lines -->\n",
  1099. " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1100. " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
  1101. " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
  1102. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1103. "\n",
  1104. " <!-- Colored Rectangle -->\n",
  1105. " <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1106. "\n",
  1107. " <!-- Horizontal lines -->\n",
  1108. " <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1109. " <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
  1110. " <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
  1111. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1112. "\n",
  1113. " <!-- Vertical lines -->\n",
  1114. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1115. " <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1116. "\n",
  1117. " <!-- Colored Rectangle -->\n",
  1118. " <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1119. "\n",
  1120. " <!-- Horizontal lines -->\n",
  1121. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1122. " <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1123. "\n",
  1124. " <!-- Vertical lines -->\n",
  1125. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1126. " <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1127. "\n",
  1128. " <!-- Colored Rectangle -->\n",
  1129. " <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1130. "\n",
  1131. " <!-- Text -->\n",
  1132. " <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1133. " <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
  1134. " <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
  1135. "</svg>\n",
  1136. " </td>\n",
  1137. " </tr>\n",
  1138. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-ced29619-3399-44f1-af13-2104035019ad' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ced29619-3399-44f1-af13-2104035019ad' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-55f03d0d-eeed-4a0c-8a02-ad327d3b47ef' class='xr-var-data-in' type='checkbox'><label for='data-55f03d0d-eeed-4a0c-8a02-ad327d3b47ef' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
  1139. " <tr>\n",
  1140. " <td>\n",
  1141. " <table style=\"border-collapse: collapse;\">\n",
  1142. " <thead>\n",
  1143. " <tr>\n",
  1144. " <td> </td>\n",
  1145. " <th> Array </th>\n",
  1146. " <th> Chunk </th>\n",
  1147. " </tr>\n",
  1148. " </thead>\n",
  1149. " <tbody>\n",
  1150. " \n",
  1151. " <tr>\n",
  1152. " <th> Bytes </th>\n",
  1153. " <td> 13.18 MiB </td>\n",
  1154. " <td> 4.39 MiB </td>\n",
  1155. " </tr>\n",
  1156. " \n",
  1157. " <tr>\n",
  1158. " <th> Shape </th>\n",
  1159. " <td> (3, 1200, 1920) </td>\n",
  1160. " <td> (1, 1200, 1920) </td>\n",
  1161. " </tr>\n",
  1162. " <tr>\n",
  1163. " <th> Dask graph </th>\n",
  1164. " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
  1165. " </tr>\n",
  1166. " <tr>\n",
  1167. " <th> Data type </th>\n",
  1168. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1169. " </tr>\n",
  1170. " </tbody>\n",
  1171. " </table>\n",
  1172. " </td>\n",
  1173. " <td>\n",
  1174. " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1175. "\n",
  1176. " <!-- Horizontal lines -->\n",
  1177. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1178. " <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1179. "\n",
  1180. " <!-- Vertical lines -->\n",
  1181. " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1182. " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
  1183. " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
  1184. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1185. "\n",
  1186. " <!-- Colored Rectangle -->\n",
  1187. " <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1188. "\n",
  1189. " <!-- Horizontal lines -->\n",
  1190. " <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1191. " <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
  1192. " <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
  1193. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1194. "\n",
  1195. " <!-- Vertical lines -->\n",
  1196. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1197. " <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1198. "\n",
  1199. " <!-- Colored Rectangle -->\n",
  1200. " <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1201. "\n",
  1202. " <!-- Horizontal lines -->\n",
  1203. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1204. " <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1205. "\n",
  1206. " <!-- Vertical lines -->\n",
  1207. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1208. " <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1209. "\n",
  1210. " <!-- Colored Rectangle -->\n",
  1211. " <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1212. "\n",
  1213. " <!-- Text -->\n",
  1214. " <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1215. " <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
  1216. " <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
  1217. "</svg>\n",
  1218. " </td>\n",
  1219. " </tr>\n",
  1220. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>(runs)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2</div><input id='attrs-06cd93c4-61f2-4562-8ba6-4c20d452e78b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-06cd93c4-61f2-4562-8ba6-4c20d452e78b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5ee97d7b-66bd-4c48-b1a3-53571521fef4' class='xr-var-data-in' type='checkbox'><label for='data-5ee97d7b-66bd-4c48-b1a3-53571521fef4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2], dtype=int64)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>OD</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1, 1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-c68900f2-6164-4204-843b-aa719b3b7b70' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c68900f2-6164-4204-843b-aa719b3b7b70' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f16fbad2-1a80-444c-bad8-56e3457eb05f' class='xr-var-data-in' type='checkbox'><label for='data-f16fbad2-1a80-444c-bad8-56e3457eb05f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
  1221. " <tr>\n",
  1222. " <td>\n",
  1223. " <table style=\"border-collapse: collapse;\">\n",
  1224. " <thead>\n",
  1225. " <tr>\n",
  1226. " <td> </td>\n",
  1227. " <th> Array </th>\n",
  1228. " <th> Chunk </th>\n",
  1229. " </tr>\n",
  1230. " </thead>\n",
  1231. " <tbody>\n",
  1232. " \n",
  1233. " <tr>\n",
  1234. " <th> Bytes </th>\n",
  1235. " <td> 52.73 MiB </td>\n",
  1236. " <td> 17.58 MiB </td>\n",
  1237. " </tr>\n",
  1238. " \n",
  1239. " <tr>\n",
  1240. " <th> Shape </th>\n",
  1241. " <td> (3, 1200, 1920) </td>\n",
  1242. " <td> (1, 1200, 1920) </td>\n",
  1243. " </tr>\n",
  1244. " <tr>\n",
  1245. " <th> Dask graph </th>\n",
  1246. " <td colspan=\"2\"> 3 chunks in 40 graph layers </td>\n",
  1247. " </tr>\n",
  1248. " <tr>\n",
  1249. " <th> Data type </th>\n",
  1250. " <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
  1251. " </tr>\n",
  1252. " </tbody>\n",
  1253. " </table>\n",
  1254. " </td>\n",
  1255. " <td>\n",
  1256. " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1257. "\n",
  1258. " <!-- Horizontal lines -->\n",
  1259. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1260. " <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1261. "\n",
  1262. " <!-- Vertical lines -->\n",
  1263. " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1264. " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
  1265. " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
  1266. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1267. "\n",
  1268. " <!-- Colored Rectangle -->\n",
  1269. " <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1270. "\n",
  1271. " <!-- Horizontal lines -->\n",
  1272. " <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1273. " <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
  1274. " <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
  1275. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1276. "\n",
  1277. " <!-- Vertical lines -->\n",
  1278. " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1279. " <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1280. "\n",
  1281. " <!-- Colored Rectangle -->\n",
  1282. " <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1283. "\n",
  1284. " <!-- Horizontal lines -->\n",
  1285. " <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
  1286. " <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1287. "\n",
  1288. " <!-- Vertical lines -->\n",
  1289. " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1290. " <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
  1291. "\n",
  1292. " <!-- Colored Rectangle -->\n",
  1293. " <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1294. "\n",
  1295. " <!-- Text -->\n",
  1296. " <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1297. " <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
  1298. " <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
  1299. "</svg>\n",
  1300. " </td>\n",
  1301. " </tr>\n",
  1302. "</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-5c3d2d31-aba4-4f09-afe5-e28bb74a7c71' class='xr-section-summary-in' type='checkbox' ><label for='section-5c3d2d31-aba4-4f09-afe5-e28bb74a7c71' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>runs</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-decca0b6-3468-41ab-9850-a5b69dadce82' class='xr-index-data-in' type='checkbox'/><label for='index-decca0b6-3468-41ab-9850-a5b69dadce82' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([0.0, 1.0, 2.0], dtype=&#x27;float64&#x27;, name=&#x27;runs&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f1e5c163-3f1f-4b5e-8a9d-be23047482a2' class='xr-section-summary-in' type='checkbox' ><label for='section-f1e5c163-3f1f-4b5e-8a9d-be23047482a2' class='xr-section-summary' >Attributes: <span>(96)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>TOF_free :</span></dt><dd>0.02</dd><dt><span>abs_img_freq :</span></dt><dd>110.858</dd><dt><span>absorption_imaging_flag :</span></dt><dd>True</dd><dt><span>backup_data :</span></dt><dd>True</dd><dt><span>blink_off_time :</span></dt><dd>nan</dd><dt><span>blink_on_time :</span></dt><dd>nan</dd><dt><span>c_duration :</span></dt><dd>0.2</dd><dt><span>cmot_final_current :</span></dt><dd>0.65</dd><dt><span>cmot_hold :</span></dt><dd>0.06</dd><dt><span>cmot_initial_current :</span></dt><dd>0.18</dd><dt><span>compX_current :</span></dt><dd>0.005</dd><dt><span>compX_current_sg :</span></dt><dd>0</dd><dt><span>compX_final_current :</span></dt><dd>0.002</dd><dt><span>compX_initial_current :</span></dt><dd>0.005</dd><dt><span>compY_current :</span></dt><dd>0</dd><dt><span>compY_current_sg :</span></dt><dd>0</dd><dt><span>compY_final_current :</span></dt><dd>0</dd><dt><span>compY_initial_current :</span></dt><dd>0</dd><dt><span>compZ_current :</span></dt><dd>0</dd><dt><span>compZ_current_sg :</span></dt><dd>0.189</dd><dt><span>compZ_final_current :</span></dt><dd>0.283</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_final_pow :</span></dt><dd>0.35</dd><dt><span>evap_1_arm_1_mod_depth_final :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_mod_depth_initial :</span></dt><dd>1.0</dd><dt><span>evap_1_arm_1_mod_ramp_duration :</span></dt><dd>1.15</dd><dt><span>evap_1_arm_1_pow_ramp_duration :</span></dt><dd>1.65</dd><dt><span>evap_1_arm_1_start_pow :</span></dt><dd>7</dd><dt><span>evap_1_arm_2_final_pow :</span></dt><dd>5</dd><dt><span>evap_1_arm_2_ramp_duration :</span></dt><dd>0.5</dd><dt><span>evap_1_arm_2_start_pow :</span></dt><dd>0</dd><dt><span>evap_1_mod_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_1_pow_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_1_rate_constant_1 :</span></dt><dd>0.525</dd><dt><span>evap_1_rate_constant_2 :</span></dt><dd>0.51</dd><dt><span>evap_2_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_2_arm_1_start_pow :</span></dt><dd>0.35</dd><dt><span>evap_2_arm_2_final_pow :</span></dt><dd>0.09</dd><dt><span>evap_2_arm_2_start_pow :</span></dt><dd>5</dd><dt><span>evap_2_ramp_duration :</span></dt><dd>1.0</dd><dt><span>evap_2_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_2_rate_constant_1 :</span></dt><dd>0.37</dd><dt><span>evap_2_rate_constant_2 :</span></dt><dd>0.71</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.1038</dd><dt><span>evap_3_arm_1_mod_depth_final :</span></dt><dd>0.43</dd><dt><span>evap_3_arm_1_mod_depth_initial :</span></dt><dd>0</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_ramp_duration :</span></dt><dd>0.1</dd><dt><span>evap_3_ramp_trunc_va
  1303. ],
  1304. "text/plain": [
  1305. "<xarray.Dataset>\n",
  1306. "Dimensions: (runs: 3, x: 1200, y: 1920)\n",
  1307. "Coordinates:\n",
  1308. " * runs (runs) float64 0.0 1.0 2.0\n",
  1309. "Dimensions without coordinates: x, y\n",
  1310. "Data variables:\n",
  1311. " atoms (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
  1312. " background (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
  1313. " dark (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
  1314. " shotNum (runs) int64 0 1 2\n",
  1315. " OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
  1316. "Attributes: (12/96)\n",
  1317. " TOF_free: 0.02\n",
  1318. " abs_img_freq: 110.858\n",
  1319. " absorption_imaging_flag: True\n",
  1320. " backup_data: True\n",
  1321. " blink_off_time: nan\n",
  1322. " blink_on_time: nan\n",
  1323. " ... ...\n",
  1324. " y_offset_img: 0\n",
  1325. " z_offset: 0.189\n",
  1326. " z_offset_img: 0.189\n",
  1327. " runs: [0. 1. 2.]\n",
  1328. " scanAxis: ['runs']\n",
  1329. " scanAxisLength: [3.]"
  1330. ]
  1331. },
  1332. "execution_count": 6,
  1333. "metadata": {},
  1334. "output_type": "execute_result"
  1335. }
  1336. ],
  1337. "source": [
  1338. "dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
  1339. "\n",
  1340. "dataSet"
  1341. ]
  1342. },
  1343. {
  1344. "attachments": {},
  1345. "cell_type": "markdown",
  1346. "metadata": {},
  1347. "source": [
  1348. "## Select region of interests"
  1349. ]
  1350. },
  1351. {
  1352. "cell_type": "code",
  1353. "execution_count": 9,
  1354. "metadata": {},
  1355. "outputs": [],
  1356. "source": [
  1357. "# imageAnalyser.center = (529, 962)\n",
  1358. "# imageAnalyser.span = (100,100)\n",
  1359. "# imageAnalyser.fraction = (0.1, 0.1)\n",
  1360. "\n",
  1361. "# imageAnalyser.center = (890, 1150)\n",
  1362. "# imageAnalyser.span = (600,600)\n",
  1363. "# imageAnalyser.fraction = (0.1, 0.1)\n",
  1364. "\n",
  1365. "imageAnalyser.center = (890, 950)\n",
  1366. "imageAnalyser.span = (100,100)\n",
  1367. "imageAnalyser.fraction = (0.1, 0.1)\n",
  1368. "\n",
  1369. "dataSet_crop = imageAnalyser.crop_image(dataSet)"
  1370. ]
  1371. },
  1372. {
  1373. "cell_type": "code",
  1374. "execution_count": 10,
  1375. "metadata": {},
  1376. "outputs": [
  1377. {
  1378. "data": {
  1379. "text/plain": [
  1380. "<xarray.plot.facetgrid.FacetGrid at 0x274b90445e0>"
  1381. ]
  1382. },
  1383. "execution_count": 10,
  1384. "metadata": {},
  1385. "output_type": "execute_result"
  1386. },
  1387. {
  1388. "data": {
  1389. "image/png": "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
  1390. "text/plain": [
  1391. "<Figure size 288x216 with 2 Axes>"
  1392. ]
  1393. },
  1394. "metadata": {
  1395. "needs_background": "light"
  1396. },
  1397. "output_type": "display_data"
  1398. }
  1399. ],
  1400. "source": [
  1401. "dataSet_crop.OD.isel(runs=[0]).plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
  1402. "# dataSet_crop.OD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0])"
  1403. ]
  1404. },
  1405. {
  1406. "attachments": {},
  1407. "cell_type": "markdown",
  1408. "metadata": {},
  1409. "source": [
  1410. "## Remove the background"
  1411. ]
  1412. },
  1413. {
  1414. "cell_type": "code",
  1415. "execution_count": null,
  1416. "metadata": {},
  1417. "outputs": [],
  1418. "source": [
  1419. "dataSet_crop['OD'] = dataSet_crop['OD'] + 500"
  1420. ]
  1421. },
  1422. {
  1423. "cell_type": "code",
  1424. "execution_count": null,
  1425. "metadata": {},
  1426. "outputs": [],
  1427. "source": [
  1428. "dataSet_crop['OD'] = imageAnalyser.substract_offset(dataSet_crop['OD'])"
  1429. ]
  1430. },
  1431. {
  1432. "attachments": {},
  1433. "cell_type": "markdown",
  1434. "metadata": {},
  1435. "source": [
  1436. "# Test Fit"
  1437. ]
  1438. },
  1439. {
  1440. "cell_type": "code",
  1441. "execution_count": null,
  1442. "metadata": {},
  1443. "outputs": [],
  1444. "source": [
  1445. "fitAnalyser = FitAnalyser(\"Two Gaussian-2D\", fitDim=2)\n",
  1446. "\n",
  1447. "params = fitAnalyser.guess(dataSet_crop.OD, dask=\"parallelized\")"
  1448. ]
  1449. },
  1450. {
  1451. "cell_type": "code",
  1452. "execution_count": null,
  1453. "metadata": {},
  1454. "outputs": [],
  1455. "source": [
  1456. "fitResult = fitAnalyser.fit(dataSet_crop.OD, params).load()"
  1457. ]
  1458. },
  1459. {
  1460. "cell_type": "code",
  1461. "execution_count": null,
  1462. "metadata": {},
  1463. "outputs": [],
  1464. "source": [
  1465. "fitCurve = fitAnalyser.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()"
  1466. ]
  1467. },
  1468. {
  1469. "cell_type": "code",
  1470. "execution_count": null,
  1471. "metadata": {},
  1472. "outputs": [],
  1473. "source": [
  1474. "# fitCurve.isel(**{scanAxis[0]:np.arange(30), 'runs':range(dataSet_crop.OD['runs'].size)}).plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
  1475. "\n",
  1476. "fitCurve.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0])"
  1477. ]
  1478. },
  1479. {
  1480. "cell_type": "code",
  1481. "execution_count": null,
  1482. "metadata": {},
  1483. "outputs": [],
  1484. "source": [
  1485. "a = fitAnalyser.get_fit_value(fitResult)\n",
  1486. "b = fitAnalyser.get_fit_std(fitResult)\n",
  1487. "data = combine_uncertainty(a, b)"
  1488. ]
  1489. },
  1490. {
  1491. "attachments": {},
  1492. "cell_type": "markdown",
  1493. "metadata": {},
  1494. "source": [
  1495. "# Get the Ncount"
  1496. ]
  1497. },
  1498. {
  1499. "cell_type": "code",
  1500. "execution_count": null,
  1501. "metadata": {},
  1502. "outputs": [],
  1503. "source": [
  1504. "Ncount = dataSet_crop.OD.sum(dim=(scanAxis[0], 'x', 'y'))"
  1505. ]
  1506. },
  1507. {
  1508. "cell_type": "code",
  1509. "execution_count": null,
  1510. "metadata": {},
  1511. "outputs": [],
  1512. "source": [
  1513. "Ncount.load()\n",
  1514. "\n",
  1515. "fig = plt.figure()\n",
  1516. "ax = fig.gca()\n",
  1517. "Ncount.plot(ax=ax)"
  1518. ]
  1519. },
  1520. {
  1521. "cell_type": "code",
  1522. "execution_count": null,
  1523. "metadata": {},
  1524. "outputs": [],
  1525. "source": [
  1526. "fitAnalyser = FitAnalyser(\"Lorentzian With Offset\")\n",
  1527. "params = fitAnalyser.guess(Ncount, x='sin_mod_freq', dask=\"parallelized\", guess_kwargs=dict(negative=True))"
  1528. ]
  1529. },
  1530. {
  1531. "cell_type": "code",
  1532. "execution_count": null,
  1533. "metadata": {},
  1534. "outputs": [],
  1535. "source": [
  1536. "fitResult = fitAnalyser.fit(Ncount, params, x='sin_mod_freq', dask=\"parallelized\")\n",
  1537. "fitCurve = fitAnalyser.eval(fitResult, x=np.arange(40), dask=\"parallelized\").load()"
  1538. ]
  1539. },
  1540. {
  1541. "cell_type": "code",
  1542. "execution_count": null,
  1543. "metadata": {},
  1544. "outputs": [],
  1545. "source": [
  1546. "fig = plt.figure()\n",
  1547. "ax = fig.gca()\n",
  1548. "plt.errorbar([1], [1], yerr=[1])"
  1549. ]
  1550. },
  1551. {
  1552. "cell_type": "code",
  1553. "execution_count": null,
  1554. "metadata": {},
  1555. "outputs": [],
  1556. "source": [
  1557. "fitCurve.plot.errorbar(yerr=fitCurve)"
  1558. ]
  1559. },
  1560. {
  1561. "cell_type": "code",
  1562. "execution_count": null,
  1563. "metadata": {},
  1564. "outputs": [],
  1565. "source": [
  1566. "np.ufunc(fitCurve)"
  1567. ]
  1568. },
  1569. {
  1570. "cell_type": "code",
  1571. "execution_count": null,
  1572. "metadata": {},
  1573. "outputs": [],
  1574. "source": []
  1575. }
  1576. ],
  1577. "metadata": {
  1578. "kernelspec": {
  1579. "display_name": "env",
  1580. "language": "python",
  1581. "name": "python3"
  1582. },
  1583. "language_info": {
  1584. "codemirror_mode": {
  1585. "name": "ipython",
  1586. "version": 3
  1587. },
  1588. "file_extension": ".py",
  1589. "mimetype": "text/x-python",
  1590. "name": "python",
  1591. "nbconvert_exporter": "python",
  1592. "pygments_lexer": "ipython3",
  1593. "version": "3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]"
  1594. },
  1595. "orig_nbformat": 4,
  1596. "vscode": {
  1597. "interpreter": {
  1598. "hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
  1599. }
  1600. }
  1601. },
  1602. "nbformat": 4,
  1603. "nbformat_minor": 2
  1604. }