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.

2626 lines
130 KiB

1 year ago
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "# How to index, slice, modify, and delete data points"
  8. ]
  9. },
  10. {
  11. "cell_type": "markdown",
  12. "metadata": {},
  13. "source": [
  14. "Very usually, we need to select, modify and even delete the data of certain shots. Here there is a short introduction on how to do that.\n",
  15. "\n",
  16. "Let us start with importing the supporting packages and loading the data. In order to keep things ealier, here we will import all the packages, but not all of them will be us"
  17. ]
  18. },
  19. {
  20. "cell_type": "markdown",
  21. "metadata": {},
  22. "source": [
  23. "## Load some example data"
  24. ]
  25. },
  26. {
  27. "cell_type": "markdown",
  28. "metadata": {},
  29. "source": [
  30. "### Import supporting packages"
  31. ]
  32. },
  33. {
  34. "cell_type": "code",
  35. "execution_count": 1,
  36. "metadata": {},
  37. "outputs": [],
  38. "source": [
  39. "# Set the system path for importing packages\n",
  40. "# This is just because I put all example scripts in another folder\n",
  41. "# You DO NOT need to do this \n",
  42. "# -------------- You do NOT need following part --------------\n",
  43. "import sys\n",
  44. "import os\n",
  45. "sys.path.insert(0, os.path.abspath('..'))\n",
  46. "# -------------- You do NOT need above part --------------\n",
  47. "\n",
  48. "import copy\n",
  49. "import glob\n",
  50. "from datetime import datetime\n",
  51. "\n",
  52. "# The package for data structure\n",
  53. "import xarray as xr\n",
  54. "import pandas as pd\n",
  55. "import numpy as np\n",
  56. "\n",
  57. "# The packages for working with uncertainties\n",
  58. "from uncertainties import ufloat\n",
  59. "from uncertainties import unumpy as unp\n",
  60. "from uncertainties import umath\n",
  61. "\n",
  62. "# The package for plotting\n",
  63. "import matplotlib.pyplot as plt\n",
  64. "plt.rcParams['font.size'] = 18 # Set the global font size\n",
  65. "\n",
  66. "# -------------- The modules written by us --------------\n",
  67. "\n",
  68. "# The packages for read data\n",
  69. "from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
  70. "\n",
  71. "# The packages for data analysis\n",
  72. "from Analyser.ImagingAnalyser import ImageAnalyser\n",
  73. "from Analyser.FitAnalyser import FitAnalyser\n",
  74. "from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
  75. "from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
  76. "from ToolFunction.ToolFunction import *\n",
  77. "\n",
  78. "# Add errorbar plot to xarray package\n",
  79. "from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
  80. "xr.plot.dataarray_plot.errorbar = errorbar\n",
  81. "xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar"
  82. ]
  83. },
  84. {
  85. "cell_type": "markdown",
  86. "metadata": {},
  87. "source": [
  88. "### Start a client for parallel computing"
  89. ]
  90. },
  91. {
  92. "cell_type": "code",
  93. "execution_count": 2,
  94. "metadata": {},
  95. "outputs": [
  96. {
  97. "data": {
  98. "text/html": [
  99. "<div>\n",
  100. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
  101. " <div style=\"margin-left: 48px;\">\n",
  102. " <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
  103. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-b0e6c9ce-2097-11ee-9d7c-80e82ce2fa8e</p>\n",
  104. " <table style=\"width: 100%; text-align: left;\">\n",
  105. "\n",
  106. " <tr>\n",
  107. " \n",
  108. " <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
  109. " <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
  110. " \n",
  111. " </tr>\n",
  112. "\n",
  113. " \n",
  114. " <tr>\n",
  115. " <td style=\"text-align: left;\">\n",
  116. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  117. " </td>\n",
  118. " <td style=\"text-align: left;\"></td>\n",
  119. " </tr>\n",
  120. " \n",
  121. "\n",
  122. " </table>\n",
  123. "\n",
  124. " \n",
  125. "\n",
  126. " \n",
  127. " <details>\n",
  128. " <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
  129. " <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
  130. " <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
  131. " </div>\n",
  132. " <div style=\"margin-left: 48px;\">\n",
  133. " <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
  134. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">2c85baf6</p>\n",
  135. " <table style=\"width: 100%; text-align: left;\">\n",
  136. " <tr>\n",
  137. " <td style=\"text-align: left;\">\n",
  138. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  139. " </td>\n",
  140. " <td style=\"text-align: left;\">\n",
  141. " <strong>Workers:</strong> 6\n",
  142. " </td>\n",
  143. " </tr>\n",
  144. " <tr>\n",
  145. " <td style=\"text-align: left;\">\n",
  146. " <strong>Total threads:</strong> 60\n",
  147. " </td>\n",
  148. " <td style=\"text-align: left;\">\n",
  149. " <strong>Total memory:</strong> 55.88 GiB\n",
  150. " </td>\n",
  151. " </tr>\n",
  152. " \n",
  153. " <tr>\n",
  154. " <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
  155. " <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
  156. "</tr>\n",
  157. "\n",
  158. " \n",
  159. " </table>\n",
  160. "\n",
  161. " <details>\n",
  162. " <summary style=\"margin-bottom: 20px;\">\n",
  163. " <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
  164. " </summary>\n",
  165. "\n",
  166. " <div style=\"\">\n",
  167. " <div>\n",
  168. " <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
  169. " <div style=\"margin-left: 48px;\">\n",
  170. " <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
  171. " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-3edf5152-70c9-41bc-b2e3-dd1cacfc5ef2</p>\n",
  172. " <table style=\"width: 100%; text-align: left;\">\n",
  173. " <tr>\n",
  174. " <td style=\"text-align: left;\">\n",
  175. " <strong>Comm:</strong> tcp://127.0.0.1:62125\n",
  176. " </td>\n",
  177. " <td style=\"text-align: left;\">\n",
  178. " <strong>Workers:</strong> 6\n",
  179. " </td>\n",
  180. " </tr>\n",
  181. " <tr>\n",
  182. " <td style=\"text-align: left;\">\n",
  183. " <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
  184. " </td>\n",
  185. " <td style=\"text-align: left;\">\n",
  186. " <strong>Total threads:</strong> 60\n",
  187. " </td>\n",
  188. " </tr>\n",
  189. " <tr>\n",
  190. " <td style=\"text-align: left;\">\n",
  191. " <strong>Started:</strong> Just now\n",
  192. " </td>\n",
  193. " <td style=\"text-align: left;\">\n",
  194. " <strong>Total memory:</strong> 55.88 GiB\n",
  195. " </td>\n",
  196. " </tr>\n",
  197. " </table>\n",
  198. " </div>\n",
  199. " </div>\n",
  200. "\n",
  201. " <details style=\"margin-left: 48px;\">\n",
  202. " <summary style=\"margin-bottom: 20px;\">\n",
  203. " <h3 style=\"display: inline;\">Workers</h3>\n",
  204. " </summary>\n",
  205. "\n",
  206. " \n",
  207. " <div style=\"margin-bottom: 20px;\">\n",
  208. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  209. " <div style=\"margin-left: 48px;\">\n",
  210. " <details>\n",
  211. " <summary>\n",
  212. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
  213. " </summary>\n",
  214. " <table style=\"width: 100%; text-align: left;\">\n",
  215. " <tr>\n",
  216. " <td style=\"text-align: left;\">\n",
  217. " <strong>Comm: </strong> tcp://127.0.0.1:62161\n",
  218. " </td>\n",
  219. " <td style=\"text-align: left;\">\n",
  220. " <strong>Total threads: </strong> 10\n",
  221. " </td>\n",
  222. " </tr>\n",
  223. " <tr>\n",
  224. " <td style=\"text-align: left;\">\n",
  225. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62163/status\" target=\"_blank\">http://127.0.0.1:62163/status</a>\n",
  226. " </td>\n",
  227. " <td style=\"text-align: left;\">\n",
  228. " <strong>Memory: </strong> 9.31 GiB\n",
  229. " </td>\n",
  230. " </tr>\n",
  231. " <tr>\n",
  232. " <td style=\"text-align: left;\">\n",
  233. " <strong>Nanny: </strong> tcp://127.0.0.1:62128\n",
  234. " </td>\n",
  235. " <td style=\"text-align: left;\"></td>\n",
  236. " </tr>\n",
  237. " <tr>\n",
  238. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  239. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-doscq09y\n",
  240. " </td>\n",
  241. " </tr>\n",
  242. "\n",
  243. " \n",
  244. "\n",
  245. " \n",
  246. "\n",
  247. " </table>\n",
  248. " </details>\n",
  249. " </div>\n",
  250. " </div>\n",
  251. " \n",
  252. " <div style=\"margin-bottom: 20px;\">\n",
  253. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  254. " <div style=\"margin-left: 48px;\">\n",
  255. " <details>\n",
  256. " <summary>\n",
  257. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
  258. " </summary>\n",
  259. " <table style=\"width: 100%; text-align: left;\">\n",
  260. " <tr>\n",
  261. " <td style=\"text-align: left;\">\n",
  262. " <strong>Comm: </strong> tcp://127.0.0.1:62167\n",
  263. " </td>\n",
  264. " <td style=\"text-align: left;\">\n",
  265. " <strong>Total threads: </strong> 10\n",
  266. " </td>\n",
  267. " </tr>\n",
  268. " <tr>\n",
  269. " <td style=\"text-align: left;\">\n",
  270. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62168/status\" target=\"_blank\">http://127.0.0.1:62168/status</a>\n",
  271. " </td>\n",
  272. " <td style=\"text-align: left;\">\n",
  273. " <strong>Memory: </strong> 9.31 GiB\n",
  274. " </td>\n",
  275. " </tr>\n",
  276. " <tr>\n",
  277. " <td style=\"text-align: left;\">\n",
  278. " <strong>Nanny: </strong> tcp://127.0.0.1:62129\n",
  279. " </td>\n",
  280. " <td style=\"text-align: left;\"></td>\n",
  281. " </tr>\n",
  282. " <tr>\n",
  283. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  284. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-7b8nhgmg\n",
  285. " </td>\n",
  286. " </tr>\n",
  287. "\n",
  288. " \n",
  289. "\n",
  290. " \n",
  291. "\n",
  292. " </table>\n",
  293. " </details>\n",
  294. " </div>\n",
  295. " </div>\n",
  296. " \n",
  297. " <div style=\"margin-bottom: 20px;\">\n",
  298. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  299. " <div style=\"margin-left: 48px;\">\n",
  300. " <details>\n",
  301. " <summary>\n",
  302. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
  303. " </summary>\n",
  304. " <table style=\"width: 100%; text-align: left;\">\n",
  305. " <tr>\n",
  306. " <td style=\"text-align: left;\">\n",
  307. " <strong>Comm: </strong> tcp://127.0.0.1:62156\n",
  308. " </td>\n",
  309. " <td style=\"text-align: left;\">\n",
  310. " <strong>Total threads: </strong> 10\n",
  311. " </td>\n",
  312. " </tr>\n",
  313. " <tr>\n",
  314. " <td style=\"text-align: left;\">\n",
  315. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62159/status\" target=\"_blank\">http://127.0.0.1:62159/status</a>\n",
  316. " </td>\n",
  317. " <td style=\"text-align: left;\">\n",
  318. " <strong>Memory: </strong> 9.31 GiB\n",
  319. " </td>\n",
  320. " </tr>\n",
  321. " <tr>\n",
  322. " <td style=\"text-align: left;\">\n",
  323. " <strong>Nanny: </strong> tcp://127.0.0.1:62130\n",
  324. " </td>\n",
  325. " <td style=\"text-align: left;\"></td>\n",
  326. " </tr>\n",
  327. " <tr>\n",
  328. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  329. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-y1tkfpfy\n",
  330. " </td>\n",
  331. " </tr>\n",
  332. "\n",
  333. " \n",
  334. "\n",
  335. " \n",
  336. "\n",
  337. " </table>\n",
  338. " </details>\n",
  339. " </div>\n",
  340. " </div>\n",
  341. " \n",
  342. " <div style=\"margin-bottom: 20px;\">\n",
  343. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  344. " <div style=\"margin-left: 48px;\">\n",
  345. " <details>\n",
  346. " <summary>\n",
  347. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
  348. " </summary>\n",
  349. " <table style=\"width: 100%; text-align: left;\">\n",
  350. " <tr>\n",
  351. " <td style=\"text-align: left;\">\n",
  352. " <strong>Comm: </strong> tcp://127.0.0.1:62162\n",
  353. " </td>\n",
  354. " <td style=\"text-align: left;\">\n",
  355. " <strong>Total threads: </strong> 10\n",
  356. " </td>\n",
  357. " </tr>\n",
  358. " <tr>\n",
  359. " <td style=\"text-align: left;\">\n",
  360. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62165/status\" target=\"_blank\">http://127.0.0.1:62165/status</a>\n",
  361. " </td>\n",
  362. " <td style=\"text-align: left;\">\n",
  363. " <strong>Memory: </strong> 9.31 GiB\n",
  364. " </td>\n",
  365. " </tr>\n",
  366. " <tr>\n",
  367. " <td style=\"text-align: left;\">\n",
  368. " <strong>Nanny: </strong> tcp://127.0.0.1:62131\n",
  369. " </td>\n",
  370. " <td style=\"text-align: left;\"></td>\n",
  371. " </tr>\n",
  372. " <tr>\n",
  373. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  374. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-613gqycm\n",
  375. " </td>\n",
  376. " </tr>\n",
  377. "\n",
  378. " \n",
  379. "\n",
  380. " \n",
  381. "\n",
  382. " </table>\n",
  383. " </details>\n",
  384. " </div>\n",
  385. " </div>\n",
  386. " \n",
  387. " <div style=\"margin-bottom: 20px;\">\n",
  388. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  389. " <div style=\"margin-left: 48px;\">\n",
  390. " <details>\n",
  391. " <summary>\n",
  392. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
  393. " </summary>\n",
  394. " <table style=\"width: 100%; text-align: left;\">\n",
  395. " <tr>\n",
  396. " <td style=\"text-align: left;\">\n",
  397. " <strong>Comm: </strong> tcp://127.0.0.1:62150\n",
  398. " </td>\n",
  399. " <td style=\"text-align: left;\">\n",
  400. " <strong>Total threads: </strong> 10\n",
  401. " </td>\n",
  402. " </tr>\n",
  403. " <tr>\n",
  404. " <td style=\"text-align: left;\">\n",
  405. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62153/status\" target=\"_blank\">http://127.0.0.1:62153/status</a>\n",
  406. " </td>\n",
  407. " <td style=\"text-align: left;\">\n",
  408. " <strong>Memory: </strong> 9.31 GiB\n",
  409. " </td>\n",
  410. " </tr>\n",
  411. " <tr>\n",
  412. " <td style=\"text-align: left;\">\n",
  413. " <strong>Nanny: </strong> tcp://127.0.0.1:62132\n",
  414. " </td>\n",
  415. " <td style=\"text-align: left;\"></td>\n",
  416. " </tr>\n",
  417. " <tr>\n",
  418. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  419. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-nf2w0fki\n",
  420. " </td>\n",
  421. " </tr>\n",
  422. "\n",
  423. " \n",
  424. "\n",
  425. " \n",
  426. "\n",
  427. " </table>\n",
  428. " </details>\n",
  429. " </div>\n",
  430. " </div>\n",
  431. " \n",
  432. " <div style=\"margin-bottom: 20px;\">\n",
  433. " <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
  434. " <div style=\"margin-left: 48px;\">\n",
  435. " <details>\n",
  436. " <summary>\n",
  437. " <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
  438. " </summary>\n",
  439. " <table style=\"width: 100%; text-align: left;\">\n",
  440. " <tr>\n",
  441. " <td style=\"text-align: left;\">\n",
  442. " <strong>Comm: </strong> tcp://127.0.0.1:62155\n",
  443. " </td>\n",
  444. " <td style=\"text-align: left;\">\n",
  445. " <strong>Total threads: </strong> 10\n",
  446. " </td>\n",
  447. " </tr>\n",
  448. " <tr>\n",
  449. " <td style=\"text-align: left;\">\n",
  450. " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:62157/status\" target=\"_blank\">http://127.0.0.1:62157/status</a>\n",
  451. " </td>\n",
  452. " <td style=\"text-align: left;\">\n",
  453. " <strong>Memory: </strong> 9.31 GiB\n",
  454. " </td>\n",
  455. " </tr>\n",
  456. " <tr>\n",
  457. " <td style=\"text-align: left;\">\n",
  458. " <strong>Nanny: </strong> tcp://127.0.0.1:62133\n",
  459. " </td>\n",
  460. " <td style=\"text-align: left;\"></td>\n",
  461. " </tr>\n",
  462. " <tr>\n",
  463. " <td colspan=\"2\" style=\"text-align: left;\">\n",
  464. " <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-xm8jsrrg\n",
  465. " </td>\n",
  466. " </tr>\n",
  467. "\n",
  468. " \n",
  469. "\n",
  470. " \n",
  471. "\n",
  472. " </table>\n",
  473. " </details>\n",
  474. " </div>\n",
  475. " </div>\n",
  476. " \n",
  477. "\n",
  478. " </details>\n",
  479. "</div>\n",
  480. "\n",
  481. " </details>\n",
  482. " </div>\n",
  483. "</div>\n",
  484. " </details>\n",
  485. " \n",
  486. "\n",
  487. " </div>\n",
  488. "</div>"
  489. ],
  490. "text/plain": [
  491. "<Client: 'tcp://127.0.0.1:62125' processes=6 threads=60, memory=55.88 GiB>"
  492. ]
  493. },
  494. "execution_count": 2,
  495. "metadata": {},
  496. "output_type": "execute_result"
  497. }
  498. ],
  499. "source": [
  500. "from dask.distributed import Client\n",
  501. "client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
  502. "client"
  503. ]
  504. },
  505. {
  506. "cell_type": "markdown",
  507. "metadata": {},
  508. "source": [
  509. "### Set the path for different cameras"
  510. ]
  511. },
  512. {
  513. "cell_type": "code",
  514. "execution_count": 3,
  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. " \"images/ODT_2_Axis_Camera/in_situ_absorption\",\n",
  522. "]\n",
  523. "\n",
  524. "# give a short name to each path (or let's say each camera)\n",
  525. "dskey = {\n",
  526. " \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_0\",\n",
  527. " \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_1\",\n",
  528. " \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
  529. "}"
  530. ]
  531. },
  532. {
  533. "cell_type": "markdown",
  534. "metadata": {},
  535. "source": [
  536. "### Set global path for experiment"
  537. ]
  538. },
  539. {
  540. "cell_type": "code",
  541. "execution_count": 4,
  542. "metadata": {},
  543. "outputs": [],
  544. "source": [
  545. "img_dir = '//DyLabNAS/Data/'\n",
  546. "SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
  547. "folderPath = img_dir + SequenceName + '2023/04/17'# get_date()"
  548. ]
  549. },
  550. {
  551. "cell_type": "markdown",
  552. "metadata": {},
  553. "source": [
  554. "### Load shot 0058"
  555. ]
  556. },
  557. {
  558. "cell_type": "code",
  559. "execution_count": 5,
  560. "metadata": {},
  561. "outputs": [
  562. {
  563. "data": {
  564. "text/html": [
  565. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  566. "<defs>\n",
  567. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  568. "<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",
  569. "<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",
  570. "<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",
  571. "</symbol>\n",
  572. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  573. "<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",
  574. "<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",
  575. "<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",
  576. "<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",
  577. "</symbol>\n",
  578. "</defs>\n",
  579. "</svg>\n",
  580. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  581. " *\n",
  582. " */\n",
  583. "\n",
  584. ":root {\n",
  585. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  586. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  587. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  588. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  589. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  590. " --xr-background-color: var(--jp-layout-color0, white);\n",
  591. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  592. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  593. "}\n",
  594. "\n",
  595. "html[theme=dark],\n",
  596. "body[data-theme=dark],\n",
  597. "body.vscode-dark {\n",
  598. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  599. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  600. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  601. " --xr-border-color: #1F1F1F;\n",
  602. " --xr-disabled-color: #515151;\n",
  603. " --xr-background-color: #111111;\n",
  604. " --xr-background-color-row-even: #111111;\n",
  605. " --xr-background-color-row-odd: #313131;\n",
  606. "}\n",
  607. "\n",
  608. ".xr-wrap {\n",
  609. " display: block !important;\n",
  610. " min-width: 300px;\n",
  611. " max-width: 700px;\n",
  612. "}\n",
  613. "\n",
  614. ".xr-text-repr-fallback {\n",
  615. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  616. " display: none;\n",
  617. "}\n",
  618. "\n",
  619. ".xr-header {\n",
  620. " padding-top: 6px;\n",
  621. " padding-bottom: 6px;\n",
  622. " margin-bottom: 4px;\n",
  623. " border-bottom: solid 1px var(--xr-border-color);\n",
  624. "}\n",
  625. "\n",
  626. ".xr-header > div,\n",
  627. ".xr-header > ul {\n",
  628. " display: inline;\n",
  629. " margin-top: 0;\n",
  630. " margin-bottom: 0;\n",
  631. "}\n",
  632. "\n",
  633. ".xr-obj-type,\n",
  634. ".xr-array-name {\n",
  635. " margin-left: 2px;\n",
  636. " margin-right: 10px;\n",
  637. "}\n",
  638. "\n",
  639. ".xr-obj-type {\n",
  640. " color: var(--xr-font-color2);\n",
  641. "}\n",
  642. "\n",
  643. ".xr-sections {\n",
  644. " padding-left: 0 !important;\n",
  645. " display: grid;\n",
  646. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  647. "}\n",
  648. "\n",
  649. ".xr-section-item {\n",
  650. " display: contents;\n",
  651. "}\n",
  652. "\n",
  653. ".xr-section-item input {\n",
  654. " display: none;\n",
  655. "}\n",
  656. "\n",
  657. ".xr-section-item input + label {\n",
  658. " color: var(--xr-disabled-color);\n",
  659. "}\n",
  660. "\n",
  661. ".xr-section-item input:enabled + label {\n",
  662. " cursor: pointer;\n",
  663. " color: var(--xr-font-color2);\n",
  664. "}\n",
  665. "\n",
  666. ".xr-section-item input:enabled + label:hover {\n",
  667. " color: var(--xr-font-color0);\n",
  668. "}\n",
  669. "\n",
  670. ".xr-section-summary {\n",
  671. " grid-column: 1;\n",
  672. " color: var(--xr-font-color2);\n",
  673. " font-weight: 500;\n",
  674. "}\n",
  675. "\n",
  676. ".xr-section-summary > span {\n",
  677. " display: inline-block;\n",
  678. " padding-left: 0.5em;\n",
  679. "}\n",
  680. "\n",
  681. ".xr-section-summary-in:disabled + label {\n",
  682. " color: var(--xr-font-color2);\n",
  683. "}\n",
  684. "\n",
  685. ".xr-section-summary-in + label:before {\n",
  686. " display: inline-block;\n",
  687. " content: '►';\n",
  688. " font-size: 11px;\n",
  689. " width: 15px;\n",
  690. " text-align: center;\n",
  691. "}\n",
  692. "\n",
  693. ".xr-section-summary-in:disabled + label:before {\n",
  694. " color: var(--xr-disabled-color);\n",
  695. "}\n",
  696. "\n",
  697. ".xr-section-summary-in:checked + label:before {\n",
  698. " content: '▼';\n",
  699. "}\n",
  700. "\n",
  701. ".xr-section-summary-in:checked + label > span {\n",
  702. " display: none;\n",
  703. "}\n",
  704. "\n",
  705. ".xr-section-summary,\n",
  706. ".xr-section-inline-details {\n",
  707. " padding-top: 4px;\n",
  708. " padding-bottom: 4px;\n",
  709. "}\n",
  710. "\n",
  711. ".xr-section-inline-details {\n",
  712. " grid-column: 2 / -1;\n",
  713. "}\n",
  714. "\n",
  715. ".xr-section-details {\n",
  716. " display: none;\n",
  717. " grid-column: 1 / -1;\n",
  718. " margin-bottom: 5px;\n",
  719. "}\n",
  720. "\n",
  721. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  722. " display: contents;\n",
  723. "}\n",
  724. "\n",
  725. ".xr-array-wrap {\n",
  726. " grid-column: 1 / -1;\n",
  727. " display: grid;\n",
  728. " grid-template-columns: 20px auto;\n",
  729. "}\n",
  730. "\n",
  731. ".xr-array-wrap > label {\n",
  732. " grid-column: 1;\n",
  733. " vertical-align: top;\n",
  734. "}\n",
  735. "\n",
  736. ".xr-preview {\n",
  737. " color: var(--xr-font-color3);\n",
  738. "}\n",
  739. "\n",
  740. ".xr-array-preview,\n",
  741. ".xr-array-data {\n",
  742. " padding: 0 5px !important;\n",
  743. " grid-column: 2;\n",
  744. "}\n",
  745. "\n",
  746. ".xr-array-data,\n",
  747. ".xr-array-in:checked ~ .xr-array-preview {\n",
  748. " display: none;\n",
  749. "}\n",
  750. "\n",
  751. ".xr-array-in:checked ~ .xr-array-data,\n",
  752. ".xr-array-preview {\n",
  753. " display: inline-block;\n",
  754. "}\n",
  755. "\n",
  756. ".xr-dim-list {\n",
  757. " display: inline-block !important;\n",
  758. " list-style: none;\n",
  759. " padding: 0 !important;\n",
  760. " margin: 0;\n",
  761. "}\n",
  762. "\n",
  763. ".xr-dim-list li {\n",
  764. " display: inline-block;\n",
  765. " padding: 0;\n",
  766. " margin: 0;\n",
  767. "}\n",
  768. "\n",
  769. ".xr-dim-list:before {\n",
  770. " content: '(';\n",
  771. "}\n",
  772. "\n",
  773. ".xr-dim-list:after {\n",
  774. " content: ')';\n",
  775. "}\n",
  776. "\n",
  777. ".xr-dim-list li:not(:last-child):after {\n",
  778. " content: ',';\n",
  779. " padding-right: 5px;\n",
  780. "}\n",
  781. "\n",
  782. ".xr-has-index {\n",
  783. " font-weight: bold;\n",
  784. "}\n",
  785. "\n",
  786. ".xr-var-list,\n",
  787. ".xr-var-item {\n",
  788. " display: contents;\n",
  789. "}\n",
  790. "\n",
  791. ".xr-var-item > div,\n",
  792. ".xr-var-item label,\n",
  793. ".xr-var-item > .xr-var-name span {\n",
  794. " background-color: var(--xr-background-color-row-even);\n",
  795. " margin-bottom: 0;\n",
  796. "}\n",
  797. "\n",
  798. ".xr-var-item > .xr-var-name:hover span {\n",
  799. " padding-right: 5px;\n",
  800. "}\n",
  801. "\n",
  802. ".xr-var-list > li:nth-child(odd) > div,\n",
  803. ".xr-var-list > li:nth-child(odd) > label,\n",
  804. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  805. " background-color: var(--xr-background-color-row-odd);\n",
  806. "}\n",
  807. "\n",
  808. ".xr-var-name {\n",
  809. " grid-column: 1;\n",
  810. "}\n",
  811. "\n",
  812. ".xr-var-dims {\n",
  813. " grid-column: 2;\n",
  814. "}\n",
  815. "\n",
  816. ".xr-var-dtype {\n",
  817. " grid-column: 3;\n",
  818. " text-align: right;\n",
  819. " color: var(--xr-font-color2);\n",
  820. "}\n",
  821. "\n",
  822. ".xr-var-preview {\n",
  823. " grid-column: 4;\n",
  824. "}\n",
  825. "\n",
  826. ".xr-index-preview {\n",
  827. " grid-column: 2 / 5;\n",
  828. " color: var(--xr-font-color2);\n",
  829. "}\n",
  830. "\n",
  831. ".xr-var-name,\n",
  832. ".xr-var-dims,\n",
  833. ".xr-var-dtype,\n",
  834. ".xr-preview,\n",
  835. ".xr-attrs dt {\n",
  836. " white-space: nowrap;\n",
  837. " overflow: hidden;\n",
  838. " text-overflow: ellipsis;\n",
  839. " padding-right: 10px;\n",
  840. "}\n",
  841. "\n",
  842. ".xr-var-name:hover,\n",
  843. ".xr-var-dims:hover,\n",
  844. ".xr-var-dtype:hover,\n",
  845. ".xr-attrs dt:hover {\n",
  846. " overflow: visible;\n",
  847. " width: auto;\n",
  848. " z-index: 1;\n",
  849. "}\n",
  850. "\n",
  851. ".xr-var-attrs,\n",
  852. ".xr-var-data,\n",
  853. ".xr-index-data {\n",
  854. " display: none;\n",
  855. " background-color: var(--xr-background-color) !important;\n",
  856. " padding-bottom: 5px !important;\n",
  857. "}\n",
  858. "\n",
  859. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  860. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  861. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  862. " display: block;\n",
  863. "}\n",
  864. "\n",
  865. ".xr-var-data > table {\n",
  866. " float: right;\n",
  867. "}\n",
  868. "\n",
  869. ".xr-var-name span,\n",
  870. ".xr-var-data,\n",
  871. ".xr-index-name div,\n",
  872. ".xr-index-data,\n",
  873. ".xr-attrs {\n",
  874. " padding-left: 25px !important;\n",
  875. "}\n",
  876. "\n",
  877. ".xr-attrs,\n",
  878. ".xr-var-attrs,\n",
  879. ".xr-var-data,\n",
  880. ".xr-index-data {\n",
  881. " grid-column: 1 / -1;\n",
  882. "}\n",
  883. "\n",
  884. "dl.xr-attrs {\n",
  885. " padding: 0;\n",
  886. " margin: 0;\n",
  887. " display: grid;\n",
  888. " grid-template-columns: 125px auto;\n",
  889. "}\n",
  890. "\n",
  891. ".xr-attrs dt,\n",
  892. ".xr-attrs dd {\n",
  893. " padding: 0;\n",
  894. " margin: 0;\n",
  895. " float: left;\n",
  896. " padding-right: 10px;\n",
  897. " width: auto;\n",
  898. "}\n",
  899. "\n",
  900. ".xr-attrs dt {\n",
  901. " font-weight: normal;\n",
  902. " grid-column: 1;\n",
  903. "}\n",
  904. "\n",
  905. ".xr-attrs dt:hover span {\n",
  906. " display: inline-block;\n",
  907. " background: var(--xr-background-color);\n",
  908. " padding-right: 10px;\n",
  909. "}\n",
  910. "\n",
  911. ".xr-attrs dd {\n",
  912. " grid-column: 2;\n",
  913. " white-space: pre-wrap;\n",
  914. " word-break: break-all;\n",
  915. "}\n",
  916. "\n",
  917. ".xr-icon-database,\n",
  918. ".xr-icon-file-text2,\n",
  919. ".xr-no-icon {\n",
  920. " display: inline-block;\n",
  921. " vertical-align: middle;\n",
  922. " width: 1em;\n",
  923. " height: 1.5em !important;\n",
  924. " stroke-width: 0;\n",
  925. " stroke: currentColor;\n",
  926. " fill: currentColor;\n",
  927. "}\n",
  928. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt;\n",
  929. "Dimensions: (runs: 5, truncation_value: 11, y: 1200, x: 1920)\n",
  930. "Coordinates:\n",
  931. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  932. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0\n",
  933. "Dimensions without coordinates: y, x\n",
  934. "Data variables:\n",
  935. " atoms (runs, truncation_value, y, x) uint16 99 100 ... 126 129\n",
  936. " background (runs, truncation_value, y, x) uint16 103 100 ... 122 124\n",
  937. " dark (runs, truncation_value, y, x) uint16 51 52 52 ... 49 50\n",
  938. " shotNum (runs, truncation_value) &lt;U2 &#x27;00&#x27; &#x27;01&#x27; &#x27;02&#x27; ... &#x27;53&#x27; &#x27;54&#x27;\n",
  939. "Attributes: (12/100)\n",
  940. " TOF_free: 0.02\n",
  941. " abs_img_freq: 110.866\n",
  942. " absorption_imaging_flag: True\n",
  943. " backup_data: True\n",
  944. " blink_off_time: nan\n",
  945. " blink_on_time: nan\n",
  946. " ... ...\n",
  947. " z_offset: 0.195\n",
  948. " z_offset_img: 0.195\n",
  949. " truncation_value: [0.8 0.83 0.85 0.87 0.89 0.91 0.93 0....\n",
  950. " runs: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1...\n",
  951. " scanAxis: [&#x27;runs&#x27; &#x27;truncation_value&#x27;]\n",
  952. " scanAxisLength: [55. 55.]</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-f6866415-13e6-4ceb-9e2b-bb7ccda03142' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f6866415-13e6-4ceb-9e2b-bb7ccda03142' 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>: 5</li><li><span class='xr-has-index'>truncation_value</span>: 11</li><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-e5d20d4c-8cf2-4236-9189-e341a83a1b66' class='xr-section-summary-in' type='checkbox' checked><label for='section-e5d20d4c-8cf2-4236-9189-e341a83a1b66' class='xr-section-summary' >Coordinates: <span>(2)</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 3.0 4.0</div><input id='attrs-c9415d14-bf51-46e8-9859-e5bfddddc1dd' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c9415d14-bf51-46e8-9859-e5bfddddc1dd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-01eac335-7b56-462b-8231-7467bd19d7c0' class='xr-var-data-in' type='checkbox'><label for='data-01eac335-7b56-462b-8231-7467bd19d7c0' 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., 3., 4.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>truncation_value</span></div><div class='xr-var-dims'>(truncation_value)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.8 0.83 0.85 ... 0.97 0.99 1.0</div><input id='attrs-dc9d5dc6-8fe5-4e0a-87ea-409689e906af' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-dc9d5dc6-8fe5-4e0a-87ea-409689e906af' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ca9ff513-98c4-4649-874e-dbd81877bbf1' class='xr-var-data-in' type='checkbox'><label for='data-ca9ff513-98c4-4649-874e-dbd81877bbf1' 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.8 , 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1. ])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3d03f457-3b77-4a87-9eaa-8e130f0a616b' class='xr-section-summary-in' type='checkbox' checked><label for='section-3d03f457-3b77-4a87-9eaa-8e130f0a616b' class='xr-section-summary' >Data variables: <span>(4)</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, truncation_value, y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>99 100 102 87 ... 130 125 126 129</div><input id='attrs-4309b054-d25d-4782-8642-c423c254d48c' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-4309b054-d25d-4782-8642-c423c254d48c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1616364a-d417-4fea-8bc5-96a6bafbf0f6' class='xr-var-data-in' type='checkbox'><label for='data-1616364a-d417-4fea-8bc5-96a6bafbf0f6' title='
  953. " [100, 106, 99, ..., 149, 148, 146],\n",
  954. " [ 94, 95, 96, ..., 139, 144, 148],\n",
  955. " ...,\n",
  956. " [ 98, 106, 105, ..., 133, 142, 142],\n",
  957. " [112, 109, 102, ..., 128, 136, 131],\n",
  958. " [112, 113, 111, ..., 121, 122, 131]],\n",
  959. "\n",
  960. " [[102, 103, 100, ..., 155, 154, 142],\n",
  961. " [ 97, 100, 101, ..., 146, 146, 156],\n",
  962. " [ 91, 93, 97, ..., 142, 136, 151],\n",
  963. " ...,\n",
  964. " [105, 103, 103, ..., 144, 134, 142],\n",
  965. " [102, 104, 112, ..., 133, 134, 135],\n",
  966. " [114, 115, 113, ..., 119, 126, 122]],\n",
  967. "\n",
  968. " [[101, 105, 103, ..., 148, 152, 146],\n",
  969. " [101, 102, 98, ..., 143, 146, 149],\n",
  970. " [ 97, 98, 98, ..., 139, 137, 146],\n",
  971. " ...,\n",
  972. "...\n",
  973. " ...,\n",
  974. " [100, 102, 109, ..., 135, 141, 140],\n",
  975. " [106, 103, 105, ..., 128, 140, 132],\n",
  976. " [114, 107, 108, ..., 121, 123, 126]],\n",
  977. "\n",
  978. " [[101, 102, 101, ..., 153, 153, 146],\n",
  979. " [101, 103, 100, ..., 148, 143, 149],\n",
  980. " [ 96, 95, 98, ..., 145, 138, 144],\n",
  981. " ...,\n",
  982. " [ 98, 107, 103, ..., 140, 142, 145],\n",
  983. " [106, 100, 103, ..., 133, 133, 136],\n",
  984. " [115, 103, 102, ..., 123, 125, 128]],\n",
  985. "\n",
  986. " [[103, 100, 102, ..., 154, 147, 153],\n",
  987. " [ 96, 103, 97, ..., 150, 150, 152],\n",
  988. " [ 96, 100, 96, ..., 141, 142, 144],\n",
  989. " ...,\n",
  990. " [101, 102, 101, ..., 139, 142, 140],\n",
  991. " [105, 105, 98, ..., 132, 135, 131],\n",
  992. " [109, 111, 107, ..., 125, 126, 129]]]], dtype=uint16)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(runs, truncation_value, y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>103 100 101 92 ... 130 122 122 124</div><input id='attrs-f9914ab6-98a1-4a63-8217-da175587ca5e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f9914ab6-98a1-4a63-8217-da175587ca5e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-abec8df5-4e10-4673-ac41-49e32040b672' class='xr-var-data-in' type='checkbox'><label for='data-abec8df5-4e10-4673-ac41-49e32040b672' 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'><pre>array([[[[103, 100, 101, ..., 161, 147, 146],\n",
  993. " [101, 96, 97, ..., 146, 144, 146],\n",
  994. " [ 92, 95, 96, ..., 143, 134, 149],\n",
  995. " ...,\n",
  996. " [104, 103, 107, ..., 139, 142, 137],\n",
  997. " [104, 105, 109, ..., 128, 133, 130],\n",
  998. " [111, 111, 107, ..., 118, 120, 123]],\n",
  999. "\n",
  1000. " [[ 96, 100, 99, ..., 155, 149, 139],\n",
  1001. " [ 94, 101, 100, ..., 149, 143, 151],\n",
  1002. " [ 94, 90, 97, ..., 140, 143, 139],\n",
  1003. " ...,\n",
  1004. " [103, 105, 103, ..., 126, 139, 144],\n",
  1005. " [104, 111, 105, ..., 131, 136, 134],\n",
  1006. " [111, 112, 104, ..., 121, 126, 137]],\n",
  1007. "\n",
  1008. " [[101, 99, 107, ..., 154, 146, 151],\n",
  1009. " [ 97, 101, 100, ..., 148, 148, 145],\n",
  1010. " [ 87, 102, 100, ..., 145, 133, 140],\n",
  1011. " ...,\n",
  1012. "...\n",
  1013. " ...,\n",
  1014. " [105, 100, 99, ..., 132, 142, 137],\n",
  1015. " [ 96, 104, 102, ..., 133, 135, 133],\n",
  1016. " [110, 109, 103, ..., 123, 122, 119]],\n",
  1017. "\n",
  1018. " [[101, 102, 101, ..., 156, 154, 149],\n",
  1019. " [ 95, 99, 99, ..., 140, 146, 153],\n",
  1020. " [ 91, 103, 97, ..., 142, 140, 147],\n",
  1021. " ...,\n",
  1022. " [ 98, 106, 106, ..., 132, 139, 147],\n",
  1023. " [102, 110, 108, ..., 127, 130, 131],\n",
  1024. " [110, 109, 106, ..., 127, 125, 127]],\n",
  1025. "\n",
  1026. " [[103, 106, 105, ..., 146, 146, 147],\n",
  1027. " [ 99, 103, 102, ..., 152, 142, 152],\n",
  1028. " [ 97, 100, 92, ..., 143, 138, 156],\n",
  1029. " ...,\n",
  1030. " [104, 108, 105, ..., 142, 141, 139],\n",
  1031. " [107, 104, 104, ..., 131, 137, 128],\n",
  1032. " [110, 109, 107, ..., 122, 122, 124]]]], dtype=uint16)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(runs, truncation_value, y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>51 52 52 51 51 ... 52 50 53 49 50</div><input id='attrs-76370da3-3eeb-4ffc-8da7-38cfa32416fd' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-76370da3-3eeb-4ffc-8da7-38cfa32416fd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-90342ed7-aa13-46bd-a2cb-f0f48910fe9d' class='xr-var-data-in' type='checkbox'><label for='data-90342ed7-aa13-46bd-a2cb-f0f48910fe9d' 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'><pre>array([[[[51, 52, 52, ..., 50, 51, 51],\n",
  1033. " [50, 50, 51, ..., 51, 51, 49],\n",
  1034. " [51, 51, 50, ..., 50, 50, 49],\n",
  1035. " ...,\n",
  1036. " [50, 51, 50, ..., 50, 50, 49],\n",
  1037. " [50, 50, 49, ..., 50, 50, 51],\n",
  1038. " [51, 50, 50, ..., 50, 50, 51]],\n",
  1039. "\n",
  1040. " [[50, 52, 51, ..., 50, 50, 49],\n",
  1041. " [51, 50, 50, ..., 50, 50, 50],\n",
  1042. " [50, 51, 49, ..., 50, 50, 51],\n",
  1043. " ...,\n",
  1044. " [51, 50, 50, ..., 52, 50, 51],\n",
  1045. " [51, 50, 51, ..., 50, 52, 51],\n",
  1046. " [51, 52, 51, ..., 51, 50, 50]],\n",
  1047. "\n",
  1048. " [[51, 51, 52, ..., 51, 51, 50],\n",
  1049. " [50, 50, 51, ..., 51, 51, 51],\n",
  1050. " [50, 50, 50, ..., 50, 50, 50],\n",
  1051. " ...,\n",
  1052. "...\n",
  1053. " ...,\n",
  1054. " [51, 50, 51, ..., 51, 51, 51],\n",
  1055. " [50, 49, 50, ..., 49, 51, 51],\n",
  1056. " [50, 51, 50, ..., 50, 49, 51]],\n",
  1057. "\n",
  1058. " [[50, 50, 50, ..., 51, 50, 51],\n",
  1059. " [51, 50, 51, ..., 51, 50, 49],\n",
  1060. " [52, 49, 50, ..., 52, 51, 51],\n",
  1061. " ...,\n",
  1062. " [50, 50, 50, ..., 49, 50, 49],\n",
  1063. " [50, 49, 51, ..., 51, 50, 51],\n",
  1064. " [52, 51, 52, ..., 50, 51, 51]],\n",
  1065. "\n",
  1066. " [[50, 51, 49, ..., 50, 51, 51],\n",
  1067. " [51, 52, 51, ..., 51, 51, 50],\n",
  1068. " [52, 51, 51, ..., 49, 51, 51],\n",
  1069. " ...,\n",
  1070. " [52, 50, 51, ..., 52, 50, 51],\n",
  1071. " [50, 51, 50, ..., 51, 50, 50],\n",
  1072. " [50, 51, 51, ..., 53, 49, 50]]]], dtype=uint16)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>(runs, truncation_value)</div><div class='xr-var-dtype'>&lt;U2</div><div class='xr-var-preview xr-preview'>&#x27;00&#x27; &#x27;01&#x27; &#x27;02&#x27; ... &#x27;52&#x27; &#x27;53&#x27; &#x27;54&#x27;</div><input id='attrs-d222e2e8-8564-45fc-91cc-6a8ef6b20bc2' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d222e2e8-8564-45fc-91cc-6a8ef6b20bc2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-82580c3f-c948-4675-a4fa-39d0c59b6cea' class='xr-var-data-in' type='checkbox'><label for='data-82580c3f-c948-4675-a4fa-39d0c59b6cea' 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;00&#x27;, &#x27;01&#x27;, &#x27;02&#x27;, &#x27;03&#x27;, &#x27;04&#x27;, &#x27;05&#x27;, &#x27;06&#x27;, &#x27;07&#x27;, &#x27;08&#x27;, &#x27;09&#x27;, &#x27;10&#x27;],\n",
  1073. " [&#x27;11&#x27;, &#x27;12&#x27;, &#x27;13&#x27;, &#x27;14&#x27;, &#x27;15&#x27;, &#x27;16&#x27;, &#x27;17&#x27;, &#x27;18&#x27;, &#x27;19&#x27;, &#x27;20&#x27;, &#x27;21&#x27;],\n",
  1074. " [&#x27;22&#x27;, &#x27;23&#x27;, &#x27;24&#x27;, &#x27;25&#x27;, &#x27;26&#x27;, &#x27;27&#x27;, &#x27;28&#x27;, &#x27;29&#x27;, &#x27;30&#x27;, &#x27;31&#x27;, &#x27;32&#x27;],\n",
  1075. " [&#x27;33&#x27;, &#x27;34&#x27;, &#x27;35&#x27;, &#x27;36&#x27;, &#x27;37&#x27;, &#x27;38&#x27;, &#x27;39&#x27;, &#x27;40&#x27;, &#x27;41&#x27;, &#x27;42&#x27;, &#x27;43&#x27;],\n",
  1076. " [&#x27;44&#x27;, &#x27;45&#x27;, &#x27;46&#x27;, &#x27;47&#x27;, &#x27;48&#x27;, &#x27;49&#x27;, &#x27;50&#x27;, &#x27;51&#x27;, &#x27;52&#x27;, &#x27;53&#x27;, &#x27;54&#x27;]],\n",
  1077. " dtype=&#x27;&lt;U2&#x27;)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-330a8433-d4b6-47ea-9e85-5fdc7612e0e9' class='xr-section-summary-in' type='checkbox' ><label for='section-330a8433-d4b6-47ea-9e85-5fdc7612e0e9' class='xr-section-summary' >Indexes: <span>(2)</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-3f3fae6c-3d6d-4507-a2c3-e03b55fa5052' class='xr-index-data-in' type='checkbox'/><label for='index-3f3fae6c-3d6d-4507-a2c3-e03b55fa5052' 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, 3.0, 4.0], dtype=&#x27;float64&#x27;, name=&#x27;runs&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>truncation_value</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-de25337f-f532-44ee-abbc-badfdecb8ec4' class='xr-index-data-in' type='checkbox'/><label for='index-de25337f-f532-44ee-abbc-badfdecb8ec4' 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.8, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1.0], dtype=&#x27;float64&#x27;, name=&#x27;truncation_value&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-0e9068ec-5b28-4b91-999c-6fe2882e98ec' class='xr-section-summary-in' type='checkbox' ><label for='section-0e9068ec-5b28-4b91-999c-6fe2882e98ec' class='xr-section-summary' >Attributes: <span>(100)</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.866</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.195</dd><dt><span>compZ_final_current :</span></dt><dd>0.287</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_final_pow_1 :</span></dt><dd>4.8</dd><dt><span>evap_1_final_pow_2 :</span></dt><dd>2.2</dd><dt><span>evap_1_final_pow_3 :</span></dt><dd>1.2</dd><dt><span>evap_1_final_pow_4 :</span></dt><dd>0.526</dd><dt><span>evap_1_ramp_duration_1 :</span></dt><dd>0.15</dd><dt><span>evap_1_ramp_duration_2 :</span></dt><dd>0.3</dd><dt><span>evap_1_ramp_duration_3 :</span></dt><dd>0.2</dd><dt><span>evap_1_ramp_duration_4 :</span></dt><dd>0.5</dd><dt><span>evap_1_start_pow_1 :</span></dt><dd>7</dd><dt><span>evap_1_start_pow_2 :</span></dt><dd>4.8</dd><dt><span>evap_1_start_pow_3 :</span></dt><dd>2.2</dd><dt><span>evap_1_start_pow_4 :</span></dt><dd>1.2</dd><dt><span>evap_2_final_pow_1 :</span></dt><dd>0.35</dd><dt><span>evap_2_ramp_duration_1 :</span></dt><dd>0.5</dd><dt><span>evap_2_start_pow_1 :</span></dt><dd>0.526</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd
  1078. " 0.87 0.89 0.91 0.93 0.95 0.97 0.99 1. 0.8 0.83 0.85 0.87 0.89 0.91\n",
  1079. " 0.93 0.95 0.97 0.99 1. 0.8 0.83 0.85 0.87 0.89 0.91 0.93 0.95 0.97\n",
  1080. " 0.99 1. 0.8 0.83 0.85 0.87 0.89 0.91 0.93 0.95 0.97 0.99 1. ]</dd><dt><span>runs :</span></dt><dd>[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 2. 2.\n",
  1081. " 2. 2. 2. 2. 2. 2. 2. 2. 2. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 4. 4. 4. 4.\n",
  1082. " 4. 4. 4. 4. 4. 4. 4.]</dd><dt><span>scanAxis :</span></dt><dd>[&#x27;runs&#x27; &#x27;truncation_value&#x27;]</dd><dt><span>scanAxisLength :</span></dt><dd>[55. 55.]</dd></dl></div></li></ul></div></div>"
  1083. ],
  1084. "text/plain": [
  1085. "<xarray.Dataset>\n",
  1086. "Dimensions: (runs: 5, truncation_value: 11, y: 1200, x: 1920)\n",
  1087. "Coordinates:\n",
  1088. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  1089. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0\n",
  1090. "Dimensions without coordinates: y, x\n",
  1091. "Data variables:\n",
  1092. " atoms (runs, truncation_value, y, x) uint16 99 100 ... 126 129\n",
  1093. " background (runs, truncation_value, y, x) uint16 103 100 ... 122 124\n",
  1094. " dark (runs, truncation_value, y, x) uint16 51 52 52 ... 49 50\n",
  1095. " shotNum (runs, truncation_value) <U2 '00' '01' '02' ... '53' '54'\n",
  1096. "Attributes: (12/100)\n",
  1097. " TOF_free: 0.02\n",
  1098. " abs_img_freq: 110.866\n",
  1099. " absorption_imaging_flag: True\n",
  1100. " backup_data: True\n",
  1101. " blink_off_time: nan\n",
  1102. " blink_on_time: nan\n",
  1103. " ... ...\n",
  1104. " z_offset: 0.195\n",
  1105. " z_offset_img: 0.195\n",
  1106. " truncation_value: [0.8 0.83 0.85 0.87 0.89 0.91 0.93 0....\n",
  1107. " runs: [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1...\n",
  1108. " scanAxis: ['runs' 'truncation_value']\n",
  1109. " scanAxisLength: [55. 55.]"
  1110. ]
  1111. },
  1112. "execution_count": 5,
  1113. "metadata": {},
  1114. "output_type": "execute_result"
  1115. }
  1116. ],
  1117. "source": [
  1118. "shotNum = \"0058\"\n",
  1119. "filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
  1120. "\n",
  1121. "dataSetDict = {\n",
  1122. " dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
  1123. " for i in [0] # range(len(groupList)) # uncommont to load data for all three cameras\n",
  1124. "}\n",
  1125. "dataSet = dataSetDict[\"camera_0\"]\n",
  1126. "\n",
  1127. "dataSet = swap_xy(dataSet)\n",
  1128. "\n",
  1129. "scanAxis = get_scanAxis(dataSet)\n",
  1130. "\n",
  1131. "dataSet = auto_rechunk(dataSet)\n",
  1132. "\n",
  1133. "dataSet.load()"
  1134. ]
  1135. },
  1136. {
  1137. "cell_type": "markdown",
  1138. "metadata": {},
  1139. "source": [
  1140. "## Index and select data"
  1141. ]
  1142. },
  1143. {
  1144. "cell_type": "markdown",
  1145. "metadata": {},
  1146. "source": [
  1147. "Since we use the xarray package, in fact, it already has a well developed function to index and select the data. Therefore, have a look of the following link\n",
  1148. "\n",
  1149. "https://docs.xarray.dev/en/stable/user-guide/indexing.html"
  1150. ]
  1151. },
  1152. {
  1153. "cell_type": "markdown",
  1154. "metadata": {},
  1155. "source": [
  1156. "## Modify the data"
  1157. ]
  1158. },
  1159. {
  1160. "cell_type": "markdown",
  1161. "metadata": {},
  1162. "source": [
  1163. "There are two ways to select an element in xarray and modify the value of it."
  1164. ]
  1165. },
  1166. {
  1167. "cell_type": "markdown",
  1168. "metadata": {},
  1169. "source": [
  1170. "### Select by value"
  1171. ]
  1172. },
  1173. {
  1174. "cell_type": "markdown",
  1175. "metadata": {},
  1176. "source": [
  1177. "The first method is to select it by the value of coordiante.\n",
  1178. "\n",
  1179. "Here is an emaxple of selecting the element in 'ShotNum' at 'runs'=0, truncation_value=0.8, and change it to '-1'."
  1180. ]
  1181. },
  1182. {
  1183. "cell_type": "code",
  1184. "execution_count": 6,
  1185. "metadata": {},
  1186. "outputs": [
  1187. {
  1188. "data": {
  1189. "text/html": [
  1190. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  1191. "<defs>\n",
  1192. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  1193. "<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",
  1194. "<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",
  1195. "<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",
  1196. "</symbol>\n",
  1197. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  1198. "<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",
  1199. "<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",
  1200. "<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",
  1201. "<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",
  1202. "</symbol>\n",
  1203. "</defs>\n",
  1204. "</svg>\n",
  1205. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  1206. " *\n",
  1207. " */\n",
  1208. "\n",
  1209. ":root {\n",
  1210. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  1211. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  1212. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  1213. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  1214. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  1215. " --xr-background-color: var(--jp-layout-color0, white);\n",
  1216. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  1217. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  1218. "}\n",
  1219. "\n",
  1220. "html[theme=dark],\n",
  1221. "body[data-theme=dark],\n",
  1222. "body.vscode-dark {\n",
  1223. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  1224. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  1225. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  1226. " --xr-border-color: #1F1F1F;\n",
  1227. " --xr-disabled-color: #515151;\n",
  1228. " --xr-background-color: #111111;\n",
  1229. " --xr-background-color-row-even: #111111;\n",
  1230. " --xr-background-color-row-odd: #313131;\n",
  1231. "}\n",
  1232. "\n",
  1233. ".xr-wrap {\n",
  1234. " display: block !important;\n",
  1235. " min-width: 300px;\n",
  1236. " max-width: 700px;\n",
  1237. "}\n",
  1238. "\n",
  1239. ".xr-text-repr-fallback {\n",
  1240. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  1241. " display: none;\n",
  1242. "}\n",
  1243. "\n",
  1244. ".xr-header {\n",
  1245. " padding-top: 6px;\n",
  1246. " padding-bottom: 6px;\n",
  1247. " margin-bottom: 4px;\n",
  1248. " border-bottom: solid 1px var(--xr-border-color);\n",
  1249. "}\n",
  1250. "\n",
  1251. ".xr-header > div,\n",
  1252. ".xr-header > ul {\n",
  1253. " display: inline;\n",
  1254. " margin-top: 0;\n",
  1255. " margin-bottom: 0;\n",
  1256. "}\n",
  1257. "\n",
  1258. ".xr-obj-type,\n",
  1259. ".xr-array-name {\n",
  1260. " margin-left: 2px;\n",
  1261. " margin-right: 10px;\n",
  1262. "}\n",
  1263. "\n",
  1264. ".xr-obj-type {\n",
  1265. " color: var(--xr-font-color2);\n",
  1266. "}\n",
  1267. "\n",
  1268. ".xr-sections {\n",
  1269. " padding-left: 0 !important;\n",
  1270. " display: grid;\n",
  1271. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  1272. "}\n",
  1273. "\n",
  1274. ".xr-section-item {\n",
  1275. " display: contents;\n",
  1276. "}\n",
  1277. "\n",
  1278. ".xr-section-item input {\n",
  1279. " display: none;\n",
  1280. "}\n",
  1281. "\n",
  1282. ".xr-section-item input + label {\n",
  1283. " color: var(--xr-disabled-color);\n",
  1284. "}\n",
  1285. "\n",
  1286. ".xr-section-item input:enabled + label {\n",
  1287. " cursor: pointer;\n",
  1288. " color: var(--xr-font-color2);\n",
  1289. "}\n",
  1290. "\n",
  1291. ".xr-section-item input:enabled + label:hover {\n",
  1292. " color: var(--xr-font-color0);\n",
  1293. "}\n",
  1294. "\n",
  1295. ".xr-section-summary {\n",
  1296. " grid-column: 1;\n",
  1297. " color: var(--xr-font-color2);\n",
  1298. " font-weight: 500;\n",
  1299. "}\n",
  1300. "\n",
  1301. ".xr-section-summary > span {\n",
  1302. " display: inline-block;\n",
  1303. " padding-left: 0.5em;\n",
  1304. "}\n",
  1305. "\n",
  1306. ".xr-section-summary-in:disabled + label {\n",
  1307. " color: var(--xr-font-color2);\n",
  1308. "}\n",
  1309. "\n",
  1310. ".xr-section-summary-in + label:before {\n",
  1311. " display: inline-block;\n",
  1312. " content: '►';\n",
  1313. " font-size: 11px;\n",
  1314. " width: 15px;\n",
  1315. " text-align: center;\n",
  1316. "}\n",
  1317. "\n",
  1318. ".xr-section-summary-in:disabled + label:before {\n",
  1319. " color: var(--xr-disabled-color);\n",
  1320. "}\n",
  1321. "\n",
  1322. ".xr-section-summary-in:checked + label:before {\n",
  1323. " content: '▼';\n",
  1324. "}\n",
  1325. "\n",
  1326. ".xr-section-summary-in:checked + label > span {\n",
  1327. " display: none;\n",
  1328. "}\n",
  1329. "\n",
  1330. ".xr-section-summary,\n",
  1331. ".xr-section-inline-details {\n",
  1332. " padding-top: 4px;\n",
  1333. " padding-bottom: 4px;\n",
  1334. "}\n",
  1335. "\n",
  1336. ".xr-section-inline-details {\n",
  1337. " grid-column: 2 / -1;\n",
  1338. "}\n",
  1339. "\n",
  1340. ".xr-section-details {\n",
  1341. " display: none;\n",
  1342. " grid-column: 1 / -1;\n",
  1343. " margin-bottom: 5px;\n",
  1344. "}\n",
  1345. "\n",
  1346. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  1347. " display: contents;\n",
  1348. "}\n",
  1349. "\n",
  1350. ".xr-array-wrap {\n",
  1351. " grid-column: 1 / -1;\n",
  1352. " display: grid;\n",
  1353. " grid-template-columns: 20px auto;\n",
  1354. "}\n",
  1355. "\n",
  1356. ".xr-array-wrap > label {\n",
  1357. " grid-column: 1;\n",
  1358. " vertical-align: top;\n",
  1359. "}\n",
  1360. "\n",
  1361. ".xr-preview {\n",
  1362. " color: var(--xr-font-color3);\n",
  1363. "}\n",
  1364. "\n",
  1365. ".xr-array-preview,\n",
  1366. ".xr-array-data {\n",
  1367. " padding: 0 5px !important;\n",
  1368. " grid-column: 2;\n",
  1369. "}\n",
  1370. "\n",
  1371. ".xr-array-data,\n",
  1372. ".xr-array-in:checked ~ .xr-array-preview {\n",
  1373. " display: none;\n",
  1374. "}\n",
  1375. "\n",
  1376. ".xr-array-in:checked ~ .xr-array-data,\n",
  1377. ".xr-array-preview {\n",
  1378. " display: inline-block;\n",
  1379. "}\n",
  1380. "\n",
  1381. ".xr-dim-list {\n",
  1382. " display: inline-block !important;\n",
  1383. " list-style: none;\n",
  1384. " padding: 0 !important;\n",
  1385. " margin: 0;\n",
  1386. "}\n",
  1387. "\n",
  1388. ".xr-dim-list li {\n",
  1389. " display: inline-block;\n",
  1390. " padding: 0;\n",
  1391. " margin: 0;\n",
  1392. "}\n",
  1393. "\n",
  1394. ".xr-dim-list:before {\n",
  1395. " content: '(';\n",
  1396. "}\n",
  1397. "\n",
  1398. ".xr-dim-list:after {\n",
  1399. " content: ')';\n",
  1400. "}\n",
  1401. "\n",
  1402. ".xr-dim-list li:not(:last-child):after {\n",
  1403. " content: ',';\n",
  1404. " padding-right: 5px;\n",
  1405. "}\n",
  1406. "\n",
  1407. ".xr-has-index {\n",
  1408. " font-weight: bold;\n",
  1409. "}\n",
  1410. "\n",
  1411. ".xr-var-list,\n",
  1412. ".xr-var-item {\n",
  1413. " display: contents;\n",
  1414. "}\n",
  1415. "\n",
  1416. ".xr-var-item > div,\n",
  1417. ".xr-var-item label,\n",
  1418. ".xr-var-item > .xr-var-name span {\n",
  1419. " background-color: var(--xr-background-color-row-even);\n",
  1420. " margin-bottom: 0;\n",
  1421. "}\n",
  1422. "\n",
  1423. ".xr-var-item > .xr-var-name:hover span {\n",
  1424. " padding-right: 5px;\n",
  1425. "}\n",
  1426. "\n",
  1427. ".xr-var-list > li:nth-child(odd) > div,\n",
  1428. ".xr-var-list > li:nth-child(odd) > label,\n",
  1429. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  1430. " background-color: var(--xr-background-color-row-odd);\n",
  1431. "}\n",
  1432. "\n",
  1433. ".xr-var-name {\n",
  1434. " grid-column: 1;\n",
  1435. "}\n",
  1436. "\n",
  1437. ".xr-var-dims {\n",
  1438. " grid-column: 2;\n",
  1439. "}\n",
  1440. "\n",
  1441. ".xr-var-dtype {\n",
  1442. " grid-column: 3;\n",
  1443. " text-align: right;\n",
  1444. " color: var(--xr-font-color2);\n",
  1445. "}\n",
  1446. "\n",
  1447. ".xr-var-preview {\n",
  1448. " grid-column: 4;\n",
  1449. "}\n",
  1450. "\n",
  1451. ".xr-index-preview {\n",
  1452. " grid-column: 2 / 5;\n",
  1453. " color: var(--xr-font-color2);\n",
  1454. "}\n",
  1455. "\n",
  1456. ".xr-var-name,\n",
  1457. ".xr-var-dims,\n",
  1458. ".xr-var-dtype,\n",
  1459. ".xr-preview,\n",
  1460. ".xr-attrs dt {\n",
  1461. " white-space: nowrap;\n",
  1462. " overflow: hidden;\n",
  1463. " text-overflow: ellipsis;\n",
  1464. " padding-right: 10px;\n",
  1465. "}\n",
  1466. "\n",
  1467. ".xr-var-name:hover,\n",
  1468. ".xr-var-dims:hover,\n",
  1469. ".xr-var-dtype:hover,\n",
  1470. ".xr-attrs dt:hover {\n",
  1471. " overflow: visible;\n",
  1472. " width: auto;\n",
  1473. " z-index: 1;\n",
  1474. "}\n",
  1475. "\n",
  1476. ".xr-var-attrs,\n",
  1477. ".xr-var-data,\n",
  1478. ".xr-index-data {\n",
  1479. " display: none;\n",
  1480. " background-color: var(--xr-background-color) !important;\n",
  1481. " padding-bottom: 5px !important;\n",
  1482. "}\n",
  1483. "\n",
  1484. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  1485. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  1486. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  1487. " display: block;\n",
  1488. "}\n",
  1489. "\n",
  1490. ".xr-var-data > table {\n",
  1491. " float: right;\n",
  1492. "}\n",
  1493. "\n",
  1494. ".xr-var-name span,\n",
  1495. ".xr-var-data,\n",
  1496. ".xr-index-name div,\n",
  1497. ".xr-index-data,\n",
  1498. ".xr-attrs {\n",
  1499. " padding-left: 25px !important;\n",
  1500. "}\n",
  1501. "\n",
  1502. ".xr-attrs,\n",
  1503. ".xr-var-attrs,\n",
  1504. ".xr-var-data,\n",
  1505. ".xr-index-data {\n",
  1506. " grid-column: 1 / -1;\n",
  1507. "}\n",
  1508. "\n",
  1509. "dl.xr-attrs {\n",
  1510. " padding: 0;\n",
  1511. " margin: 0;\n",
  1512. " display: grid;\n",
  1513. " grid-template-columns: 125px auto;\n",
  1514. "}\n",
  1515. "\n",
  1516. ".xr-attrs dt,\n",
  1517. ".xr-attrs dd {\n",
  1518. " padding: 0;\n",
  1519. " margin: 0;\n",
  1520. " float: left;\n",
  1521. " padding-right: 10px;\n",
  1522. " width: auto;\n",
  1523. "}\n",
  1524. "\n",
  1525. ".xr-attrs dt {\n",
  1526. " font-weight: normal;\n",
  1527. " grid-column: 1;\n",
  1528. "}\n",
  1529. "\n",
  1530. ".xr-attrs dt:hover span {\n",
  1531. " display: inline-block;\n",
  1532. " background: var(--xr-background-color);\n",
  1533. " padding-right: 10px;\n",
  1534. "}\n",
  1535. "\n",
  1536. ".xr-attrs dd {\n",
  1537. " grid-column: 2;\n",
  1538. " white-space: pre-wrap;\n",
  1539. " word-break: break-all;\n",
  1540. "}\n",
  1541. "\n",
  1542. ".xr-icon-database,\n",
  1543. ".xr-icon-file-text2,\n",
  1544. ".xr-no-icon {\n",
  1545. " display: inline-block;\n",
  1546. " vertical-align: middle;\n",
  1547. " width: 1em;\n",
  1548. " height: 1.5em !important;\n",
  1549. " stroke-width: 0;\n",
  1550. " stroke: currentColor;\n",
  1551. " fill: currentColor;\n",
  1552. "}\n",
  1553. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;shotNum&#x27; (runs: 5, truncation_value: 11)&gt;\n",
  1554. "array([[&#x27;-1&#x27;, &#x27;01&#x27;, &#x27;02&#x27;, &#x27;03&#x27;, &#x27;04&#x27;, &#x27;05&#x27;, &#x27;06&#x27;, &#x27;07&#x27;, &#x27;08&#x27;, &#x27;09&#x27;, &#x27;10&#x27;],\n",
  1555. " [&#x27;11&#x27;, &#x27;12&#x27;, &#x27;13&#x27;, &#x27;14&#x27;, &#x27;15&#x27;, &#x27;16&#x27;, &#x27;17&#x27;, &#x27;18&#x27;, &#x27;19&#x27;, &#x27;20&#x27;, &#x27;21&#x27;],\n",
  1556. " [&#x27;22&#x27;, &#x27;23&#x27;, &#x27;24&#x27;, &#x27;25&#x27;, &#x27;26&#x27;, &#x27;27&#x27;, &#x27;28&#x27;, &#x27;29&#x27;, &#x27;30&#x27;, &#x27;31&#x27;, &#x27;32&#x27;],\n",
  1557. " [&#x27;33&#x27;, &#x27;34&#x27;, &#x27;35&#x27;, &#x27;36&#x27;, &#x27;37&#x27;, &#x27;38&#x27;, &#x27;39&#x27;, &#x27;40&#x27;, &#x27;41&#x27;, &#x27;42&#x27;, &#x27;43&#x27;],\n",
  1558. " [&#x27;44&#x27;, &#x27;45&#x27;, &#x27;46&#x27;, &#x27;47&#x27;, &#x27;48&#x27;, &#x27;49&#x27;, &#x27;50&#x27;, &#x27;51&#x27;, &#x27;52&#x27;, &#x27;53&#x27;, &#x27;54&#x27;]],\n",
  1559. " dtype=&#x27;&lt;U2&#x27;)\n",
  1560. "Coordinates:\n",
  1561. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  1562. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'shotNum'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>runs</span>: 5</li><li><span class='xr-has-index'>truncation_value</span>: 11</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-d99314fe-ff17-44cb-b5f7-a182cc4128e0' class='xr-array-in' type='checkbox' checked><label for='section-d99314fe-ff17-44cb-b5f7-a182cc4128e0' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>&#x27;-1&#x27; &#x27;01&#x27; &#x27;02&#x27; &#x27;03&#x27; &#x27;04&#x27; &#x27;05&#x27; &#x27;06&#x27; ... &#x27;49&#x27; &#x27;50&#x27; &#x27;51&#x27; &#x27;52&#x27; &#x27;53&#x27; &#x27;54&#x27;</span></div><div class='xr-array-data'><pre>array([[&#x27;-1&#x27;, &#x27;01&#x27;, &#x27;02&#x27;, &#x27;03&#x27;, &#x27;04&#x27;, &#x27;05&#x27;, &#x27;06&#x27;, &#x27;07&#x27;, &#x27;08&#x27;, &#x27;09&#x27;, &#x27;10&#x27;],\n",
  1563. " [&#x27;11&#x27;, &#x27;12&#x27;, &#x27;13&#x27;, &#x27;14&#x27;, &#x27;15&#x27;, &#x27;16&#x27;, &#x27;17&#x27;, &#x27;18&#x27;, &#x27;19&#x27;, &#x27;20&#x27;, &#x27;21&#x27;],\n",
  1564. " [&#x27;22&#x27;, &#x27;23&#x27;, &#x27;24&#x27;, &#x27;25&#x27;, &#x27;26&#x27;, &#x27;27&#x27;, &#x27;28&#x27;, &#x27;29&#x27;, &#x27;30&#x27;, &#x27;31&#x27;, &#x27;32&#x27;],\n",
  1565. " [&#x27;33&#x27;, &#x27;34&#x27;, &#x27;35&#x27;, &#x27;36&#x27;, &#x27;37&#x27;, &#x27;38&#x27;, &#x27;39&#x27;, &#x27;40&#x27;, &#x27;41&#x27;, &#x27;42&#x27;, &#x27;43&#x27;],\n",
  1566. " [&#x27;44&#x27;, &#x27;45&#x27;, &#x27;46&#x27;, &#x27;47&#x27;, &#x27;48&#x27;, &#x27;49&#x27;, &#x27;50&#x27;, &#x27;51&#x27;, &#x27;52&#x27;, &#x27;53&#x27;, &#x27;54&#x27;]],\n",
  1567. " dtype=&#x27;&lt;U2&#x27;)</pre></div></div></li><li class='xr-section-item'><input id='section-072c487d-d002-4259-a01b-c08c9f7ea79b' class='xr-section-summary-in' type='checkbox' checked><label for='section-072c487d-d002-4259-a01b-c08c9f7ea79b' class='xr-section-summary' >Coordinates: <span>(2)</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 3.0 4.0</div><input id='attrs-6385a017-4275-4e49-961d-e85d6ddf7cc7' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6385a017-4275-4e49-961d-e85d6ddf7cc7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2d912bad-e388-4747-94fc-8e91e9ab1d65' class='xr-var-data-in' type='checkbox'><label for='data-2d912bad-e388-4747-94fc-8e91e9ab1d65' 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., 3., 4.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>truncation_value</span></div><div class='xr-var-dims'>(truncation_value)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.8 0.83 0.85 ... 0.97 0.99 1.0</div><input id='attrs-09ed0bfd-14e3-4a30-adac-d71498309ce8' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-09ed0bfd-14e3-4a30-adac-d71498309ce8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-62e5405a-da06-4a0f-bf31-e46024c03b81' class='xr-var-data-in' type='checkbox'><label for='data-62e5405a-da06-4a0f-bf31-e46024c03b81' 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.8 , 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1. ])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e9b63c1f-c666-49cb-bdbb-1aa34bb6385e' class='xr-section-summary-in' type='checkbox' ><label for='section-e9b63c1f-c666-49cb-bdbb-1aa34bb6385e' class='xr-section-summary' >Indexes: <span>(2)</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-6d6ac887-feed-4441-bca4-a789b1f3b61d' class='xr-index-data-in' type='checkbox'/><label for='index-6d6ac887-feed-4441-bca4-a789b1f3b61d' 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, 3.0, 4.0], dtype=&#x27;float64&#x27;, name=&#x27;runs&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>truncation_value</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-db91c79a-99fe-4316-b8ef-b3092bceb87b' class='xr-index-data-in' type='checkbox'/><label for='index-db91c79a-99fe-4316-b8ef-b3092bceb87b' 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.8, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1.0], dtype=&#x27;float64&#x27;, name=&#x27;truncation_value&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-c91e228a-d7cb-4584-8e9f-4435a2481da5' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c91e228a-d7cb-4584-8e9f-4435a2481da5' class='xr-section-
  1568. ],
  1569. "text/plain": [
  1570. "<xarray.DataArray 'shotNum' (runs: 5, truncation_value: 11)>\n",
  1571. "array([['-1', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10'],\n",
  1572. " ['11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21'],\n",
  1573. " ['22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32'],\n",
  1574. " ['33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43'],\n",
  1575. " ['44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54']],\n",
  1576. " dtype='<U2')\n",
  1577. "Coordinates:\n",
  1578. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  1579. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0"
  1580. ]
  1581. },
  1582. "execution_count": 6,
  1583. "metadata": {},
  1584. "output_type": "execute_result"
  1585. }
  1586. ],
  1587. "source": [
  1588. "dataSet.shotNum.loc[\n",
  1589. " {\n",
  1590. " 'runs': 0,\n",
  1591. " 'truncation_value': 0.8,\n",
  1592. " }\n",
  1593. " ] = '-1'\n",
  1594. "\n",
  1595. "# Or wirte it in short\n",
  1596. "dataSet.shotNum.loc[0, 0.8] = '-1'\n",
  1597. "\n",
  1598. "dataSet.shotNum"
  1599. ]
  1600. },
  1601. {
  1602. "cell_type": "markdown",
  1603. "metadata": {},
  1604. "source": [
  1605. "### Select by index"
  1606. ]
  1607. },
  1608. {
  1609. "cell_type": "markdown",
  1610. "metadata": {},
  1611. "source": [
  1612. "The second method is to select it by index.\n",
  1613. "\n",
  1614. "Here is an emaxple of selecting the element in 'ShotNum' at (0, 1), and change it to '-2'."
  1615. ]
  1616. },
  1617. {
  1618. "cell_type": "code",
  1619. "execution_count": 7,
  1620. "metadata": {},
  1621. "outputs": [
  1622. {
  1623. "data": {
  1624. "text/html": [
  1625. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  1626. "<defs>\n",
  1627. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  1628. "<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",
  1629. "<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",
  1630. "<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",
  1631. "</symbol>\n",
  1632. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  1633. "<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",
  1634. "<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",
  1635. "<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",
  1636. "<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",
  1637. "</symbol>\n",
  1638. "</defs>\n",
  1639. "</svg>\n",
  1640. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  1641. " *\n",
  1642. " */\n",
  1643. "\n",
  1644. ":root {\n",
  1645. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  1646. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  1647. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  1648. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  1649. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  1650. " --xr-background-color: var(--jp-layout-color0, white);\n",
  1651. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  1652. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  1653. "}\n",
  1654. "\n",
  1655. "html[theme=dark],\n",
  1656. "body[data-theme=dark],\n",
  1657. "body.vscode-dark {\n",
  1658. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  1659. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  1660. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  1661. " --xr-border-color: #1F1F1F;\n",
  1662. " --xr-disabled-color: #515151;\n",
  1663. " --xr-background-color: #111111;\n",
  1664. " --xr-background-color-row-even: #111111;\n",
  1665. " --xr-background-color-row-odd: #313131;\n",
  1666. "}\n",
  1667. "\n",
  1668. ".xr-wrap {\n",
  1669. " display: block !important;\n",
  1670. " min-width: 300px;\n",
  1671. " max-width: 700px;\n",
  1672. "}\n",
  1673. "\n",
  1674. ".xr-text-repr-fallback {\n",
  1675. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  1676. " display: none;\n",
  1677. "}\n",
  1678. "\n",
  1679. ".xr-header {\n",
  1680. " padding-top: 6px;\n",
  1681. " padding-bottom: 6px;\n",
  1682. " margin-bottom: 4px;\n",
  1683. " border-bottom: solid 1px var(--xr-border-color);\n",
  1684. "}\n",
  1685. "\n",
  1686. ".xr-header > div,\n",
  1687. ".xr-header > ul {\n",
  1688. " display: inline;\n",
  1689. " margin-top: 0;\n",
  1690. " margin-bottom: 0;\n",
  1691. "}\n",
  1692. "\n",
  1693. ".xr-obj-type,\n",
  1694. ".xr-array-name {\n",
  1695. " margin-left: 2px;\n",
  1696. " margin-right: 10px;\n",
  1697. "}\n",
  1698. "\n",
  1699. ".xr-obj-type {\n",
  1700. " color: var(--xr-font-color2);\n",
  1701. "}\n",
  1702. "\n",
  1703. ".xr-sections {\n",
  1704. " padding-left: 0 !important;\n",
  1705. " display: grid;\n",
  1706. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  1707. "}\n",
  1708. "\n",
  1709. ".xr-section-item {\n",
  1710. " display: contents;\n",
  1711. "}\n",
  1712. "\n",
  1713. ".xr-section-item input {\n",
  1714. " display: none;\n",
  1715. "}\n",
  1716. "\n",
  1717. ".xr-section-item input + label {\n",
  1718. " color: var(--xr-disabled-color);\n",
  1719. "}\n",
  1720. "\n",
  1721. ".xr-section-item input:enabled + label {\n",
  1722. " cursor: pointer;\n",
  1723. " color: var(--xr-font-color2);\n",
  1724. "}\n",
  1725. "\n",
  1726. ".xr-section-item input:enabled + label:hover {\n",
  1727. " color: var(--xr-font-color0);\n",
  1728. "}\n",
  1729. "\n",
  1730. ".xr-section-summary {\n",
  1731. " grid-column: 1;\n",
  1732. " color: var(--xr-font-color2);\n",
  1733. " font-weight: 500;\n",
  1734. "}\n",
  1735. "\n",
  1736. ".xr-section-summary > span {\n",
  1737. " display: inline-block;\n",
  1738. " padding-left: 0.5em;\n",
  1739. "}\n",
  1740. "\n",
  1741. ".xr-section-summary-in:disabled + label {\n",
  1742. " color: var(--xr-font-color2);\n",
  1743. "}\n",
  1744. "\n",
  1745. ".xr-section-summary-in + label:before {\n",
  1746. " display: inline-block;\n",
  1747. " content: '►';\n",
  1748. " font-size: 11px;\n",
  1749. " width: 15px;\n",
  1750. " text-align: center;\n",
  1751. "}\n",
  1752. "\n",
  1753. ".xr-section-summary-in:disabled + label:before {\n",
  1754. " color: var(--xr-disabled-color);\n",
  1755. "}\n",
  1756. "\n",
  1757. ".xr-section-summary-in:checked + label:before {\n",
  1758. " content: '▼';\n",
  1759. "}\n",
  1760. "\n",
  1761. ".xr-section-summary-in:checked + label > span {\n",
  1762. " display: none;\n",
  1763. "}\n",
  1764. "\n",
  1765. ".xr-section-summary,\n",
  1766. ".xr-section-inline-details {\n",
  1767. " padding-top: 4px;\n",
  1768. " padding-bottom: 4px;\n",
  1769. "}\n",
  1770. "\n",
  1771. ".xr-section-inline-details {\n",
  1772. " grid-column: 2 / -1;\n",
  1773. "}\n",
  1774. "\n",
  1775. ".xr-section-details {\n",
  1776. " display: none;\n",
  1777. " grid-column: 1 / -1;\n",
  1778. " margin-bottom: 5px;\n",
  1779. "}\n",
  1780. "\n",
  1781. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  1782. " display: contents;\n",
  1783. "}\n",
  1784. "\n",
  1785. ".xr-array-wrap {\n",
  1786. " grid-column: 1 / -1;\n",
  1787. " display: grid;\n",
  1788. " grid-template-columns: 20px auto;\n",
  1789. "}\n",
  1790. "\n",
  1791. ".xr-array-wrap > label {\n",
  1792. " grid-column: 1;\n",
  1793. " vertical-align: top;\n",
  1794. "}\n",
  1795. "\n",
  1796. ".xr-preview {\n",
  1797. " color: var(--xr-font-color3);\n",
  1798. "}\n",
  1799. "\n",
  1800. ".xr-array-preview,\n",
  1801. ".xr-array-data {\n",
  1802. " padding: 0 5px !important;\n",
  1803. " grid-column: 2;\n",
  1804. "}\n",
  1805. "\n",
  1806. ".xr-array-data,\n",
  1807. ".xr-array-in:checked ~ .xr-array-preview {\n",
  1808. " display: none;\n",
  1809. "}\n",
  1810. "\n",
  1811. ".xr-array-in:checked ~ .xr-array-data,\n",
  1812. ".xr-array-preview {\n",
  1813. " display: inline-block;\n",
  1814. "}\n",
  1815. "\n",
  1816. ".xr-dim-list {\n",
  1817. " display: inline-block !important;\n",
  1818. " list-style: none;\n",
  1819. " padding: 0 !important;\n",
  1820. " margin: 0;\n",
  1821. "}\n",
  1822. "\n",
  1823. ".xr-dim-list li {\n",
  1824. " display: inline-block;\n",
  1825. " padding: 0;\n",
  1826. " margin: 0;\n",
  1827. "}\n",
  1828. "\n",
  1829. ".xr-dim-list:before {\n",
  1830. " content: '(';\n",
  1831. "}\n",
  1832. "\n",
  1833. ".xr-dim-list:after {\n",
  1834. " content: ')';\n",
  1835. "}\n",
  1836. "\n",
  1837. ".xr-dim-list li:not(:last-child):after {\n",
  1838. " content: ',';\n",
  1839. " padding-right: 5px;\n",
  1840. "}\n",
  1841. "\n",
  1842. ".xr-has-index {\n",
  1843. " font-weight: bold;\n",
  1844. "}\n",
  1845. "\n",
  1846. ".xr-var-list,\n",
  1847. ".xr-var-item {\n",
  1848. " display: contents;\n",
  1849. "}\n",
  1850. "\n",
  1851. ".xr-var-item > div,\n",
  1852. ".xr-var-item label,\n",
  1853. ".xr-var-item > .xr-var-name span {\n",
  1854. " background-color: var(--xr-background-color-row-even);\n",
  1855. " margin-bottom: 0;\n",
  1856. "}\n",
  1857. "\n",
  1858. ".xr-var-item > .xr-var-name:hover span {\n",
  1859. " padding-right: 5px;\n",
  1860. "}\n",
  1861. "\n",
  1862. ".xr-var-list > li:nth-child(odd) > div,\n",
  1863. ".xr-var-list > li:nth-child(odd) > label,\n",
  1864. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  1865. " background-color: var(--xr-background-color-row-odd);\n",
  1866. "}\n",
  1867. "\n",
  1868. ".xr-var-name {\n",
  1869. " grid-column: 1;\n",
  1870. "}\n",
  1871. "\n",
  1872. ".xr-var-dims {\n",
  1873. " grid-column: 2;\n",
  1874. "}\n",
  1875. "\n",
  1876. ".xr-var-dtype {\n",
  1877. " grid-column: 3;\n",
  1878. " text-align: right;\n",
  1879. " color: var(--xr-font-color2);\n",
  1880. "}\n",
  1881. "\n",
  1882. ".xr-var-preview {\n",
  1883. " grid-column: 4;\n",
  1884. "}\n",
  1885. "\n",
  1886. ".xr-index-preview {\n",
  1887. " grid-column: 2 / 5;\n",
  1888. " color: var(--xr-font-color2);\n",
  1889. "}\n",
  1890. "\n",
  1891. ".xr-var-name,\n",
  1892. ".xr-var-dims,\n",
  1893. ".xr-var-dtype,\n",
  1894. ".xr-preview,\n",
  1895. ".xr-attrs dt {\n",
  1896. " white-space: nowrap;\n",
  1897. " overflow: hidden;\n",
  1898. " text-overflow: ellipsis;\n",
  1899. " padding-right: 10px;\n",
  1900. "}\n",
  1901. "\n",
  1902. ".xr-var-name:hover,\n",
  1903. ".xr-var-dims:hover,\n",
  1904. ".xr-var-dtype:hover,\n",
  1905. ".xr-attrs dt:hover {\n",
  1906. " overflow: visible;\n",
  1907. " width: auto;\n",
  1908. " z-index: 1;\n",
  1909. "}\n",
  1910. "\n",
  1911. ".xr-var-attrs,\n",
  1912. ".xr-var-data,\n",
  1913. ".xr-index-data {\n",
  1914. " display: none;\n",
  1915. " background-color: var(--xr-background-color) !important;\n",
  1916. " padding-bottom: 5px !important;\n",
  1917. "}\n",
  1918. "\n",
  1919. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  1920. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  1921. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  1922. " display: block;\n",
  1923. "}\n",
  1924. "\n",
  1925. ".xr-var-data > table {\n",
  1926. " float: right;\n",
  1927. "}\n",
  1928. "\n",
  1929. ".xr-var-name span,\n",
  1930. ".xr-var-data,\n",
  1931. ".xr-index-name div,\n",
  1932. ".xr-index-data,\n",
  1933. ".xr-attrs {\n",
  1934. " padding-left: 25px !important;\n",
  1935. "}\n",
  1936. "\n",
  1937. ".xr-attrs,\n",
  1938. ".xr-var-attrs,\n",
  1939. ".xr-var-data,\n",
  1940. ".xr-index-data {\n",
  1941. " grid-column: 1 / -1;\n",
  1942. "}\n",
  1943. "\n",
  1944. "dl.xr-attrs {\n",
  1945. " padding: 0;\n",
  1946. " margin: 0;\n",
  1947. " display: grid;\n",
  1948. " grid-template-columns: 125px auto;\n",
  1949. "}\n",
  1950. "\n",
  1951. ".xr-attrs dt,\n",
  1952. ".xr-attrs dd {\n",
  1953. " padding: 0;\n",
  1954. " margin: 0;\n",
  1955. " float: left;\n",
  1956. " padding-right: 10px;\n",
  1957. " width: auto;\n",
  1958. "}\n",
  1959. "\n",
  1960. ".xr-attrs dt {\n",
  1961. " font-weight: normal;\n",
  1962. " grid-column: 1;\n",
  1963. "}\n",
  1964. "\n",
  1965. ".xr-attrs dt:hover span {\n",
  1966. " display: inline-block;\n",
  1967. " background: var(--xr-background-color);\n",
  1968. " padding-right: 10px;\n",
  1969. "}\n",
  1970. "\n",
  1971. ".xr-attrs dd {\n",
  1972. " grid-column: 2;\n",
  1973. " white-space: pre-wrap;\n",
  1974. " word-break: break-all;\n",
  1975. "}\n",
  1976. "\n",
  1977. ".xr-icon-database,\n",
  1978. ".xr-icon-file-text2,\n",
  1979. ".xr-no-icon {\n",
  1980. " display: inline-block;\n",
  1981. " vertical-align: middle;\n",
  1982. " width: 1em;\n",
  1983. " height: 1.5em !important;\n",
  1984. " stroke-width: 0;\n",
  1985. " stroke: currentColor;\n",
  1986. " fill: currentColor;\n",
  1987. "}\n",
  1988. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;shotNum&#x27; (runs: 5, truncation_value: 11)&gt;\n",
  1989. "array([[&#x27;-1&#x27;, &#x27;-2&#x27;, &#x27;02&#x27;, &#x27;03&#x27;, &#x27;04&#x27;, &#x27;05&#x27;, &#x27;06&#x27;, &#x27;07&#x27;, &#x27;08&#x27;, &#x27;09&#x27;, &#x27;10&#x27;],\n",
  1990. " [&#x27;11&#x27;, &#x27;12&#x27;, &#x27;13&#x27;, &#x27;14&#x27;, &#x27;15&#x27;, &#x27;16&#x27;, &#x27;17&#x27;, &#x27;18&#x27;, &#x27;19&#x27;, &#x27;20&#x27;, &#x27;21&#x27;],\n",
  1991. " [&#x27;22&#x27;, &#x27;23&#x27;, &#x27;24&#x27;, &#x27;25&#x27;, &#x27;26&#x27;, &#x27;27&#x27;, &#x27;28&#x27;, &#x27;29&#x27;, &#x27;30&#x27;, &#x27;31&#x27;, &#x27;32&#x27;],\n",
  1992. " [&#x27;33&#x27;, &#x27;34&#x27;, &#x27;35&#x27;, &#x27;36&#x27;, &#x27;37&#x27;, &#x27;38&#x27;, &#x27;39&#x27;, &#x27;40&#x27;, &#x27;41&#x27;, &#x27;42&#x27;, &#x27;43&#x27;],\n",
  1993. " [&#x27;44&#x27;, &#x27;45&#x27;, &#x27;46&#x27;, &#x27;47&#x27;, &#x27;48&#x27;, &#x27;49&#x27;, &#x27;50&#x27;, &#x27;51&#x27;, &#x27;52&#x27;, &#x27;53&#x27;, &#x27;54&#x27;]],\n",
  1994. " dtype=&#x27;&lt;U2&#x27;)\n",
  1995. "Coordinates:\n",
  1996. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  1997. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'shotNum'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>runs</span>: 5</li><li><span class='xr-has-index'>truncation_value</span>: 11</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-f8b88ce0-8467-4b1c-9e79-353a4f1ee8d2' class='xr-array-in' type='checkbox' checked><label for='section-f8b88ce0-8467-4b1c-9e79-353a4f1ee8d2' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>&#x27;-1&#x27; &#x27;-2&#x27; &#x27;02&#x27; &#x27;03&#x27; &#x27;04&#x27; &#x27;05&#x27; &#x27;06&#x27; ... &#x27;49&#x27; &#x27;50&#x27; &#x27;51&#x27; &#x27;52&#x27; &#x27;53&#x27; &#x27;54&#x27;</span></div><div class='xr-array-data'><pre>array([[&#x27;-1&#x27;, &#x27;-2&#x27;, &#x27;02&#x27;, &#x27;03&#x27;, &#x27;04&#x27;, &#x27;05&#x27;, &#x27;06&#x27;, &#x27;07&#x27;, &#x27;08&#x27;, &#x27;09&#x27;, &#x27;10&#x27;],\n",
  1998. " [&#x27;11&#x27;, &#x27;12&#x27;, &#x27;13&#x27;, &#x27;14&#x27;, &#x27;15&#x27;, &#x27;16&#x27;, &#x27;17&#x27;, &#x27;18&#x27;, &#x27;19&#x27;, &#x27;20&#x27;, &#x27;21&#x27;],\n",
  1999. " [&#x27;22&#x27;, &#x27;23&#x27;, &#x27;24&#x27;, &#x27;25&#x27;, &#x27;26&#x27;, &#x27;27&#x27;, &#x27;28&#x27;, &#x27;29&#x27;, &#x27;30&#x27;, &#x27;31&#x27;, &#x27;32&#x27;],\n",
  2000. " [&#x27;33&#x27;, &#x27;34&#x27;, &#x27;35&#x27;, &#x27;36&#x27;, &#x27;37&#x27;, &#x27;38&#x27;, &#x27;39&#x27;, &#x27;40&#x27;, &#x27;41&#x27;, &#x27;42&#x27;, &#x27;43&#x27;],\n",
  2001. " [&#x27;44&#x27;, &#x27;45&#x27;, &#x27;46&#x27;, &#x27;47&#x27;, &#x27;48&#x27;, &#x27;49&#x27;, &#x27;50&#x27;, &#x27;51&#x27;, &#x27;52&#x27;, &#x27;53&#x27;, &#x27;54&#x27;]],\n",
  2002. " dtype=&#x27;&lt;U2&#x27;)</pre></div></div></li><li class='xr-section-item'><input id='section-6450436a-e28e-4f5a-8baa-2f7bea8f5d0e' class='xr-section-summary-in' type='checkbox' checked><label for='section-6450436a-e28e-4f5a-8baa-2f7bea8f5d0e' class='xr-section-summary' >Coordinates: <span>(2)</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 3.0 4.0</div><input id='attrs-2c6597d1-ed15-407e-877c-b36c0fc5da74' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2c6597d1-ed15-407e-877c-b36c0fc5da74' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-57bee2cd-3e7d-405e-9d55-58166d8d9006' class='xr-var-data-in' type='checkbox'><label for='data-57bee2cd-3e7d-405e-9d55-58166d8d9006' 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., 3., 4.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>truncation_value</span></div><div class='xr-var-dims'>(truncation_value)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.8 0.83 0.85 ... 0.97 0.99 1.0</div><input id='attrs-14c52d66-3e94-4752-9639-a044fae05baa' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-14c52d66-3e94-4752-9639-a044fae05baa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b106cb39-4a89-40cc-92e7-7fd915f1dfb0' class='xr-var-data-in' type='checkbox'><label for='data-b106cb39-4a89-40cc-92e7-7fd915f1dfb0' 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.8 , 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1. ])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-46769c5f-0b89-4a91-a3af-775ee3df58b5' class='xr-section-summary-in' type='checkbox' ><label for='section-46769c5f-0b89-4a91-a3af-775ee3df58b5' class='xr-section-summary' >Indexes: <span>(2)</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-250befeb-cc4a-4ded-af8b-15fbfc6fcc50' class='xr-index-data-in' type='checkbox'/><label for='index-250befeb-cc4a-4ded-af8b-15fbfc6fcc50' 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, 3.0, 4.0], dtype=&#x27;float64&#x27;, name=&#x27;runs&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>truncation_value</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-0bb02b75-8d25-4632-be0d-ecb9c68cac4a' class='xr-index-data-in' type='checkbox'/><label for='index-0bb02b75-8d25-4632-be0d-ecb9c68cac4a' 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.8, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1.0], dtype=&#x27;float64&#x27;, name=&#x27;truncation_value&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f616ad52-3d9b-44a5-b060-bb4c419037d0' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f616ad52-3d9b-44a5-b060-bb4c419037d0' class='xr-section-
  2003. ],
  2004. "text/plain": [
  2005. "<xarray.DataArray 'shotNum' (runs: 5, truncation_value: 11)>\n",
  2006. "array([['-1', '-2', '02', '03', '04', '05', '06', '07', '08', '09', '10'],\n",
  2007. " ['11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21'],\n",
  2008. " ['22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32'],\n",
  2009. " ['33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43'],\n",
  2010. " ['44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54']],\n",
  2011. " dtype='<U2')\n",
  2012. "Coordinates:\n",
  2013. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  2014. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0"
  2015. ]
  2016. },
  2017. "execution_count": 7,
  2018. "metadata": {},
  2019. "output_type": "execute_result"
  2020. }
  2021. ],
  2022. "source": [
  2023. "dataSet.shotNum[0, 1] = '-2'\n",
  2024. "dataSet.shotNum"
  2025. ]
  2026. },
  2027. {
  2028. "cell_type": "markdown",
  2029. "metadata": {},
  2030. "source": [
  2031. "## Remove the data"
  2032. ]
  2033. },
  2034. {
  2035. "cell_type": "markdown",
  2036. "metadata": {},
  2037. "source": [
  2038. "### Simply remove element or variables"
  2039. ]
  2040. },
  2041. {
  2042. "cell_type": "markdown",
  2043. "metadata": {},
  2044. "source": [
  2045. "For simply remove elements or variables in xarray, please read the introduction and examples from xarray package in the following link\n",
  2046. "\n",
  2047. " https://docs.xarray.dev/en/stable/generated/xarray.Dataset.drop_vars.html\n",
  2048. " https://docs.xarray.dev/en/latest/generated/xarray.Dataset.drop_sel.html\n",
  2049. " https://docs.xarray.dev/en/latest/generated/xarray.Dataset.drop_isel.html"
  2050. ]
  2051. },
  2052. {
  2053. "cell_type": "markdown",
  2054. "metadata": {},
  2055. "source": [
  2056. "### Remove bad shot"
  2057. ]
  2058. },
  2059. {
  2060. "cell_type": "markdown",
  2061. "metadata": {},
  2062. "source": [
  2063. "However, if one wants to remove the bad shot, it is highly recommended to set the value to 'np.nan', instead of directly delete it.\n",
  2064. "\n",
  2065. "In order to do that, except the two ways we demenstrate in the section 'Modify the data', we also implent a function to do it."
  2066. ]
  2067. },
  2068. {
  2069. "cell_type": "code",
  2070. "execution_count": 8,
  2071. "metadata": {},
  2072. "outputs": [
  2073. {
  2074. "data": {
  2075. "text/html": [
  2076. "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
  2077. "<defs>\n",
  2078. "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
  2079. "<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",
  2080. "<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",
  2081. "<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",
  2082. "</symbol>\n",
  2083. "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
  2084. "<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",
  2085. "<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",
  2086. "<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",
  2087. "<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",
  2088. "</symbol>\n",
  2089. "</defs>\n",
  2090. "</svg>\n",
  2091. "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
  2092. " *\n",
  2093. " */\n",
  2094. "\n",
  2095. ":root {\n",
  2096. " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
  2097. " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
  2098. " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
  2099. " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
  2100. " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
  2101. " --xr-background-color: var(--jp-layout-color0, white);\n",
  2102. " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
  2103. " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
  2104. "}\n",
  2105. "\n",
  2106. "html[theme=dark],\n",
  2107. "body[data-theme=dark],\n",
  2108. "body.vscode-dark {\n",
  2109. " --xr-font-color0: rgba(255, 255, 255, 1);\n",
  2110. " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
  2111. " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
  2112. " --xr-border-color: #1F1F1F;\n",
  2113. " --xr-disabled-color: #515151;\n",
  2114. " --xr-background-color: #111111;\n",
  2115. " --xr-background-color-row-even: #111111;\n",
  2116. " --xr-background-color-row-odd: #313131;\n",
  2117. "}\n",
  2118. "\n",
  2119. ".xr-wrap {\n",
  2120. " display: block !important;\n",
  2121. " min-width: 300px;\n",
  2122. " max-width: 700px;\n",
  2123. "}\n",
  2124. "\n",
  2125. ".xr-text-repr-fallback {\n",
  2126. " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
  2127. " display: none;\n",
  2128. "}\n",
  2129. "\n",
  2130. ".xr-header {\n",
  2131. " padding-top: 6px;\n",
  2132. " padding-bottom: 6px;\n",
  2133. " margin-bottom: 4px;\n",
  2134. " border-bottom: solid 1px var(--xr-border-color);\n",
  2135. "}\n",
  2136. "\n",
  2137. ".xr-header > div,\n",
  2138. ".xr-header > ul {\n",
  2139. " display: inline;\n",
  2140. " margin-top: 0;\n",
  2141. " margin-bottom: 0;\n",
  2142. "}\n",
  2143. "\n",
  2144. ".xr-obj-type,\n",
  2145. ".xr-array-name {\n",
  2146. " margin-left: 2px;\n",
  2147. " margin-right: 10px;\n",
  2148. "}\n",
  2149. "\n",
  2150. ".xr-obj-type {\n",
  2151. " color: var(--xr-font-color2);\n",
  2152. "}\n",
  2153. "\n",
  2154. ".xr-sections {\n",
  2155. " padding-left: 0 !important;\n",
  2156. " display: grid;\n",
  2157. " grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
  2158. "}\n",
  2159. "\n",
  2160. ".xr-section-item {\n",
  2161. " display: contents;\n",
  2162. "}\n",
  2163. "\n",
  2164. ".xr-section-item input {\n",
  2165. " display: none;\n",
  2166. "}\n",
  2167. "\n",
  2168. ".xr-section-item input + label {\n",
  2169. " color: var(--xr-disabled-color);\n",
  2170. "}\n",
  2171. "\n",
  2172. ".xr-section-item input:enabled + label {\n",
  2173. " cursor: pointer;\n",
  2174. " color: var(--xr-font-color2);\n",
  2175. "}\n",
  2176. "\n",
  2177. ".xr-section-item input:enabled + label:hover {\n",
  2178. " color: var(--xr-font-color0);\n",
  2179. "}\n",
  2180. "\n",
  2181. ".xr-section-summary {\n",
  2182. " grid-column: 1;\n",
  2183. " color: var(--xr-font-color2);\n",
  2184. " font-weight: 500;\n",
  2185. "}\n",
  2186. "\n",
  2187. ".xr-section-summary > span {\n",
  2188. " display: inline-block;\n",
  2189. " padding-left: 0.5em;\n",
  2190. "}\n",
  2191. "\n",
  2192. ".xr-section-summary-in:disabled + label {\n",
  2193. " color: var(--xr-font-color2);\n",
  2194. "}\n",
  2195. "\n",
  2196. ".xr-section-summary-in + label:before {\n",
  2197. " display: inline-block;\n",
  2198. " content: '►';\n",
  2199. " font-size: 11px;\n",
  2200. " width: 15px;\n",
  2201. " text-align: center;\n",
  2202. "}\n",
  2203. "\n",
  2204. ".xr-section-summary-in:disabled + label:before {\n",
  2205. " color: var(--xr-disabled-color);\n",
  2206. "}\n",
  2207. "\n",
  2208. ".xr-section-summary-in:checked + label:before {\n",
  2209. " content: '▼';\n",
  2210. "}\n",
  2211. "\n",
  2212. ".xr-section-summary-in:checked + label > span {\n",
  2213. " display: none;\n",
  2214. "}\n",
  2215. "\n",
  2216. ".xr-section-summary,\n",
  2217. ".xr-section-inline-details {\n",
  2218. " padding-top: 4px;\n",
  2219. " padding-bottom: 4px;\n",
  2220. "}\n",
  2221. "\n",
  2222. ".xr-section-inline-details {\n",
  2223. " grid-column: 2 / -1;\n",
  2224. "}\n",
  2225. "\n",
  2226. ".xr-section-details {\n",
  2227. " display: none;\n",
  2228. " grid-column: 1 / -1;\n",
  2229. " margin-bottom: 5px;\n",
  2230. "}\n",
  2231. "\n",
  2232. ".xr-section-summary-in:checked ~ .xr-section-details {\n",
  2233. " display: contents;\n",
  2234. "}\n",
  2235. "\n",
  2236. ".xr-array-wrap {\n",
  2237. " grid-column: 1 / -1;\n",
  2238. " display: grid;\n",
  2239. " grid-template-columns: 20px auto;\n",
  2240. "}\n",
  2241. "\n",
  2242. ".xr-array-wrap > label {\n",
  2243. " grid-column: 1;\n",
  2244. " vertical-align: top;\n",
  2245. "}\n",
  2246. "\n",
  2247. ".xr-preview {\n",
  2248. " color: var(--xr-font-color3);\n",
  2249. "}\n",
  2250. "\n",
  2251. ".xr-array-preview,\n",
  2252. ".xr-array-data {\n",
  2253. " padding: 0 5px !important;\n",
  2254. " grid-column: 2;\n",
  2255. "}\n",
  2256. "\n",
  2257. ".xr-array-data,\n",
  2258. ".xr-array-in:checked ~ .xr-array-preview {\n",
  2259. " display: none;\n",
  2260. "}\n",
  2261. "\n",
  2262. ".xr-array-in:checked ~ .xr-array-data,\n",
  2263. ".xr-array-preview {\n",
  2264. " display: inline-block;\n",
  2265. "}\n",
  2266. "\n",
  2267. ".xr-dim-list {\n",
  2268. " display: inline-block !important;\n",
  2269. " list-style: none;\n",
  2270. " padding: 0 !important;\n",
  2271. " margin: 0;\n",
  2272. "}\n",
  2273. "\n",
  2274. ".xr-dim-list li {\n",
  2275. " display: inline-block;\n",
  2276. " padding: 0;\n",
  2277. " margin: 0;\n",
  2278. "}\n",
  2279. "\n",
  2280. ".xr-dim-list:before {\n",
  2281. " content: '(';\n",
  2282. "}\n",
  2283. "\n",
  2284. ".xr-dim-list:after {\n",
  2285. " content: ')';\n",
  2286. "}\n",
  2287. "\n",
  2288. ".xr-dim-list li:not(:last-child):after {\n",
  2289. " content: ',';\n",
  2290. " padding-right: 5px;\n",
  2291. "}\n",
  2292. "\n",
  2293. ".xr-has-index {\n",
  2294. " font-weight: bold;\n",
  2295. "}\n",
  2296. "\n",
  2297. ".xr-var-list,\n",
  2298. ".xr-var-item {\n",
  2299. " display: contents;\n",
  2300. "}\n",
  2301. "\n",
  2302. ".xr-var-item > div,\n",
  2303. ".xr-var-item label,\n",
  2304. ".xr-var-item > .xr-var-name span {\n",
  2305. " background-color: var(--xr-background-color-row-even);\n",
  2306. " margin-bottom: 0;\n",
  2307. "}\n",
  2308. "\n",
  2309. ".xr-var-item > .xr-var-name:hover span {\n",
  2310. " padding-right: 5px;\n",
  2311. "}\n",
  2312. "\n",
  2313. ".xr-var-list > li:nth-child(odd) > div,\n",
  2314. ".xr-var-list > li:nth-child(odd) > label,\n",
  2315. ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
  2316. " background-color: var(--xr-background-color-row-odd);\n",
  2317. "}\n",
  2318. "\n",
  2319. ".xr-var-name {\n",
  2320. " grid-column: 1;\n",
  2321. "}\n",
  2322. "\n",
  2323. ".xr-var-dims {\n",
  2324. " grid-column: 2;\n",
  2325. "}\n",
  2326. "\n",
  2327. ".xr-var-dtype {\n",
  2328. " grid-column: 3;\n",
  2329. " text-align: right;\n",
  2330. " color: var(--xr-font-color2);\n",
  2331. "}\n",
  2332. "\n",
  2333. ".xr-var-preview {\n",
  2334. " grid-column: 4;\n",
  2335. "}\n",
  2336. "\n",
  2337. ".xr-index-preview {\n",
  2338. " grid-column: 2 / 5;\n",
  2339. " color: var(--xr-font-color2);\n",
  2340. "}\n",
  2341. "\n",
  2342. ".xr-var-name,\n",
  2343. ".xr-var-dims,\n",
  2344. ".xr-var-dtype,\n",
  2345. ".xr-preview,\n",
  2346. ".xr-attrs dt {\n",
  2347. " white-space: nowrap;\n",
  2348. " overflow: hidden;\n",
  2349. " text-overflow: ellipsis;\n",
  2350. " padding-right: 10px;\n",
  2351. "}\n",
  2352. "\n",
  2353. ".xr-var-name:hover,\n",
  2354. ".xr-var-dims:hover,\n",
  2355. ".xr-var-dtype:hover,\n",
  2356. ".xr-attrs dt:hover {\n",
  2357. " overflow: visible;\n",
  2358. " width: auto;\n",
  2359. " z-index: 1;\n",
  2360. "}\n",
  2361. "\n",
  2362. ".xr-var-attrs,\n",
  2363. ".xr-var-data,\n",
  2364. ".xr-index-data {\n",
  2365. " display: none;\n",
  2366. " background-color: var(--xr-background-color) !important;\n",
  2367. " padding-bottom: 5px !important;\n",
  2368. "}\n",
  2369. "\n",
  2370. ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
  2371. ".xr-var-data-in:checked ~ .xr-var-data,\n",
  2372. ".xr-index-data-in:checked ~ .xr-index-data {\n",
  2373. " display: block;\n",
  2374. "}\n",
  2375. "\n",
  2376. ".xr-var-data > table {\n",
  2377. " float: right;\n",
  2378. "}\n",
  2379. "\n",
  2380. ".xr-var-name span,\n",
  2381. ".xr-var-data,\n",
  2382. ".xr-index-name div,\n",
  2383. ".xr-index-data,\n",
  2384. ".xr-attrs {\n",
  2385. " padding-left: 25px !important;\n",
  2386. "}\n",
  2387. "\n",
  2388. ".xr-attrs,\n",
  2389. ".xr-var-attrs,\n",
  2390. ".xr-var-data,\n",
  2391. ".xr-index-data {\n",
  2392. " grid-column: 1 / -1;\n",
  2393. "}\n",
  2394. "\n",
  2395. "dl.xr-attrs {\n",
  2396. " padding: 0;\n",
  2397. " margin: 0;\n",
  2398. " display: grid;\n",
  2399. " grid-template-columns: 125px auto;\n",
  2400. "}\n",
  2401. "\n",
  2402. ".xr-attrs dt,\n",
  2403. ".xr-attrs dd {\n",
  2404. " padding: 0;\n",
  2405. " margin: 0;\n",
  2406. " float: left;\n",
  2407. " padding-right: 10px;\n",
  2408. " width: auto;\n",
  2409. "}\n",
  2410. "\n",
  2411. ".xr-attrs dt {\n",
  2412. " font-weight: normal;\n",
  2413. " grid-column: 1;\n",
  2414. "}\n",
  2415. "\n",
  2416. ".xr-attrs dt:hover span {\n",
  2417. " display: inline-block;\n",
  2418. " background: var(--xr-background-color);\n",
  2419. " padding-right: 10px;\n",
  2420. "}\n",
  2421. "\n",
  2422. ".xr-attrs dd {\n",
  2423. " grid-column: 2;\n",
  2424. " white-space: pre-wrap;\n",
  2425. " word-break: break-all;\n",
  2426. "}\n",
  2427. "\n",
  2428. ".xr-icon-database,\n",
  2429. ".xr-icon-file-text2,\n",
  2430. ".xr-no-icon {\n",
  2431. " display: inline-block;\n",
  2432. " vertical-align: middle;\n",
  2433. " width: 1em;\n",
  2434. " height: 1.5em !important;\n",
  2435. " stroke-width: 0;\n",
  2436. " stroke: currentColor;\n",
  2437. " fill: currentColor;\n",
  2438. "}\n",
  2439. "</style><pre class='xr-text-repr-fallback'>&lt;xarray.DataArray &#x27;atoms&#x27; (runs: 5, truncation_value: 11, y: 1200, x: 1920)&gt;\n",
  2440. "array([[[[ nan, nan, nan, ..., nan, nan, nan],\n",
  2441. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2442. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2443. " ...,\n",
  2444. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2445. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2446. " [ nan, nan, nan, ..., nan, nan, nan]],\n",
  2447. "\n",
  2448. " [[102., 103., 100., ..., 155., 154., 142.],\n",
  2449. " [ 97., 100., 101., ..., 146., 146., 156.],\n",
  2450. " [ 91., 93., 97., ..., 142., 136., 151.],\n",
  2451. " ...,\n",
  2452. " [105., 103., 103., ..., 144., 134., 142.],\n",
  2453. " [102., 104., 112., ..., 133., 134., 135.],\n",
  2454. " [114., 115., 113., ..., 119., 126., 122.]],\n",
  2455. "\n",
  2456. " [[101., 105., 103., ..., 148., 152., 146.],\n",
  2457. " [101., 102., 98., ..., 143., 146., 149.],\n",
  2458. " [ 97., 98., 98., ..., 139., 137., 146.],\n",
  2459. " ...,\n",
  2460. "...\n",
  2461. " ...,\n",
  2462. " [100., 102., 109., ..., 135., 141., 140.],\n",
  2463. " [106., 103., 105., ..., 128., 140., 132.],\n",
  2464. " [114., 107., 108., ..., 121., 123., 126.]],\n",
  2465. "\n",
  2466. " [[101., 102., 101., ..., 153., 153., 146.],\n",
  2467. " [101., 103., 100., ..., 148., 143., 149.],\n",
  2468. " [ 96., 95., 98., ..., 145., 138., 144.],\n",
  2469. " ...,\n",
  2470. " [ 98., 107., 103., ..., 140., 142., 145.],\n",
  2471. " [106., 100., 103., ..., 133., 133., 136.],\n",
  2472. " [115., 103., 102., ..., 123., 125., 128.]],\n",
  2473. "\n",
  2474. " [[103., 100., 102., ..., 154., 147., 153.],\n",
  2475. " [ 96., 103., 97., ..., 150., 150., 152.],\n",
  2476. " [ 96., 100., 96., ..., 141., 142., 144.],\n",
  2477. " ...,\n",
  2478. " [101., 102., 101., ..., 139., 142., 140.],\n",
  2479. " [105., 105., 98., ..., 132., 135., 131.],\n",
  2480. " [109., 111., 107., ..., 125., 126., 129.]]]])\n",
  2481. "Coordinates:\n",
  2482. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  2483. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0\n",
  2484. "Dimensions without coordinates: y, x\n",
  2485. "Attributes:\n",
  2486. " IMAGE_SUBCLASS: IMAGE_GRAYSCALE\n",
  2487. " IMAGE_VERSION: 1.2\n",
  2488. " IMAGE_WHITE_IS_ZERO: 0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'atoms'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>runs</span>: 5</li><li><span class='xr-has-index'>truncation_value</span>: 11</li><li><span>y</span>: 1200</li><li><span>x</span>: 1920</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-96fcd01b-3091-424c-960e-87b40148b49e' class='xr-array-in' type='checkbox' checked><label for='section-96fcd01b-3091-424c-960e-87b40148b49e' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>nan nan nan nan nan nan nan ... 132.0 129.0 130.0 125.0 126.0 129.0</span></div><div class='xr-array-data'><pre>array([[[[ nan, nan, nan, ..., nan, nan, nan],\n",
  2489. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2490. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2491. " ...,\n",
  2492. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2493. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2494. " [ nan, nan, nan, ..., nan, nan, nan]],\n",
  2495. "\n",
  2496. " [[102., 103., 100., ..., 155., 154., 142.],\n",
  2497. " [ 97., 100., 101., ..., 146., 146., 156.],\n",
  2498. " [ 91., 93., 97., ..., 142., 136., 151.],\n",
  2499. " ...,\n",
  2500. " [105., 103., 103., ..., 144., 134., 142.],\n",
  2501. " [102., 104., 112., ..., 133., 134., 135.],\n",
  2502. " [114., 115., 113., ..., 119., 126., 122.]],\n",
  2503. "\n",
  2504. " [[101., 105., 103., ..., 148., 152., 146.],\n",
  2505. " [101., 102., 98., ..., 143., 146., 149.],\n",
  2506. " [ 97., 98., 98., ..., 139., 137., 146.],\n",
  2507. " ...,\n",
  2508. "...\n",
  2509. " ...,\n",
  2510. " [100., 102., 109., ..., 135., 141., 140.],\n",
  2511. " [106., 103., 105., ..., 128., 140., 132.],\n",
  2512. " [114., 107., 108., ..., 121., 123., 126.]],\n",
  2513. "\n",
  2514. " [[101., 102., 101., ..., 153., 153., 146.],\n",
  2515. " [101., 103., 100., ..., 148., 143., 149.],\n",
  2516. " [ 96., 95., 98., ..., 145., 138., 144.],\n",
  2517. " ...,\n",
  2518. " [ 98., 107., 103., ..., 140., 142., 145.],\n",
  2519. " [106., 100., 103., ..., 133., 133., 136.],\n",
  2520. " [115., 103., 102., ..., 123., 125., 128.]],\n",
  2521. "\n",
  2522. " [[103., 100., 102., ..., 154., 147., 153.],\n",
  2523. " [ 96., 103., 97., ..., 150., 150., 152.],\n",
  2524. " [ 96., 100., 96., ..., 141., 142., 144.],\n",
  2525. " ...,\n",
  2526. " [101., 102., 101., ..., 139., 142., 140.],\n",
  2527. " [105., 105., 98., ..., 132., 135., 131.],\n",
  2528. " [109., 111., 107., ..., 125., 126., 129.]]]])</pre></div></div></li><li class='xr-section-item'><input id='section-eead7289-9142-4668-b985-10b192d24f32' class='xr-section-summary-in' type='checkbox' checked><label for='section-eead7289-9142-4668-b985-10b192d24f32' class='xr-section-summary' >Coordinates: <span>(2)</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 3.0 4.0</div><input id='attrs-5297672f-0b3f-404c-a9f3-3d450736770c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-5297672f-0b3f-404c-a9f3-3d450736770c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0b2f5a69-9f4e-4e01-b6a6-697a8cb9e145' class='xr-var-data-in' type='checkbox'><label for='data-0b2f5a69-9f4e-4e01-b6a6-697a8cb9e145' 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., 3., 4.])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>truncation_value</span></div><div class='xr-var-dims'>(truncation_value)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.8 0.83 0.85 ... 0.97 0.99 1.0</div><input id='attrs-62c03571-880f-4bc3-b4cc-760a0ea23177' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-62c03571-880f-4bc3-b4cc-760a0ea23177' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f846df74-48be-4f5d-b406-33b1c7beae76' class='xr-var-data-in' type='checkbox'><label for='data-f846df74-48be-4f5d-b406-33b1c7beae76' 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.8 , 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1. ])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-39aa964f-5d61-486f-993a-cbd5937e2d40' class='xr-section-summary-in' type='checkbox' ><label for='section-39aa964f-5d61-486f-993a-cbd5937e2d40' class='xr-section-summary' >Indexes: <span>(2)</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-5a7cf4d5-d1c5-422b-a5a2-65901ab1a718' class='xr-index-data-in' type='checkbox'/><label for='index-5a7cf4d5-d1c5-422b-a5a2-65901ab1a718' 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, 3.0, 4.0], dtype=&#x27;float64&#x27;, name=&#x27;runs&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>truncation_value</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-3e10ed60-13d7-40dc-893e-174d6b9a4a86' class='xr-index-data-in' type='checkbox'/><label for='index-3e10ed60-13d7-40dc-893e-174d6b9a4a86' 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.8, 0.83, 0.85, 0.87, 0.89, 0.91, 0.93, 0.95, 0.97, 0.99, 1.0], dtype=&#x27;float64&#x27;, name=&#x27;truncation_value&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e0bee93d-d684-4ff0-aeb6-6c44853eea65' class='xr-section-summary-in' type='checkbox' checked><label for='section-e0bee93d-d684-4ff0-aeb6-6c44853eea
  2529. ],
  2530. "text/plain": [
  2531. "<xarray.DataArray 'atoms' (runs: 5, truncation_value: 11, y: 1200, x: 1920)>\n",
  2532. "array([[[[ nan, nan, nan, ..., nan, nan, nan],\n",
  2533. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2534. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2535. " ...,\n",
  2536. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2537. " [ nan, nan, nan, ..., nan, nan, nan],\n",
  2538. " [ nan, nan, nan, ..., nan, nan, nan]],\n",
  2539. "\n",
  2540. " [[102., 103., 100., ..., 155., 154., 142.],\n",
  2541. " [ 97., 100., 101., ..., 146., 146., 156.],\n",
  2542. " [ 91., 93., 97., ..., 142., 136., 151.],\n",
  2543. " ...,\n",
  2544. " [105., 103., 103., ..., 144., 134., 142.],\n",
  2545. " [102., 104., 112., ..., 133., 134., 135.],\n",
  2546. " [114., 115., 113., ..., 119., 126., 122.]],\n",
  2547. "\n",
  2548. " [[101., 105., 103., ..., 148., 152., 146.],\n",
  2549. " [101., 102., 98., ..., 143., 146., 149.],\n",
  2550. " [ 97., 98., 98., ..., 139., 137., 146.],\n",
  2551. " ...,\n",
  2552. "...\n",
  2553. " ...,\n",
  2554. " [100., 102., 109., ..., 135., 141., 140.],\n",
  2555. " [106., 103., 105., ..., 128., 140., 132.],\n",
  2556. " [114., 107., 108., ..., 121., 123., 126.]],\n",
  2557. "\n",
  2558. " [[101., 102., 101., ..., 153., 153., 146.],\n",
  2559. " [101., 103., 100., ..., 148., 143., 149.],\n",
  2560. " [ 96., 95., 98., ..., 145., 138., 144.],\n",
  2561. " ...,\n",
  2562. " [ 98., 107., 103., ..., 140., 142., 145.],\n",
  2563. " [106., 100., 103., ..., 133., 133., 136.],\n",
  2564. " [115., 103., 102., ..., 123., 125., 128.]],\n",
  2565. "\n",
  2566. " [[103., 100., 102., ..., 154., 147., 153.],\n",
  2567. " [ 96., 103., 97., ..., 150., 150., 152.],\n",
  2568. " [ 96., 100., 96., ..., 141., 142., 144.],\n",
  2569. " ...,\n",
  2570. " [101., 102., 101., ..., 139., 142., 140.],\n",
  2571. " [105., 105., 98., ..., 132., 135., 131.],\n",
  2572. " [109., 111., 107., ..., 125., 126., 129.]]]])\n",
  2573. "Coordinates:\n",
  2574. " * runs (runs) float64 0.0 1.0 2.0 3.0 4.0\n",
  2575. " * truncation_value (truncation_value) float64 0.8 0.83 0.85 ... 0.97 0.99 1.0\n",
  2576. "Dimensions without coordinates: y, x\n",
  2577. "Attributes:\n",
  2578. " IMAGE_SUBCLASS: IMAGE_GRAYSCALE\n",
  2579. " IMAGE_VERSION: 1.2\n",
  2580. " IMAGE_WHITE_IS_ZERO: 0"
  2581. ]
  2582. },
  2583. "execution_count": 8,
  2584. "metadata": {},
  2585. "output_type": "execute_result"
  2586. }
  2587. ],
  2588. "source": [
  2589. "data = copy.deepcopy(dataSet.atoms)\n",
  2590. "# we first need to change the dtype from unsign 16-bit integer (uint16) to float, \n",
  2591. "# since the uint16 doesn't support to store nan value.\n",
  2592. "data = data.astype(float)\n",
  2593. "data = remove_bad_shots(data, runs=0, truncation_value=0.8)\n",
  2594. "data"
  2595. ]
  2596. },
  2597. {
  2598. "cell_type": "code",
  2599. "execution_count": null,
  2600. "metadata": {},
  2601. "outputs": [],
  2602. "source": []
  2603. }
  2604. ],
  2605. "metadata": {
  2606. "kernelspec": {
  2607. "display_name": "base",
  2608. "language": "python",
  2609. "name": "python3"
  2610. },
  2611. "language_info": {
  2612. "codemirror_mode": {
  2613. "name": "ipython",
  2614. "version": 3
  2615. },
  2616. "file_extension": ".py",
  2617. "mimetype": "text/x-python",
  2618. "name": "python",
  2619. "nbconvert_exporter": "python",
  2620. "pygments_lexer": "ipython3",
  2621. "version": "3.9.12"
  2622. }
  2623. },
  2624. "nbformat": 4,
  2625. "nbformat_minor": 2
  2626. }