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.

1340 lines
259 KiB

1 year ago
  1. {
  2. "cells": [
  3. {
  4. "attachments": {},
  5. "cell_type": "markdown",
  6. "metadata": {},
  7. "source": [
  8. "# How to read data from HFD5 files"
  9. ]
  10. },
  11. {
  12. "attachments": {},
  13. "cell_type": "markdown",
  14. "metadata": {},
  15. "source": [
  16. "This is an example to read the data from those HDF5 files generated by LabScript.\n",
  17. "\n",
  18. "The idea is that one just need to give\n",
  19. "\n",
  20. "+ The path where data is stored\n",
  21. "+ The date of the data\n",
  22. "+ The shot number\n",
  23. "+ The path of data in HDF5 file (i.e. the name of group)\n",
  24. "\n",
  25. "It can automatically find the scan axes, and package all of them into an object of DataSet() in xarray package.\n",
  26. "\n",
  27. "Let us start with importing the supporting packages. In order to keep things ealier, here we will import all the packages, but not all of them will be used."
  28. ]
  29. },
  30. {
  31. "attachments": {},
  32. "cell_type": "markdown",
  33. "metadata": {},
  34. "source": [
  35. "## Import supporting packages"
  36. ]
  37. },
  38. {
  39. "cell_type": "code",
  40. "execution_count": 1,
  41. "metadata": {},
  42. "outputs": [],
  43. "source": [
  44. "import copy\n",
  45. "import glob\n",
  46. "from datetime import datetime\n",
  47. "\n",
  48. "# The package for data structure\n",
  49. "import xarray as xr\n",
  50. "import pandas as pd\n",
  51. "import numpy as np\n",
  52. "\n",
  53. "# The packages for working with uncertainties\n",
  54. "from uncertainties import ufloat\n",
  55. "from uncertainties import unumpy as unp\n",
  56. "from uncertainties import umath\n",
  57. "\n",
  58. "# The package for plotting\n",
  59. "import matplotlib.pyplot as plt\n",
  60. "plt.rcParams['font.size'] = 18 # Set the global font size\n",
  61. "\n",
  62. "# -------------- The modules written by us --------------\n",
  63. "\n",
  64. "# The packages for read data\n",
  65. "from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
  66. "\n",
  67. "# The packages for data analysis\n",
  68. "from Analyser.ImagingAnalyser import ImageAnalyser\n",
  69. "from Analyser.FitAnalyser import FitAnalyser\n",
  70. "from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
  71. "from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
  72. "from ToolFunction.ToolFunction import *\n",
  73. "\n",
  74. "# Add errorbar plot to xarray package\n",
  75. "from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
  76. "xr.plot.dataarray_plot.errorbar = errorbar\n",
  77. "xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar"
  78. ]
  79. },
  80. {
  81. "attachments": {},
  82. "cell_type": "markdown",
  83. "metadata": {},
  84. "source": [
  85. "If one wants to read tens or few hundreds files, a normal script can finish in several minutes."
  86. ]
  87. },
  88. {
  89. "attachments": {},
  90. "cell_type": "markdown",
  91. "metadata": {},
  92. "source": [
  93. "## Start a client for parallel computing"
  94. ]
  95. },
  96. {
  97. "cell_type": "code",
  98. "execution_count": null,
  99. "metadata": {},
  100. "outputs": [
  101. {
  102. "data": {
  103. "text/html": [
  104. "<div>\n",
  105. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
  106. " <div style=\"margin-left: 48px;\">\n",
  107. " <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
  108. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-f3431762-0b91-11ee-bc80-80e82ce2fa8e</p>\n",
  109. " <table style=\"width: 100%; text-align: left;\">\n",
  110. "\n",
  111. " <tr>\n",
  112. " \n",
  113. " <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
  114. " <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
  115. " \n",
  116. " </tr>\n",
  117. "\n",
  118. " \n",
  119. " <tr>\n",
  120. " <td style=\"text-align: left;\">\n",
  121. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  122. " </td>\n",
  123. " <td style=\"text-align: left;\"></td>\n",
  124. " </tr>\n",
  125. " \n",
  126. "\n",
  127. " </table>\n",
  128. "\n",
  129. " \n",
  130. "\n",
  131. " \n",
  132. " <details>\n",
  133. " <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
  134. " <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
  135. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
  136. " </div>\n",
  137. " <div style=\"margin-left: 48px;\">\n",
  138. " <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
  139. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">6e648e73</p>\n",
  140. " <table style=\"width: 100%; text-align: left;\">\n",
  141. " <tr>\n",
  142. " <td style=\"text-align: left;\">\n",
  143. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  144. " </td>\n",
  145. " <td style=\"text-align: left;\">\n",
  146. " <strong>Workers:</strong> 6\n",
  147. " </td>\n",
  148. " </tr>\n",
  149. " <tr>\n",
  150. " <td style=\"text-align: left;\">\n",
  151. " <strong>Total threads:</strong> 60\n",
  152. " </td>\n",
  153. " <td style=\"text-align: left;\">\n",
  154. " <strong>Total memory:</strong> 55.88 GiB\n",
  155. " </td>\n",
  156. " </tr>\n",
  157. " \n",
  158. " <tr>\n",
  159. " <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
  160. " <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
  161. "</tr>\n",
  162. "\n",
  163. " \n",
  164. " </table>\n",
  165. "\n",
  166. " <details>\n",
  167. " <summary style=\"margin-bottom: 20px;\">\n",
  168. " <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
  169. " </summary>\n",
  170. "\n",
  171. " <div style=\"\">\n",
  172. " <div>\n",
  173. " <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
  174. " <div style=\"margin-left: 48px;\">\n",
  175. " <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
  176. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-669a9b65-bae9-4798-96b7-f5d552eb72f9</p>\n",
  177. " <table style=\"width: 100%; text-align: left;\">\n",
  178. " <tr>\n",
  179. " <td style=\"text-align: left;\">\n",
  180. " <strong>Comm:</strong> tcp://127.0.0.1:51057\n",
  181. " </td>\n",
  182. " <td style=\"text-align: left;\">\n",
  183. " <strong>Workers:</strong> 6\n",
  184. " </td>\n",
  185. " </tr>\n",
  186. " <tr>\n",
  187. " <td style=\"text-align: left;\">\n",
  188. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  189. " </td>\n",
  190. " <td style=\"text-align: left;\">\n",
  191. " <strong>Total threads:</strong> 60\n",
  192. " </td>\n",
  193. " </tr>\n",
  194. " <tr>\n",
  195. " <td style=\"text-align: left;\">\n",
  196. " <strong>Started:</strong> Just now\n",
  197. " </td>\n",
  198. " <td style=\"text-align: left;\">\n",
  199. " <strong>Total memory:</strong> 55.88 GiB\n",
  200. " </td>\n",
  201. " </tr>\n",
  202. " </table>\n",
  203. " </div>\n",
  204. " </div>\n",
  205. "\n",
  206. " <details style=\"margin-left: 48px;\">\n",
  207. " <summary style=\"margin-bottom: 20px;\">\n",
  208. " <h3 style=\"display: inline;\">Workers</h3>\n",
  209. " </summary>\n",
  210. "\n",
  211. " \n",
  212. " <div style=\"margin-bottom: 20px;\">\n",
  213. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  214. " <div style=\"margin-left: 48px;\">\n",
  215. " <details>\n",
  216. " <summary>\n",
  217. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
  218. " </summary>\n",
  219. " <table style=\"width: 100%; text-align: left;\">\n",
  220. " <tr>\n",
  221. " <td style=\"text-align: left;\">\n",
  222. " <strong>Comm: </strong> tcp://127.0.0.1:51088\n",
  223. " </td>\n",
  224. " <td style=\"text-align: left;\">\n",
  225. " <strong>Total threads: </strong> 10\n",
  226. " </td>\n",
  227. " </tr>\n",
  228. " <tr>\n",
  229. " <td style=\"text-align: left;\">\n",
  230. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51093/status\" target=\"_blank\">http://127.0.0.1:51093/status</a>\n",
  231. " </td>\n",
  232. " <td style=\"text-align: left;\">\n",
  233. " <strong>Memory: </strong> 9.31 GiB\n",
  234. " </td>\n",
  235. " </tr>\n",
  236. " <tr>\n",
  237. " <td style=\"text-align: left;\">\n",
  238. " <strong>Nanny: </strong> tcp://127.0.0.1:51060\n",
  239. " </td>\n",
  240. " <td style=\"text-align: left;\"></td>\n",
  241. " </tr>\n",
  242. " <tr>\n",
  243. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  244. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-9s507mc2\n",
  245. " </td>\n",
  246. " </tr>\n",
  247. "\n",
  248. " \n",
  249. "\n",
  250. " \n",
  251. "\n",
  252. " </table>\n",
  253. " </details>\n",
  254. " </div>\n",
  255. " </div>\n",
  256. " \n",
  257. " <div style=\"margin-bottom: 20px;\">\n",
  258. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  259. " <div style=\"margin-left: 48px;\">\n",
  260. " <details>\n",
  261. " <summary>\n",
  262. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
  263. " </summary>\n",
  264. " <table style=\"width: 100%; text-align: left;\">\n",
  265. " <tr>\n",
  266. " <td style=\"text-align: left;\">\n",
  267. " <strong>Comm: </strong> tcp://127.0.0.1:51084\n",
  268. " </td>\n",
  269. " <td style=\"text-align: left;\">\n",
  270. " <strong>Total threads: </strong> 10\n",
  271. " </td>\n",
  272. " </tr>\n",
  273. " <tr>\n",
  274. " <td style=\"text-align: left;\">\n",
  275. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51085/status\" target=\"_blank\">http://127.0.0.1:51085/status</a>\n",
  276. " </td>\n",
  277. " <td style=\"text-align: left;\">\n",
  278. " <strong>Memory: </strong> 9.31 GiB\n",
  279. " </td>\n",
  280. " </tr>\n",
  281. " <tr>\n",
  282. " <td style=\"text-align: left;\">\n",
  283. " <strong>Nanny: </strong> tcp://127.0.0.1:51061\n",
  284. " </td>\n",
  285. " <td style=\"text-align: left;\"></td>\n",
  286. " </tr>\n",
  287. " <tr>\n",
  288. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  289. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-y5skkt4c\n",
  290. " </td>\n",
  291. " </tr>\n",
  292. "\n",
  293. " \n",
  294. "\n",
  295. " \n",
  296. "\n",
  297. " </table>\n",
  298. " </details>\n",
  299. " </div>\n",
  300. " </div>\n",
  301. " \n",
  302. " <div style=\"margin-bottom: 20px;\">\n",
  303. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  304. " <div style=\"margin-left: 48px;\">\n",
  305. " <details>\n",
  306. " <summary>\n",
  307. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
  308. " </summary>\n",
  309. " <table style=\"width: 100%; text-align: left;\">\n",
  310. " <tr>\n",
  311. " <td style=\"text-align: left;\">\n",
  312. " <strong>Comm: </strong> tcp://127.0.0.1:51098\n",
  313. " </td>\n",
  314. " <td style=\"text-align: left;\">\n",
  315. " <strong>Total threads: </strong> 10\n",
  316. " </td>\n",
  317. " </tr>\n",
  318. " <tr>\n",
  319. " <td style=\"text-align: left;\">\n",
  320. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51100/status\" target=\"_blank\">http://127.0.0.1:51100/status</a>\n",
  321. " </td>\n",
  322. " <td style=\"text-align: left;\">\n",
  323. " <strong>Memory: </strong> 9.31 GiB\n",
  324. " </td>\n",
  325. " </tr>\n",
  326. " <tr>\n",
  327. " <td style=\"text-align: left;\">\n",
  328. " <strong>Nanny: </strong> tcp://127.0.0.1:51062\n",
  329. " </td>\n",
  330. " <td style=\"text-align: left;\"></td>\n",
  331. " </tr>\n",
  332. " <tr>\n",
  333. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  334. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-gmddkxg0\n",
  335. " </td>\n",
  336. " </tr>\n",
  337. "\n",
  338. " \n",
  339. "\n",
  340. " \n",
  341. "\n",
  342. " </table>\n",
  343. " </details>\n",
  344. " </div>\n",
  345. " </div>\n",
  346. " \n",
  347. " <div style=\"margin-bottom: 20px;\">\n",
  348. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  349. " <div style=\"margin-left: 48px;\">\n",
  350. " <details>\n",
  351. " <summary>\n",
  352. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
  353. " </summary>\n",
  354. " <table style=\"width: 100%; text-align: left;\">\n",
  355. " <tr>\n",
  356. " <td style=\"text-align: left;\">\n",
  357. " <strong>Comm: </strong> tcp://127.0.0.1:51095\n",
  358. " </td>\n",
  359. " <td style=\"text-align: left;\">\n",
  360. " <strong>Total threads: </strong> 10\n",
  361. " </td>\n",
  362. " </tr>\n",
  363. " <tr>\n",
  364. " <td style=\"text-align: left;\">\n",
  365. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51096/status\" target=\"_blank\">http://127.0.0.1:51096/status</a>\n",
  366. " </td>\n",
  367. " <td style=\"text-align: left;\">\n",
  368. " <strong>Memory: </strong> 9.31 GiB\n",
  369. " </td>\n",
  370. " </tr>\n",
  371. " <tr>\n",
  372. " <td style=\"text-align: left;\">\n",
  373. " <strong>Nanny: </strong> tcp://127.0.0.1:51063\n",
  374. " </td>\n",
  375. " <td style=\"text-align: left;\"></td>\n",
  376. " </tr>\n",
  377. " <tr>\n",
  378. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  379. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-oycines6\n",
  380. " </td>\n",
  381. " </tr>\n",
  382. "\n",
  383. " \n",
  384. "\n",
  385. " \n",
  386. "\n",
  387. " </table>\n",
  388. " </details>\n",
  389. " </div>\n",
  390. " </div>\n",
  391. " \n",
  392. " <div style=\"margin-bottom: 20px;\">\n",
  393. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  394. " <div style=\"margin-left: 48px;\">\n",
  395. " <details>\n",
  396. " <summary>\n",
  397. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
  398. " </summary>\n",
  399. " <table style=\"width: 100%; text-align: left;\">\n",
  400. " <tr>\n",
  401. " <td style=\"text-align: left;\">\n",
  402. " <strong>Comm: </strong> tcp://127.0.0.1:51087\n",
  403. " </td>\n",
  404. " <td style=\"text-align: left;\">\n",
  405. " <strong>Total threads: </strong> 10\n",
  406. " </td>\n",
  407. " </tr>\n",
  408. " <tr>\n",
  409. " <td style=\"text-align: left;\">\n",
  410. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51091/status\" target=\"_blank\">http://127.0.0.1:51091/status</a>\n",
  411. " </td>\n",
  412. " <td style=\"text-align: left;\">\n",
  413. " <strong>Memory: </strong> 9.31 GiB\n",
  414. " </td>\n",
  415. " </tr>\n",
  416. " <tr>\n",
  417. " <td style=\"text-align: left;\">\n",
  418. " <strong>Nanny: </strong> tcp://127.0.0.1:51064\n",
  419. " </td>\n",
  420. " <td style=\"text-align: left;\"></td>\n",
  421. " </tr>\n",
  422. " <tr>\n",
  423. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  424. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-a8kpxp6o\n",
  425. " </td>\n",
  426. " </tr>\n",
  427. "\n",
  428. " \n",
  429. "\n",
  430. " \n",
  431. "\n",
  432. " </table>\n",
  433. " </details>\n",
  434. " </div>\n",
  435. " </div>\n",
  436. " \n",
  437. " <div style=\"margin-bottom: 20px;\">\n",
  438. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  439. " <div style=\"margin-left: 48px;\">\n",
  440. " <details>\n",
  441. " <summary>\n",
  442. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
  443. " </summary>\n",
  444. " <table style=\"width: 100%; text-align: left;\">\n",
  445. " <tr>\n",
  446. " <td style=\"text-align: left;\">\n",
  447. " <strong>Comm: </strong> tcp://127.0.0.1:51099\n",
  448. " </td>\n",
  449. " <td style=\"text-align: left;\">\n",
  450. " <strong>Total threads: </strong> 10\n",
  451. " </td>\n",
  452. " </tr>\n",
  453. " <tr>\n",
  454. " <td style=\"text-align: left;\">\n",
  455. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:51101/status\" target=\"_blank\">http://127.0.0.1:51101/status</a>\n",
  456. " </td>\n",
  457. " <td style=\"text-align: left;\">\n",
  458. " <strong>Memory: </strong> 9.31 GiB\n",
  459. " </td>\n",
  460. " </tr>\n",
  461. " <tr>\n",
  462. " <td style=\"text-align: left;\">\n",
  463. " <strong>Nanny: </strong> tcp://127.0.0.1:51065\n",
  464. " </td>\n",
  465. " <td style=\"text-align: left;\"></td>\n",
  466. " </tr>\n",
  467. " <tr>\n",
  468. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  469. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-thoxr07z\n",
  470. " </td>\n",
  471. " </tr>\n",
  472. "\n",
  473. " \n",
  474. "\n",
  475. " \n",
  476. "\n",
  477. " </table>\n",
  478. " </details>\n",
  479. " </div>\n",
  480. " </div>\n",
  481. " \n",
  482. "\n",
  483. " </details>\n",
  484. "</div>\n",
  485. "\n",
  486. " </details>\n",
  487. " </div>\n",
  488. "</div>\n",
  489. " </details>\n",
  490. " \n",
  491. "\n",
  492. " </div>\n",
  493. "</div>"
  494. ],
  495. "text/plain": [
  496. "<Client: 'tcp://127.0.0.1:51057' processes=6 threads=60, memory=55.88 GiB>"
  497. ]
  498. },
  499. "metadata": {},
  500. "output_type": "display_data"
  501. }
  502. ],
  503. "source": [
  504. "from dask.distributed import Client\n",
  505. "client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
  506. "client"
  507. ]
  508. },
  509. {
  510. "cell_type": "code",
  511. "execution_count": null,
  512. "metadata": {},
  513. "outputs": [],
  514. "source": [
  515. "imageAnalyser = ImageAnalyser()"
  516. ]
  517. },
  518. {
  519. "attachments": {},
  520. "cell_type": "markdown",
  521. "metadata": {},
  522. "source": [
  523. "## Set global path for experiment"
  524. ]
  525. },
  526. {
  527. "cell_type": "code",
  528. "execution_count": 68,
  529. "metadata": {},
  530. "outputs": [],
  531. "source": [
  532. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/03/0043/*.h5\"\n",
  533. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/2023-04-18_0003_Evaporative_Cooling_000.h5\"\n",
  534. "\n",
  535. "# filepath = \"//DyLabNAS/Data/Repetition_scan/2023/04/21/0002/*.h5\"\n",
  536. "\n",
  537. "# filepath = r\"./testData/0002/*.h5\"\n",
  538. "\n",
  539. "# filepath = r\"./testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5\"\n",
  540. "\n",
  541. "# filepath = r'd:/Jianshun Gao/Simulations/analyseScripts/testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5'\n",
  542. "\n",
  543. "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
  544. "\n",
  545. "filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\"\n",
  546. "\n",
  547. "# filepath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_13.h5'"
  548. ]
  549. },
  550. {
  551. "cell_type": "code",
  552. "execution_count": 69,
  553. "metadata": {},
  554. "outputs": [],
  555. "source": [
  556. "groupList = [\n",
  557. " \"images/MOT_3D_Camera/in_situ_absorption\",\n",
  558. " \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
  559. " \"images/ODT_2_Axis_Camera/in_situ_absorption\",\n",
  560. "]\n",
  561. "\n",
  562. "dskey = {\n",
  563. " \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_1\",\n",
  564. " \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
  565. " \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_3\",\n",
  566. "}\n"
  567. ]
  568. },
  569. {
  570. "cell_type": "code",
  571. "execution_count": 70,
  572. "metadata": {},
  573. "outputs": [],
  574. "source": [
  575. "img_dir = '//DyLabNAS/Data/'\n",
  576. "SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
  577. "folderPath = img_dir + SequenceName + '2023/05/23'# get_date()"
  578. ]
  579. },
  580. {
  581. "attachments": {},
  582. "cell_type": "markdown",
  583. "metadata": {},
  584. "source": [
  585. "# An example for one experimental run"
  586. ]
  587. },
  588. {
  589. "attachments": {},
  590. "cell_type": "markdown",
  591. "metadata": {},
  592. "source": [
  593. "## Load the data"
  594. ]
  595. },
  596. {
  597. "cell_type": "code",
  598. "execution_count": 75,
  599. "metadata": {},
  600. "outputs": [
  601. {
  602. "name": "stderr",
  603. "output_type": "stream",
  604. "text": [
  605. "f:\\Jianshun\\analyseScript\\DataContainer\\ReadData.py:178: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n",
  606. " if not key in datesetOfGlobal.scanAxis\n"
  607. ]
  608. },
  609. {
  610. "data": {
  611. "text/html": [
  612. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  613. "<defs>\n",
  614. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  615. "<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",
  616. "<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",
  617. "<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",
  618. "</symbol>\n",
  619. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  620. "<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",
  621. "<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",
  622. "<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",
  623. "<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",
  624. "</symbol>\n",
  625. "</defs>\n",
  626. "</svg>\n",
  627. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  628. " *\n",
  629. " */\n",
  630. "\n",
  631. ":root {\n",
  632. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  633. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  634. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  635. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  636. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  637. " --xr-background-color: var(--jp-layout-color0, white);\n",
  638. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  639. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  640. "}\n",
  641. "\n",
  642. "html[theme=dark],\n",
  643. "body[data-theme=dark],\n",
  644. "body.vscode-dark {\n",
  645. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  646. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  647. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  648. " --xr-border-color: #1F1F1F;\n",
  649. " --xr-disabled-color: #515151;\n",
  650. " --xr-background-color: #111111;\n",
  651. " --xr-background-color-row-even: #111111;\n",
  652. " --xr-background-color-row-odd: #313131;\n",
  653. "}\n",
  654. "\n",
  655. ".xr-wrap {\n",
  656. " display: block !important;\n",
  657. " min-width: 300px;\n",
  658. " max-width: 700px;\n",
  659. "}\n",
  660. "\n",
  661. ".xr-text-repr-fallback {\n",
  662. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  663. " display: none;\n",
  664. "}\n",
  665. "\n",
  666. ".xr-header {\n",
  667. " padding-top: 6px;\n",
  668. " padding-bottom: 6px;\n",
  669. " margin-bottom: 4px;\n",
  670. " border-bottom: solid 1px var(--xr-border-color);\n",
  671. "}\n",
  672. "\n",
  673. ".xr-header > div,\n",
  674. ".xr-header > ul {\n",
  675. " display: inline;\n",
  676. " margin-top: 0;\n",
  677. " margin-bottom: 0;\n",
  678. "}\n",
  679. "\n",
  680. ".xr-obj-type,\n",
  681. ".xr-array-name {\n",
  682. " margin-left: 2px;\n",
  683. " margin-right: 10px;\n",
  684. "}\n",
  685. "\n",
  686. ".xr-obj-type {\n",
  687. " color: var(--xr-font-color2);\n",
  688. "}\n",
  689. "\n",
  690. ".xr-sections {\n",
  691. " padding-left: 0 !important;\n",
  692. " display: grid;\n",
  693. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  694. "}\n",
  695. "\n",
  696. ".xr-section-item {\n",
  697. " display: contents;\n",
  698. "}\n",
  699. "\n",
  700. ".xr-section-item input {\n",
  701. " display: none;\n",
  702. "}\n",
  703. "\n",
  704. ".xr-section-item input + label {\n",
  705. " color: var(--xr-disabled-color);\n",
  706. "}\n",
  707. "\n",
  708. ".xr-section-item input:enabled + label {\n",
  709. " cursor: pointer;\n",
  710. " color: var(--xr-font-color2);\n",
  711. "}\n",
  712. "\n",
  713. ".xr-section-item input:enabled + label:hover {\n",
  714. " color: var(--xr-font-color0);\n",
  715. "}\n",
  716. "\n",
  717. ".xr-section-summary {\n",
  718. " grid-column: 1;\n",
  719. " color: var(--xr-font-color2);\n",
  720. " font-weight: 500;\n",
  721. "}\n",
  722. "\n",
  723. ".xr-section-summary > span {\n",
  724. " display: inline-block;\n",
  725. " padding-left: 0.5em;\n",
  726. "}\n",
  727. "\n",
  728. ".xr-section-summary-in:disabled + label {\n",
  729. " color: var(--xr-font-color2);\n",
  730. "}\n",
  731. "\n",
  732. ".xr-section-summary-in + label:before {\n",
  733. " display: inline-block;\n",
  734. " content: 'â–º';\n",
  735. " font-size: 11px;\n",
  736. " width: 15px;\n",
  737. " text-align: center;\n",
  738. "}\n",
  739. "\n",
  740. ".xr-section-summary-in:disabled + label:before {\n",
  741. " color: var(--xr-disabled-color);\n",
  742. "}\n",
  743. "\n",
  744. ".xr-section-summary-in:checked + label:before {\n",
  745. " content: 'â–¼';\n",
  746. "}\n",
  747. "\n",
  748. ".xr-section-summary-in:checked + label > span {\n",
  749. " display: none;\n",
  750. "}\n",
  751. "\n",
  752. ".xr-section-summary,\n",
  753. ".xr-section-inline-details {\n",
  754. " padding-top: 4px;\n",
  755. " padding-bottom: 4px;\n",
  756. "}\n",
  757. "\n",
  758. ".xr-section-inline-details {\n",
  759. " grid-column: 2 / -1;\n",
  760. "}\n",
  761. "\n",
  762. ".xr-section-details {\n",
  763. " display: none;\n",
  764. " grid-column: 1 / -1;\n",
  765. " margin-bottom: 5px;\n",
  766. "}\n",
  767. "\n",
  768. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  769. " display: contents;\n",
  770. "}\n",
  771. "\n",
  772. ".xr-array-wrap {\n",
  773. " grid-column: 1 / -1;\n",
  774. " display: grid;\n",
  775. " grid-template-columns: 20px auto;\n",
  776. "}\n",
  777. "\n",
  778. ".xr-array-wrap > label {\n",
  779. " grid-column: 1;\n",
  780. " vertical-align: top;\n",
  781. "}\n",
  782. "\n",
  783. ".xr-preview {\n",
  784. " color: var(--xr-font-color3);\n",
  785. "}\n",
  786. "\n",
  787. ".xr-array-preview,\n",
  788. ".xr-array-data {\n",
  789. " padding: 0 5px !important;\n",
  790. " grid-column: 2;\n",
  791. "}\n",
  792. "\n",
  793. ".xr-array-data,\n",
  794. ".xr-array-in:checked ~ .xr-array-preview {\n",
  795. " display: none;\n",
  796. "}\n",
  797. "\n",
  798. ".xr-array-in:checked ~ .xr-array-data,\n",
  799. ".xr-array-preview {\n",
  800. " display: inline-block;\n",
  801. "}\n",
  802. "\n",
  803. ".xr-dim-list {\n",
  804. " display: inline-block !important;\n",
  805. " list-style: none;\n",
  806. " padding: 0 !important;\n",
  807. " margin: 0;\n",
  808. "}\n",
  809. "\n",
  810. ".xr-dim-list li {\n",
  811. " display: inline-block;\n",
  812. " padding: 0;\n",
  813. " margin: 0;\n",
  814. "}\n",
  815. "\n",
  816. ".xr-dim-list:before {\n",
  817. " content: '(';\n",
  818. "}\n",
  819. "\n",
  820. ".xr-dim-list:after {\n",
  821. " content: ')';\n",
  822. "}\n",
  823. "\n",
  824. ".xr-dim-list li:not(:last-child):after {\n",
  825. " content: ',';\n",
  826. " padding-right: 5px;\n",
  827. "}\n",
  828. "\n",
  829. ".xr-has-index {\n",
  830. " font-weight: bold;\n",
  831. "}\n",
  832. "\n",
  833. ".xr-var-list,\n",
  834. ".xr-var-item {\n",
  835. " display: contents;\n",
  836. "}\n",
  837. "\n",
  838. ".xr-var-item > div,\n",
  839. ".xr-var-item label,\n",
  840. ".xr-var-item > .xr-var-name span {\n",
  841. " background-color: var(--xr-background-color-row-even);\n",
  842. " margin-bottom: 0;\n",
  843. "}\n",
  844. "\n",
  845. ".xr-var-item > .xr-var-name:hover span {\n",
  846. " padding-right: 5px;\n",
  847. "}\n",
  848. "\n",
  849. ".xr-var-list > li:nth-child(odd) > div,\n",
  850. ".xr-var-list > li:nth-child(odd) > label,\n",
  851. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  852. " background-color: var(--xr-background-color-row-odd);\n",
  853. "}\n",
  854. "\n",
  855. ".xr-var-name {\n",
  856. " grid-column: 1;\n",
  857. "}\n",
  858. "\n",
  859. ".xr-var-dims {\n",
  860. " grid-column: 2;\n",
  861. "}\n",
  862. "\n",
  863. ".xr-var-dtype {\n",
  864. " grid-column: 3;\n",
  865. " text-align: right;\n",
  866. " color: var(--xr-font-color2);\n",
  867. "}\n",
  868. "\n",
  869. ".xr-var-preview {\n",
  870. " grid-column: 4;\n",
  871. "}\n",
  872. "\n",
  873. ".xr-index-preview {\n",
  874. " grid-column: 2 / 5;\n",
  875. " color: var(--xr-font-color2);\n",
  876. "}\n",
  877. "\n",
  878. ".xr-var-name,\n",
  879. ".xr-var-dims,\n",
  880. ".xr-var-dtype,\n",
  881. ".xr-preview,\n",
  882. ".xr-attrs dt {\n",
  883. " white-space: nowrap;\n",
  884. " overflow: hidden;\n",
  885. " text-overflow: ellipsis;\n",
  886. " padding-right: 10px;\n",
  887. "}\n",
  888. "\n",
  889. ".xr-var-name:hover,\n",
  890. ".xr-var-dims:hover,\n",
  891. ".xr-var-dtype:hover,\n",
  892. ".xr-attrs dt:hover {\n",
  893. " overflow: visible;\n",
  894. " width: auto;\n",
  895. " z-index: 1;\n",
  896. "}\n",
  897. "\n",
  898. ".xr-var-attrs,\n",
  899. ".xr-var-data,\n",
  900. ".xr-index-data {\n",
  901. " display: none;\n",
  902. " background-color: var(--xr-background-color) !important;\n",
  903. " padding-bottom: 5px !important;\n",
  904. "}\n",
  905. "\n",
  906. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  907. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  908. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  909. " display: block;\n",
  910. "}\n",
  911. "\n",
  912. ".xr-var-data > table {\n",
  913. " float: right;\n",
  914. "}\n",
  915. "\n",
  916. ".xr-var-name span,\n",
  917. ".xr-var-data,\n",
  918. ".xr-index-name div,\n",
  919. ".xr-index-data,\n",
  920. ".xr-attrs {\n",
  921. " padding-left: 25px !important;\n",
  922. "}\n",
  923. "\n",
  924. ".xr-attrs,\n",
  925. ".xr-var-attrs,\n",
  926. ".xr-var-data,\n",
  927. ".xr-index-data {\n",
  928. " grid-column: 1 / -1;\n",
  929. "}\n",
  930. "\n",
  931. "dl.xr-attrs {\n",
  932. " padding: 0;\n",
  933. " margin: 0;\n",
  934. " display: grid;\n",
  935. " grid-template-columns: 125px auto;\n",
  936. "}\n",
  937. "\n",
  938. ".xr-attrs dt,\n",
  939. ".xr-attrs dd {\n",
  940. " padding: 0;\n",
  941. " margin: 0;\n",
  942. " float: left;\n",
  943. " padding-right: 10px;\n",
  944. " width: auto;\n",
  945. "}\n",
  946. "\n",
  947. ".xr-attrs dt {\n",
  948. " font-weight: normal;\n",
  949. " grid-column: 1;\n",
  950. "}\n",
  951. "\n",
  952. ".xr-attrs dt:hover span {\n",
  953. " display: inline-block;\n",
  954. " background: var(--xr-background-color);\n",
  955. " padding-right: 10px;\n",
  956. "}\n",
  957. "\n",
  958. ".xr-attrs dd {\n",
  959. " grid-column: 2;\n",
  960. " white-space: pre-wrap;\n",
  961. " word-break: break-all;\n",
  962. "}\n",
  963. "\n",
  964. ".xr-icon-database,\n",
  965. ".xr-icon-file-text2,\n",
  966. ".xr-no-icon {\n",
  967. " display: inline-block;\n",
  968. " vertical-align: middle;\n",
  969. " width: 1em;\n",
  970. " height: 1.5em !important;\n",
  971. " stroke-width: 0;\n",
  972. " stroke: currentColor;\n",
  973. " fill: currentColor;\n",
  974. "}\n",
  975. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
  976. "Dimensions: (y: 1200, x: 1920)\n",
  977. "Dimensions without coordinates: y, x\n",
  978. "Data variables:\n",
  979. " atoms (y, x) uint16 dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;\n",
  980. " background (y, x) uint16 dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;\n",
  981. " dark (y, x) uint16 dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;\n",
  982. " shotNum &lt;U2 &#x27;11&#x27;\n",
  983. " OD (y, x) float64 dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;\n",
  984. "Attributes: (12/96)\n",
  985. " TOF_free: 0.02\n",
  986. " abs_img_freq: 110.858\n",
  987. " absorption_imaging_flag: True\n",
  988. " backup_data: True\n",
  989. " blink_off_time: nan\n",
  990. " blink_on_time: nan\n",
  991. " ... ...\n",
  992. " y_offset: 0\n",
  993. " y_offset_img: 0\n",
  994. " z_offset: 0.189\n",
  995. " z_offset_img: 0.189\n",
  996. " scanAxis: []\n",
  997. " scanAxisLength: []</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-3f6a2152-ef01-4819-91f5-a47fe1a85483' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3f6a2152-ef01-4819-91f5-a47fe1a85483' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>y</span>: 1200</li><li><span>x</span>: 1920</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-71114a49-5445-43f4-a531-d6bdc6ba83e9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-71114a49-5445-43f4-a531-d6bdc6ba83e9' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-87511f20-517f-4220-90f4-f268366d6d73' class='xr-section-summary-in' type='checkbox' checked><label for='section-87511f20-517f-4220-90f4-f268366d6d73' 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'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-81526946-1703-4ca5-8e13-3fc13c175996' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-81526946-1703-4ca5-8e13-3fc13c175996' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-77f2b9fc-57a9-4fc9-bcb9-7283191c0038' class='xr-var-data-in' type='checkbox'><label for='data-77f2b9fc-57a9-4fc9-bcb9-7283191c0038' 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",
  998. " <tr>\n",
  999. " <td>\n",
  1000. " <table style=\"border-collapse: collapse;\">\n",
  1001. " <thead>\n",
  1002. " <tr>\n",
  1003. " <td> </td>\n",
  1004. " <th> Array </th>\n",
  1005. " <th> Chunk </th>\n",
  1006. " </tr>\n",
  1007. " </thead>\n",
  1008. " <tbody>\n",
  1009. " \n",
  1010. " <tr>\n",
  1011. " <th> Bytes </th>\n",
  1012. " <td> 4.39 MiB </td>\n",
  1013. " <td> 4.39 MiB </td>\n",
  1014. " </tr>\n",
  1015. " \n",
  1016. " <tr>\n",
  1017. " <th> Shape </th>\n",
  1018. " <td> (1200, 1920) </td>\n",
  1019. " <td> (1200, 1920) </td>\n",
  1020. " </tr>\n",
  1021. " <tr>\n",
  1022. " <th> Dask graph </th>\n",
  1023. " <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
  1024. " </tr>\n",
  1025. " <tr>\n",
  1026. " <th> Data type </th>\n",
  1027. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1028. " </tr>\n",
  1029. " </tbody>\n",
  1030. " </table>\n",
  1031. " </td>\n",
  1032. " <td>\n",
  1033. " <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1034. "\n",
  1035. " <!-- Horizontal lines -->\n",
  1036. " <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1037. " <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1038. "\n",
  1039. " <!-- Vertical lines -->\n",
  1040. " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1041. " <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1042. "\n",
  1043. " <!-- Colored Rectangle -->\n",
  1044. " <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1045. "\n",
  1046. " <!-- Text -->\n",
  1047. " <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1048. " <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
  1049. "</svg>\n",
  1050. " </td>\n",
  1051. " </tr>\n",
  1052. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-cf0352d3-81af-4aa1-8a4b-d510a6d9ed9f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-cf0352d3-81af-4aa1-8a4b-d510a6d9ed9f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7cebfcb4-0749-41e1-a9df-8a3ca0e9cd57' class='xr-var-data-in' type='checkbox'><label for='data-7cebfcb4-0749-41e1-a9df-8a3ca0e9cd57' 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",
  1053. " <tr>\n",
  1054. " <td>\n",
  1055. " <table style=\"border-collapse: collapse;\">\n",
  1056. " <thead>\n",
  1057. " <tr>\n",
  1058. " <td> </td>\n",
  1059. " <th> Array </th>\n",
  1060. " <th> Chunk </th>\n",
  1061. " </tr>\n",
  1062. " </thead>\n",
  1063. " <tbody>\n",
  1064. " \n",
  1065. " <tr>\n",
  1066. " <th> Bytes </th>\n",
  1067. " <td> 4.39 MiB </td>\n",
  1068. " <td> 4.39 MiB </td>\n",
  1069. " </tr>\n",
  1070. " \n",
  1071. " <tr>\n",
  1072. " <th> Shape </th>\n",
  1073. " <td> (1200, 1920) </td>\n",
  1074. " <td> (1200, 1920) </td>\n",
  1075. " </tr>\n",
  1076. " <tr>\n",
  1077. " <th> Dask graph </th>\n",
  1078. " <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
  1079. " </tr>\n",
  1080. " <tr>\n",
  1081. " <th> Data type </th>\n",
  1082. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1083. " </tr>\n",
  1084. " </tbody>\n",
  1085. " </table>\n",
  1086. " </td>\n",
  1087. " <td>\n",
  1088. " <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1089. "\n",
  1090. " <!-- Horizontal lines -->\n",
  1091. " <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1092. " <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1093. "\n",
  1094. " <!-- Vertical lines -->\n",
  1095. " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1096. " <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1097. "\n",
  1098. " <!-- Colored Rectangle -->\n",
  1099. " <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1100. "\n",
  1101. " <!-- Text -->\n",
  1102. " <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1103. " <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
  1104. "</svg>\n",
  1105. " </td>\n",
  1106. " </tr>\n",
  1107. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-ea5ca203-117f-4d7f-a382-5ea49ef757fe' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ea5ca203-117f-4d7f-a382-5ea49ef757fe' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1c46121e-396f-4c19-b720-5bfd85d3db08' class='xr-var-data-in' type='checkbox'><label for='data-1c46121e-396f-4c19-b720-5bfd85d3db08' 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",
  1108. " <tr>\n",
  1109. " <td>\n",
  1110. " <table style=\"border-collapse: collapse;\">\n",
  1111. " <thead>\n",
  1112. " <tr>\n",
  1113. " <td> </td>\n",
  1114. " <th> Array </th>\n",
  1115. " <th> Chunk </th>\n",
  1116. " </tr>\n",
  1117. " </thead>\n",
  1118. " <tbody>\n",
  1119. " \n",
  1120. " <tr>\n",
  1121. " <th> Bytes </th>\n",
  1122. " <td> 4.39 MiB </td>\n",
  1123. " <td> 4.39 MiB </td>\n",
  1124. " </tr>\n",
  1125. " \n",
  1126. " <tr>\n",
  1127. " <th> Shape </th>\n",
  1128. " <td> (1200, 1920) </td>\n",
  1129. " <td> (1200, 1920) </td>\n",
  1130. " </tr>\n",
  1131. " <tr>\n",
  1132. " <th> Dask graph </th>\n",
  1133. " <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
  1134. " </tr>\n",
  1135. " <tr>\n",
  1136. " <th> Data type </th>\n",
  1137. " <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
  1138. " </tr>\n",
  1139. " </tbody>\n",
  1140. " </table>\n",
  1141. " </td>\n",
  1142. " <td>\n",
  1143. " <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1144. "\n",
  1145. " <!-- Horizontal lines -->\n",
  1146. " <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1147. " <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1148. "\n",
  1149. " <!-- Vertical lines -->\n",
  1150. " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1151. " <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1152. "\n",
  1153. " <!-- Colored Rectangle -->\n",
  1154. " <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1155. "\n",
  1156. " <!-- Text -->\n",
  1157. " <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1158. " <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
  1159. "</svg>\n",
  1160. " </td>\n",
  1161. " </tr>\n",
  1162. "</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>&lt;U2</div><div class='xr-var-preview xr-preview'>&#x27;11&#x27;</div><input id='attrs-931dff3b-9054-49ae-a9a3-af23a3abe9d2' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-931dff3b-9054-49ae-a9a3-af23a3abe9d2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-16b7a2e7-307c-45ef-8fd7-4961a352c6cd' class='xr-var-data-in' type='checkbox'><label for='data-16b7a2e7-307c-45ef-8fd7-4961a352c6cd' 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(&#x27;11&#x27;, dtype=&#x27;&lt;U2&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>OD</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array&lt;chunksize=(1200, 1920), meta=np.ndarray&gt;</div><input id='attrs-c45c4a1c-0006-43c9-be36-4e3d40196cf6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c45c4a1c-0006-43c9-be36-4e3d40196cf6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-81f04315-1fc1-4433-9b5f-8dbcef03d3d4' class='xr-var-data-in' type='checkbox'><label for='data-81f04315-1fc1-4433-9b5f-8dbcef03d3d4' 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",
  1163. " <tr>\n",
  1164. " <td>\n",
  1165. " <table style=\"border-collapse: collapse;\">\n",
  1166. " <thead>\n",
  1167. " <tr>\n",
  1168. " <td> </td>\n",
  1169. " <th> Array </th>\n",
  1170. " <th> Chunk </th>\n",
  1171. " </tr>\n",
  1172. " </thead>\n",
  1173. " <tbody>\n",
  1174. " \n",
  1175. " <tr>\n",
  1176. " <th> Bytes </th>\n",
  1177. " <td> 17.58 MiB </td>\n",
  1178. " <td> 17.58 MiB </td>\n",
  1179. " </tr>\n",
  1180. " \n",
  1181. " <tr>\n",
  1182. " <th> Shape </th>\n",
  1183. " <td> (1200, 1920) </td>\n",
  1184. " <td> (1200, 1920) </td>\n",
  1185. " </tr>\n",
  1186. " <tr>\n",
  1187. " <th> Dask graph </th>\n",
  1188. " <td colspan=\"2\"> 1 chunks in 16 graph layers </td>\n",
  1189. " </tr>\n",
  1190. " <tr>\n",
  1191. " <th> Data type </th>\n",
  1192. " <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
  1193. " </tr>\n",
  1194. " </tbody>\n",
  1195. " </table>\n",
  1196. " </td>\n",
  1197. " <td>\n",
  1198. " <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
  1199. "\n",
  1200. " <!-- Horizontal lines -->\n",
  1201. " <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
  1202. " <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1203. "\n",
  1204. " <!-- Vertical lines -->\n",
  1205. " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1206. " <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
  1207. "\n",
  1208. " <!-- Colored Rectangle -->\n",
  1209. " <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
  1210. "\n",
  1211. " <!-- Text -->\n",
  1212. " <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
  1213. " <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
  1214. "</svg>\n",
  1215. " </td>\n",
  1216. " </tr>\n",
  1217. "</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-c33811d7-8cf5-4e35-8e55-5bc202a3ba60' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c33811d7-8cf5-4e35-8e55-5bc202a3ba60' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-47715f26-a2f1-48c1-9cd1-23dbb2fa5488' class='xr-section-summary-in' type='checkbox' ><label for='section-47715f26-a2f1-48c1-9cd1-23dbb2fa5488' 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.005</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.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.2812</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</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_value :</span></dt><dd>1</dd><dt><span>evap_3_rate_constant_1 :</span></dt><dd>-0.879</dd><dt><span>evap_3_rate_constant_2 :</span></dt><dd>-0.297</dd><dt><span>final_amp :</span></dt><dd>8e-05</dd><dt><span>final_freq :</span></dt><dd>104.0</dd><dt><span>gradCoil_current :</span></dt><dd>0.18</dd><dt><span>gradCoil_current_sg :</span></dt><dd>0</dd><dt><span>imaging_method :</span></dt><dd>in_situ_absorption</dd><dt><span>imaging_pulse_duration :</span></dt><dd>2.5e-05</dd><dt><span>imaging_wavel
  1218. ],
  1219. "text/plain": [
  1220. "<xarray.Dataset>\n",
  1221. "Dimensions: (y: 1200, x: 1920)\n",
  1222. "Dimensions without coordinates: y, x\n",
  1223. "Data variables:\n",
  1224. " atoms (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
  1225. " background (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
  1226. " dark (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
  1227. " shotNum <U2 '11'\n",
  1228. " OD (y, x) float64 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
  1229. "Attributes: (12/96)\n",
  1230. " TOF_free: 0.02\n",
  1231. " abs_img_freq: 110.858\n",
  1232. " absorption_imaging_flag: True\n",
  1233. " backup_data: True\n",
  1234. " blink_off_time: nan\n",
  1235. " blink_on_time: nan\n",
  1236. " ... ...\n",
  1237. " y_offset: 0\n",
  1238. " y_offset_img: 0\n",
  1239. " z_offset: 0.189\n",
  1240. " z_offset_img: 0.189\n",
  1241. " scanAxis: []\n",
  1242. " scanAxisLength: []"
  1243. ]
  1244. },
  1245. "execution_count": 75,
  1246. "metadata": {},
  1247. "output_type": "execute_result"
  1248. }
  1249. ],
  1250. "source": [
  1251. "shotNum = \"0069\"\n",
  1252. "filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
  1253. "# filePath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/12/0065/*.h5\"\n",
  1254. "filePath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_11.h5'\n",
  1255. "\n",
  1256. "dataSetDict = {\n",
  1257. " dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
  1258. " for i in [0] # range(len(groupList))\n",
  1259. "}\n",
  1260. "\n",
  1261. "dataSet = dataSetDict[\"camera_1\"]\n",
  1262. "dataSet = swap_xy(dataSet)\n",
  1263. "\n",
  1264. "scanAxis = get_scanAxis(dataSet)\n",
  1265. "\n",
  1266. "dataSet = auto_rechunk(dataSet)\n",
  1267. "\n",
  1268. "dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
  1269. "\n",
  1270. "dataSet"
  1271. ]
  1272. },
  1273. {
  1274. "attachments": {},
  1275. "cell_type": "markdown",
  1276. "metadata": {},
  1277. "source": [
  1278. "## Calculate an plot OD images"
  1279. ]
  1280. },
  1281. {
  1282. "cell_type": "code",
  1283. "execution_count": 76,
  1284. "metadata": {},
  1285. "outputs": [
  1286. {
  1287. "data": {
  1288. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnIAAAHECAYAAAC9VcdgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9fZhWV33vj78muTFOzBAZcRCBk8EOkdEMp0zzBe2UMrnOqNDfmV4HrETJsZhCNbSHU9FINfT0ds6RpGJqzrdpJbVBjTGxiZa04ldiOl4ZGmkKTUhPRh00o5AQJFAyGIZkotzJ/P5Y632vz1p730MSnj37c11czL733muv5/Ve78/DqhsdHR2lkEIKKaSQQgoppJBzTs470xkopJBCCimkkEIKKeSVSQHkCimkkEIKKaSQQs5RKYBcIYUUUkghhRRSyDkqBZArpJBCCimkkEIKOUelAHKFFFJIIYUUUkgh56gUQK6QQgoppJBCCinkHJUCyBVSSCGFFFJIIYWco1I60xn4v11efPFFfvrTn9LQ0EBdXd2Zzk4hhRRSSCFnsYyOjjI8PMwb3/hGzjvv1HAxf//3f8/jjz9+UtJ673vfy6RJk05KWoXkSwHkzrD89Kc/Zdq0aWc6G4UUUkghhZxDsnfvXqZOnXrS0x0eHmbRokVcyomr7J7CrXGf/vSnT0LOCqklBZA7w9LQ0OD/+hbwGuAfgQrwRv/7T/3/VwAPmDcrwOv9303A9829pcCdwCf89Q/NP4CPATeYbzQB3wM+5K//2qe/0F9vSXLdDTQQus+X/f9vBX4jpHH+J+CFG5J3bZpvAw76658Al/r/fR67gN7PJGX+sP/7fzO2XAocBv49+b3k09EzPwEm+OvD5h7AYuDNuLqyzy/z1w8AP8r5rv/ttZ+An/2dKdMEeNMK+InKpG+pnW7Atem/wyz/26MAd5k0Xg+sMHlaCDyUlPNtwL/klFfyJpOe0tT7S/3//+j/V5281V/bfvZW88zB5Dt531V//fecPOgdgCW4/mtlObCRfEm/9SbgCf+3fn89MA94tb/+Ea7e0vyl/aWWvJW4LtJ31Q8+7K//98tI/x3+//uBywnj9AH//qX+upHQzva7h/3felZ9VPWketYc8u/mvuYGcP3/eya9CYQxZdvSLiNN8Opl8Pxt/vqnhLoH+Ib/rvrZnUkeVDbl+Qrg34Bhf93g/6l9la9r/N83JOWTLAY2+b/1PZXhMl/OFSaNtK3eSpg/NR5+21//GBgJj/7OZXAI6LPzxnhCfyvh2nSYMPf8BPhV3KQHMA74jCnDmwh9bgT4I7N2nFzRYU9LCKPllco3TXqFnDopgNwZlqBOfQ1wEW7oVIB6//urzX07rOwzFyb3Gvz1eH99UfxM3XgYfXXO+3peebgoyYPkImIgp/sXxmnUja/xrt55jX9H17Yc491climzzeNYciHwfM5zdtHX91QPI8ST/0X+e69Onm9IrtPvmnqOnqmH82x6+pYtU737/3z9ln6nPsnTReGdqti+kgeo0nzb9xvMbxDqxLaTTQdCPR8PyNk+nVd36k8NOffyfqv1LZu2fq8n1FX6jM3fS126xqpDez+nbY8rrzHvaF6w37jQPJfX/54379t85gG5+uR+2rdsenZM2ba0y0i97/f2vupe1xVCP0vrJe1nr/H3j5k6SOtRYyLNTzqW7RiyZdA3xmqrtE/Zue4i4Pzw6LjxPgu2TGk71JMdVzbNccRj6kJCezgpTHEKkRRA7qyTRuADwHrzWwnoNddNwCzggLusXwwj/ea+dsM9/v82YADHpAGj+r3R//8o0Ars89cdQItJpwnHuPj32ez/txNlB3AE2nya/UClx9xvAQaBbebbl/h8gdtR34LbBwKsgy120ZkF7AQ+Syy63+nLIYZvCJjk/9f3Utao1d9XPXyAuN6PmfetaPe9C0plU86yy7fkcE/82qKVcM8GsgDHPncQaIJH7vDXg8AcYGb4JnsI5d5MdhiXgFX+77twbIRsVHb6d1pM+gfDq9OaYW+SbyDUke8L08qwVwzHAbIAoRu6Z/ks9gDzkzIOjvGNAWJwNgXXN1JRGW/2/9s6AtfvNS4OAn3mG7uSd5qJ62IBTJ4L+/WtHri8DA+p//a5/0pl938lrbNOl95kDxb2U0OazN9DOLZXzONMwngBWA3cZPKepnEQt9Db+7uS+wBz/f/biNqeRhxrpXa8G1eHemYlsMHfX+l/6yFmu/bBSI9Jox3X5/r8dQU3TnqS+5LXAduJ55oOc38brp7mmPSO+HyBmz+OEM+XKovkYPJ/+qzuTQllopXQl/B/a+5K7n11ANeX1Oe3JmlXgMeBcsCzw+tw9aC6uAYH6jT/DPq/hwjA+tRKCb+XPgEpvClPjxRA7qyRLYQdWwpWJJpYGv0/PwGNtBE3pRZAgaK7CbtA/N+LCYtEBbcY24lqq0lTE56etxM3hAWmBP0GyNBEvHDOAXaY+1Z91uu/1+qvNTmqLJrgBEj24Ra6K/11H/GidJCw8Oh6GXAHWTCniXYXcB1BjfOoL7NVA0Gox5luAa/zi/loDzF46DLlAu7ZnuSxKblehQNes4AnzTMjxIAyZaDUH8DVz1bCIjNEDILaTBo5eTjky1X93pD/lu0rwF5COevLfvG2edoBm+8x1/XAvcSiBfoAYaHC52cmWcCSigCcgIH6ht47QFBV9fr7i/212kpyL7AIuCo8v38TgQkCHrrLpN0ELIRKCvQFDAeARtgvwLKMsDHC9ZnRdUR131aGfgsIBcL0zM1kxY77BTn3Me+rTg04nFeGBzSWF+P6n0BUIw5UCgjeZdKy+RzC9VkI41R94ZjPo+3n9t1Hifuz8qbN4ipcueeYd/SbZKb52wI2ifqZ0p4PbHX1DdA/AnzW7G1afJ52mectwG3EAXXNVfqG8qz3UgCneuzG1etOGN4cbreWYUBmLLcQNreSIZ+H07Nsn4wvvRLO8LnnnmPr1q08/PDD7Ny5k4cffpgnnnCq9HK5zCc/+ckTzBUcOHCA9evX881vfpMnnniC+vp63vrWt7Js2TKWL19+zrGdBZA762Q+bsKRzccthEmu2/x2gGCrNUK8K2zCLVp+UltUhns2E7NTdsK7DrjeXGvx0K77ZtwioYX4buKFVpPPXNxu2qaphRT/fU26B3E7Zws6h3FsE74sXVS7aMNcGN5AYA2bcIv/Xf46XfSXwkTgkF1ABEpW+2uxXraubT1ItGP3C0B1n9rh0hy14NXuYYdw4FuA4V6YXDaLu80bwNPme4v83/fg2ssCho048KJnLUBs9/8LkNzk86lFrJ942Cd5GNmJA8dakLXQKL07cO3sGSqAhzb5Mh4wae4j3nhYECcbTss2lam2x+SrYP8dBHDaTmh3iQU4qv904TxIzLYcIABk9U+BnxZcXVu22dYbZFmW24gYtboyjOp5fVf9XX1/hrscTZnZOR5QQGiflAUS66l5YCpuo2IZJstuqY6U54GkTCV4wICq0mKoWECSMlcHCaBL5W4ly2jZ/qVNhu1nU+LH2UeYy24j3gypPNoAziQLaGsBfoG/EnHf2ApcB/2P+ut7gCYY1KavEddOr/PXnbg683PZ9Lmw2475tJ3STUgTTFgJh/WOAL1l0yswsI64T9xCtZ6nr4TdPbix92yN8v5yyI4dO/it3/qtU5b+ww8/zLve9S6eftrNtxdddBHDw8N897vf5bvf/S5f+9rX+MY3vsEFF1xwyvJwsqUAcmeNXIpTi8gmSYzKGoK6z+7ODhJAz4C/FmjqI1IN3GOZBIndBXvwMtEvzIc0ud9lnu/1eQH4LJSuNOqkXQRWRBO8AJFh3a4uwxc16U/1aWob3Isz3NfiLTbLpzcsxkQ7/+24Sc2oOSmZ96fCodRJQwuUFoJu/9sB80ybSUOTvxahxbjFXBP+CrJg7FHCQrUTVy+3+ut2A+KsiPFT3SxP0rVtJzCpcm8jBuK9OFAskLoIt1AJTIrlTPuDAMcBHDCSU4qYpO3mWb84PyS26phPz4LPEoHNUv2qb6SODPN9fn29Z+pI7WZVp7Z+KkSLZ0MZhnf
  1289. "text/plain": [
  1290. "<Figure size 640x480 with 2 Axes>"
  1291. ]
  1292. },
  1293. "metadata": {},
  1294. "output_type": "display_data"
  1295. }
  1296. ],
  1297. "source": [
  1298. "# imageAnalyser.center = (960, 1040)\n",
  1299. "# imageAnalyser.span = (100, 100)\n",
  1300. "# imageAnalyser.fraction = (0.1, 0.1)\n",
  1301. "\n",
  1302. "imageAnalyser.center = (960, 875)\n",
  1303. "imageAnalyser.span = (300, 300)\n",
  1304. "imageAnalyser.fraction = (0.1, 0.1)\n",
  1305. "\n",
  1306. "dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
  1307. "dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
  1308. "\n",
  1309. "dataSet_cropOD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
  1310. "plt.show()"
  1311. ]
  1312. }
  1313. ],
  1314. "metadata": {
  1315. "kernelspec": {
  1316. "display_name": "env",
  1317. "language": "python",
  1318. "name": "python3"
  1319. },
  1320. "language_info": {
  1321. "codemirror_mode": {
  1322. "name": "ipython",
  1323. "version": 3
  1324. },
  1325. "file_extension": ".py",
  1326. "mimetype": "text/x-python",
  1327. "name": "python",
  1328. "nbconvert_exporter": "python",
  1329. "pygments_lexer": "ipython3",
  1330. "version": "3.9.12"
  1331. },
  1332. "vscode": {
  1333. "interpreter": {
  1334. "hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
  1335. }
  1336. }
  1337. },
  1338. "nbformat": 4,
  1339. "nbformat_minor": 2
  1340. }