2023-04-24 13:03:23 +02:00
{
"cells": [
2023-05-04 13:47:33 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
2023-04-24 13:03:23 +02:00
{
"cell_type": "code",
2023-05-19 18:52:33 +02:00
"execution_count": 30,
2023-04-24 13:03:23 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-04 13:47:33 +02:00
"import xarray as xr\n",
2023-05-19 18:52:33 +02:00
"import pandas as pd\n",
2023-05-04 13:47:33 +02:00
"import numpy as np\n",
2023-05-19 18:52:33 +02:00
"import copy\n",
"\n",
"import glob\n",
"\n",
"import xrft\n",
"import finufft\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-05 18:25:03 +02:00
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
2023-05-19 18:52:33 +02:00
"from datetime import datetime\n",
"\n",
2023-05-04 13:47:33 +02:00
"import matplotlib.pyplot as plt\n",
2023-05-19 18:52:33 +02:00
"plt.rcParams['font.size'] = 18\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-19 18:52:33 +02:00
"from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time\n",
2023-05-04 13:47:33 +02:00
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
"from Analyser.FitAnalyser import FitAnalyser\n",
2023-05-19 18:52:33 +02:00
"from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
2023-05-05 18:25:03 +02:00
"from ToolFunction.ToolFunction import *\n",
"\n",
"from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
"xr.plot.dataarray_plot.errorbar = errorbar\n",
"xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar\n",
2023-05-04 13:47:33 +02:00
"\n",
"imageAnalyser = ImageAnalyser()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Start a client for parallel computing"
2023-04-24 13:03:23 +02:00
]
},
{
"cell_type": "code",
2023-05-19 18:52:33 +02:00
"execution_count": 5,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-04 19:16:35 +02:00
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
2023-05-19 18:52:33 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-200775db-f65c-11ed-b2b8-80e82ce2fa8e</p>\n",
2023-05-04 19:16:35 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
2023-05-19 18:52:33 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">2c51e6b4</p>\n",
2023-05-04 19:16:35 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 55.88 GiB\n",
" </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
" <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
"</tr>\n",
"\n",
" \n",
" </table>\n",
"\n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
" </summary>\n",
"\n",
" <div style=\"\">\n",
" <div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
2023-05-19 18:52:33 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-f9b0168c-58e7-417d-a784-847c37353ae6</p>\n",
2023-05-04 19:16:35 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm:</strong> tcp://127.0.0.1:61152\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Started:</strong> Just now\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 55.88 GiB\n",
" </td>\n",
" </tr>\n",
" </table>\n",
" </div>\n",
" </div>\n",
"\n",
" <details style=\"margin-left: 48px;\">\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Workers</h3>\n",
" </summary>\n",
"\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61184\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61187/status\" target=\"_blank\">http://127.0.0.1:61187/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61155\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-i0hiphpk\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61180\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61181/status\" target=\"_blank\">http://127.0.0.1:61181/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61156\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-iip3bgkh\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61192\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61194/status\" target=\"_blank\">http://127.0.0.1:61194/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61157\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-fysqgu68\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61183\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61185/status\" target=\"_blank\">http://127.0.0.1:61185/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61158\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-se3tovak\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61193\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61195/status\" target=\"_blank\">http://127.0.0.1:61195/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61159\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-4pxl4754\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:61189\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:61190/status\" target=\"_blank\">http://127.0.0.1:61190/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:61160\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-05-19 18:52:33 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-h3v0lbw6\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
"\n",
" </details>\n",
"</div>\n",
"\n",
" </details>\n",
" </div>\n",
"</div>\n",
" </details>\n",
" \n",
"\n",
" </div>\n",
"</div>"
],
"text/plain": [
2023-05-19 18:52:33 +02:00
"<Client: 'tcp://127.0.0.1:61152' processes=6 threads=60, memory=55.88 GiB>"
2023-05-04 19:16:35 +02:00
]
},
2023-05-19 18:52:33 +02:00
"execution_count": 5,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-04 13:47:33 +02:00
"source": [
"from dask.distributed import Client\n",
"client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
"client"
]
},
2023-05-19 18:52:33 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set global path for experiment"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"groupList = [\n",
" \"images/MOT_3D_Camera/in_situ_absorption\",\n",
" \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\",\n",
"]\n",
"\n",
"dskey = {\n",
" \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_0\",\n",
" \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_1\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
"}\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + \"2023/05/09\" # get_date()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Read CSV"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "concat_dims has length 1 but the datasets passed are nested in a 0-dimensional structure",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mf:\\Jianshun\\analyseScript\\test.ipynb Cell 9\u001b[0m in \u001b[0;36m1\n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m data[i] \u001b[39m=\u001b[39m data_single\n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m i \u001b[39m=\u001b[39m i \u001b[39m+\u001b[39m \u001b[39m1\u001b[39m\n\u001b[1;32m---> <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=15'>16</a>\u001b[0m xr\u001b[39m.\u001b[39;49mcombine_nested(data, concat_dim\u001b[39m=\u001b[39;49m[\u001b[39m'\u001b[39;49m\u001b[39mruns\u001b[39;49m\u001b[39m'\u001b[39;49m])\n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=17'>18</a>\u001b[0m \u001b[39m# data.assign_coords(dict(index=data.Time))\u001b[39;00m\n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=18'>19</a>\u001b[0m \n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=19'>20</a>\u001b[0m \u001b[39m# data = xr.Dataset(\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=28'>29</a>\u001b[0m \n\u001b[0;32m <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X55sZmlsZQ%3D%3D?line=29'>30</a>\u001b[0m \u001b[39m# data = data.rename(dict(index='time'))\u001b[39;00m\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:580\u001b[0m, in \u001b[0;36mcombine_nested\u001b[1;34m(datasets, concat_dim, compat, data_vars, coords, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 577\u001b[0m concat_dim \u001b[39m=\u001b[39m [concat_dim]\n\u001b[0;32m 579\u001b[0m \u001b[39m# The IDs argument tells _nested_combine that datasets aren't yet sorted\u001b[39;00m\n\u001b[1;32m--> 580\u001b[0m \u001b[39mreturn\u001b[39;00m _nested_combine(\n\u001b[0;32m 581\u001b[0m datasets,\n\u001b[0;32m 582\u001b[0m concat_dims\u001b[39m=\u001b[39;49mconcat_dim,\n\u001b[0;32m 583\u001b[0m compat\u001b[39m=\u001b[39;49mcompat,\n\u001b[0;32m 584\u001b[0m data_vars\u001b[39m=\u001b[39;49mdata_vars,\n\u001b[0;32m 585\u001b[0m coords\u001b[39m=\u001b[39;49mcoords,\n\u001b[0;32m 586\u001b[0m ids\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[0;32m 587\u001b[0m fill_value\u001b[39m=\u001b[39;49mfill_value,\n\u001b[0;32m 588\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 589\u001b[0m combine_attrs\u001b[39m=\u001b[39;49mcombine_attrs,\n\u001b[0;32m 590\u001b[0m )\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:359\u001b[0m, in \u001b[0;36m_nested_combine\u001b[1;34m(datasets, concat_dims, compat, data_vars, coords, ids, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 356\u001b[0m _check_shape_tile_ids(combined_ids)\n\u001b[0;32m 358\u001b[0m \u001b[39m# Apply series of concatenate or merge operations along each dimension\u001b[39;00m\n\u001b[1;32m--> 359\u001b[0m combined \u001b[39m=\u001b[39m _combine_nd(\n\u001b[0;32m 360\u001b[0m combined_ids,\n\u001b[0;32m 361\u001b[0m concat_dims,\n\u001b[0;32m 362\u001b[0m compat\u001b[39m=\u001b[39;49mcompat,\n\u001b[0;32m 363\u001b[0m data_vars\u001b[39m=\u001b[39;49mdata_vars,\n\u001b[0;32m 364\u001b[0m coords\u001b[39m=\u001b[39;49mcoords,\n\u001b[0;32m 365\u001b[0m fill_value\u001b[39m=\u001b[39;49mfill_value,\n\u001b[0;32m 366\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 367\u001b[0m combine_attrs\u001b[39m=\u001b[39;49mcombine_attrs,\n\u001b[0;32m 368\u001b[0m )\n\u001b[0;32m 369\u001b[0m \u001b[39mreturn\u001b[39;00m combined\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:224\u001b[0m, in \u001b[0;36m_combine_nd\u001b[1;34m(combined_ids, concat_dims, data_vars, coords, compat, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 222\u001b[0m n_dims \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(example_tile_id)\n\u001b[0;32m 223\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(concat_dims) \u001b[39m!=\u001b[39m n_dims:\n\u001b[1;32m--> 224\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m 225\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mconcat_dims has length \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m but the datasets \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 226\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mpassed are nested in a \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m-dimensional structure\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(\n\u001b[0;32m 227\u001b[0m \u001b[39mlen\u001b[39m(concat_dims), n_dims\n\u001b[0;32m 228\u001b[0m )\n\u001b[0;32m 229\u001b[0m )\n\u001b[0;32m 231\u001b[0m \u001b[39m# Each iteration of this loop reduces the length of the tile_ids tuples\u001b[39;00m\n\u001b[0;32m 232\u001b[0m \u001b[39m# by one. It always combines along the first dimension, removing the first\u001b[39;00m\n\u001b[0;32m 233\u001b[0m \u001b[39m# element of the tuple\u001b[39;00m\n\u001b[0;32m 234\u001b[0m \u001b[39mfor\u001b[39;00m concat_dim \u001b[39min\u001b[39;00m concat_dims:\n",
"\u001b[1;31mValueError\u001b[0m: concat_dims has length 1 but the datasets passed are nested in a 0-dimensional structure"
]
}
],
"source": [
"filePath = 'Z:/Dy_Lab/Data/Measurements/Experiments/DyBEC/BEC Stability Check/20230509-0007/*.csv'\n",
"\n",
"filePath = np.sort(glob.glob(filePath))\n",
"\n",
"data = np.empty(filePath.shape,dtype=object)\n",
"\n",
"i = 0\n",
"for fp in filePath:\n",
" data_single = pd.read_csv(fp)\n",
" data_single = xr.Dataset.from_dataframe(data_single)\n",
" data_single = data_single.drop_isel(index=0)\n",
" data_single = data_single.expand_dims(dim='runs')\n",
" data[i] = data_single\n",
" i = i + 1\n",
"\n",
"xr.combine_nested(data, concat_dim=['runs'])\n",
"\n",
"# data.assign_coords(dict(index=data.Time))\n",
"\n",
"# data = xr.Dataset(\n",
"# data_vars = {\n",
"# 'arm1': data['Channel C'],\n",
"# 'arm2': data['Channel A'],\n",
"# },\n",
"# coords = {\n",
"# 'index': data['Time']\n",
"# }\n",
"# )\n",
"\n",
"# data = data.rename(dict(index='time'))"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<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",
"<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",
"<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",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<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",
"<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",
"<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",
"<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",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: 'â–º';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: 'â–¼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'><xarray.Dataset>\n",
"Dimensions: (index: 100004, runs: 1)\n",
"Coordinates:\n",
" * index (index) int64 1 2 3 4 5 6 ... 100000 100001 100002 100003 100004\n",
"Dimensions without coordinates: runs\n",
"Data variables:\n",
" Time (runs, index) object '-0.44999999' '-0.44994999' ... '4.55014989'\n",
" Channel A (runs, index) object '-0.02044740' '-0.03051851' ... '0.09063997'\n",
" Channel C (runs, index) object '-0.01525925' '-0.01525925' ... '0.05981628'</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-3173c483-e0df-4c54-b1d1-fba2e8347e6d' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3173c483-e0df-4c54-b1d1-fba2e8347e6d' 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'>index</span>: 100004</li><li><span>runs</span>: 1</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-b017a61a-75a4-4945-a5a7-c9c22a3a4904' class='xr-section-summary-in' type='checkbox' checked><label for='section-b017a61a-75a4-4945-a5a7-c9c22a3a4904' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>index</span></div><div class='xr-var-dims'>(index)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>1 2 3 4 ... 100002 100003 100004</div><input id='attrs-ebc2dfec-83d3-4337-95dc-ddc3b521f06d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ebc2dfec-83d3-4337-95dc-ddc3b521f06d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-67b01792-ac53-4641-9710-7c82cb2f87e5' class='xr-var-data-in' type='checkbox'><label for='data-67b01792-ac53-4641-9710-7c82cb2f87e5' 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([ 1, 2, 3, ..., 100002, 100003, 100004], dtype=int64)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6e744b28-70da-4c5a-b447-58b39ebc1a32' class='xr-section-summary-in' type='checkbox' checked><label for='section-6e744b28-70da-4c5a-b447-58b39ebc1a32' class='xr-section-summary' >Data variables: <span>(3)</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>Time</span></div><div class='xr-var-dims'>(runs, index)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>'-0.44999999' ... '4.55014989'</div><input id='attrs-304c227d-f7d9-42bd-b4db-1daedc6497e9' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-304c227d-f7d9-42bd-b4db-1daedc6497e9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-29e7b056-bf5f-41e2-a80d-cbedd8cc6d90' class='xr-var-data-in' type='checkbox'><label for='data-29e7b056-bf5f-41e2-a80d-cbedd8cc6d90' 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.44999999', '-0.44994999', '-0.44989999', ..., '4.55004989',\n",
" '4.55009989', '4.55014989']], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Channel A</span></div><div class='xr-var-dims'>(runs, index)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>'-0.02044740' ... '0.09063997'</div><input id='attrs-8c6510db-4498-4fc9-b45d-c5fa1d19a1de' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8c6510db-4498-4fc9-b45d-c5fa1d19a1de' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2c60aa58-2e9f-44af-8546-db020067661c' class='xr-var-data-in' type='checkbox'><label for='data-2c60aa58-2e9f-44af-8546-db020067661c' 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.02044740', '-0.03051851', '0.02014222', ..., '0.02502518',\n",
" '0.06561480', '0.09063997']], dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Channel C</span></div><div class='xr-var-dims'>(runs, index)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>'-0.01525925' ... '0.05981628'</div><input id='attrs-0dc8b2af-af1a-485b-8942-e642aa1862ed' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0dc8b2af-af1a-485b-8942-e642aa1862ed' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6a955ee8-f77f-4b45-b18a-0ea0486b5932' class='xr-var-data-in' type='checkbox'><label for='data-6a955ee8-f77f-4b45-b18a-0ea0486b5932' 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.01525925', '-0.01525925', '-0.05005036', ..., '0.05981628',\n",
" '0.07477035', '0.05981628']], dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-de543410-3007-4fef-be30-b59e0d5f577b' class='xr-section-summary-in' type='checkbox' ><label for='section-de543410-3007-4fef-be30-b59e0d5f577b' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>index</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-f4743108-022b-4ecd-bfc2-9fd48d2c1ba1' class='xr-index-data-in' type='checkbox'/><label for='index-f4743108-022b-4ecd-bfc2-9fd48d2c1ba1' 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(Int64Index([ 1, 2, 3, 4, 5, 6, 7, 8,\n",
" 9, 10,\n",
" ...\n",
" 99995, 99996, 99997, 99998, 99999, 100000, 100001, 100002,\n",
" 100003, 100004],\n",
" dtype='int64', name='index', length=100004))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-43582b8a-7f7d-4cc9-bd19-38ceb739f793' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-43582b8a-7f7d-4cc9-bd19-38ceb739f793' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (index: 100004, runs: 1)\n",
"Coordinates:\n",
" * index (index) int64 1 2 3 4 5 6 ... 100000 100001 100002 100003 100004\n",
"Dimensions without coordinates: runs\n",
"Data variables:\n",
" Time (runs, index) object '-0.44999999' '-0.44994999' ... '4.55014989'\n",
" Channel A (runs, index) object '-0.02044740' '-0.03051851' ... '0.09063997'\n",
" Channel C (runs, index) object '-0.01525925' '-0.01525925' ... '0.05981628'"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data[0]"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "concat_dims has length 1 but the datasets passed are nested in a 0-dimensional structure",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mf:\\Jianshun\\analyseScript\\test.ipynb Cell 11\u001b[0m in \u001b[0;36m1\n\u001b[1;32m----> <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#X63sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m xr\u001b[39m.\u001b[39;49mcombine_nested(data[\u001b[39m0\u001b[39;49m:\u001b[39m2\u001b[39;49m], concat_dim\u001b[39m=\u001b[39;49m[[\u001b[39m'\u001b[39;49m\u001b[39mruns\u001b[39;49m\u001b[39m'\u001b[39;49m]])\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:580\u001b[0m, in \u001b[0;36mcombine_nested\u001b[1;34m(datasets, concat_dim, compat, data_vars, coords, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 577\u001b[0m concat_dim \u001b[39m=\u001b[39m [concat_dim]\n\u001b[0;32m 579\u001b[0m \u001b[39m# The IDs argument tells _nested_combine that datasets aren't yet sorted\u001b[39;00m\n\u001b[1;32m--> 580\u001b[0m \u001b[39mreturn\u001b[39;00m _nested_combine(\n\u001b[0;32m 581\u001b[0m datasets,\n\u001b[0;32m 582\u001b[0m concat_dims\u001b[39m=\u001b[39;49mconcat_dim,\n\u001b[0;32m 583\u001b[0m compat\u001b[39m=\u001b[39;49mcompat,\n\u001b[0;32m 584\u001b[0m data_vars\u001b[39m=\u001b[39;49mdata_vars,\n\u001b[0;32m 585\u001b[0m coords\u001b[39m=\u001b[39;49mcoords,\n\u001b[0;32m 586\u001b[0m ids\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[0;32m 587\u001b[0m fill_value\u001b[39m=\u001b[39;49mfill_value,\n\u001b[0;32m 588\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 589\u001b[0m combine_attrs\u001b[39m=\u001b[39;49mcombine_attrs,\n\u001b[0;32m 590\u001b[0m )\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:359\u001b[0m, in \u001b[0;36m_nested_combine\u001b[1;34m(datasets, concat_dims, compat, data_vars, coords, ids, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 356\u001b[0m _check_shape_tile_ids(combined_ids)\n\u001b[0;32m 358\u001b[0m \u001b[39m# Apply series of concatenate or merge operations along each dimension\u001b[39;00m\n\u001b[1;32m--> 359\u001b[0m combined \u001b[39m=\u001b[39m _combine_nd(\n\u001b[0;32m 360\u001b[0m combined_ids,\n\u001b[0;32m 361\u001b[0m concat_dims,\n\u001b[0;32m 362\u001b[0m compat\u001b[39m=\u001b[39;49mcompat,\n\u001b[0;32m 363\u001b[0m data_vars\u001b[39m=\u001b[39;49mdata_vars,\n\u001b[0;32m 364\u001b[0m coords\u001b[39m=\u001b[39;49mcoords,\n\u001b[0;32m 365\u001b[0m fill_value\u001b[39m=\u001b[39;49mfill_value,\n\u001b[0;32m 366\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 367\u001b[0m combine_attrs\u001b[39m=\u001b[39;49mcombine_attrs,\n\u001b[0;32m 368\u001b[0m )\n\u001b[0;32m 369\u001b[0m \u001b[39mreturn\u001b[39;00m combined\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\combine.py:224\u001b[0m, in \u001b[0;36m_combine_nd\u001b[1;34m(combined_ids, concat_dims, data_vars, coords, compat, fill_value, join, combine_attrs)\u001b[0m\n\u001b[0;32m 222\u001b[0m n_dims \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(example_tile_id)\n\u001b[0;32m 223\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(concat_dims) \u001b[39m!=\u001b[39m n_dims:\n\u001b[1;32m--> 224\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m 225\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mconcat_dims has length \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m but the datasets \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 226\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mpassed are nested in a \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m-dimensional structure\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(\n\u001b[0;32m 227\u001b[0m \u001b[39mlen\u001b[39m(concat_dims), n_dims\n\u001b[0;32m 228\u001b[0m )\n\u001b[0;32m 229\u001b[0m )\n\u001b[0;32m 231\u001b[0m \u001b[39m# Each iteration of this loop reduces the length of the tile_ids tuples\u001b[39;00m\n\u001b[0;32m 232\u001b[0m \u001b[39m# by one. It always combines along the first dimension, removing the first\u001b[39;00m\n\u001b[0;32m 233\u001b[0m \u001b[39m# element of the tuple\u001b[39;00m\n\u001b[0;32m 234\u001b[0m \u001b[39mfor\u001b[39;00m concat_dim \u001b[39min\u001b[39;00m concat_dims:\n",
"\u001b[1;31mValueError\u001b[0m: concat_dims has length 1 but the datasets passed are nested in a 0-dimensional structure"
]
}
],
"source": [
"xr.combine_nested(data[0:2], concat_dim=[['runs']])"
]
},
2023-05-04 13:47:33 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Read data"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set file path"
]
},
{
"cell_type": "code",
2023-05-04 19:16:35 +02:00
"execution_count": 3,
2023-04-24 13:03:23 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-04 18:32:17 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/03/0043/*.h5\"\n",
2023-04-24 13:03:23 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/2023-04-18_0003_Evaporative_Cooling_000.h5\"\n",
"\n",
2023-05-05 18:25:03 +02:00
"# filepath = \"//DyLabNAS/Data/Repetition_scan/2023/04/21/0002/*.h5\"\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-06 11:23:38 +02:00
"filepath = r\"./testData/0002/*.h5\"\n",
2023-04-24 13:03:23 +02:00
"\n",
2023-05-07 00:38:52 +02:00
"# filepath = r\"./testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5\"\n",
"\n",
"# filepath = r'd:/Jianshun Gao/Simulations/analyseScripts/testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5'\n",
"\n",
2023-05-05 18:25:03 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
"\n",
2023-05-06 11:23:38 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\""
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 19:16:35 +02:00
"execution_count": 4,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-04-24 13:03:23 +02:00
"groupList = [\n",
" \"images/MOT_3D_Camera/in_situ_absorption\",\n",
2023-05-04 13:47:33 +02:00
" # \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
2023-04-24 13:03:23 +02:00
"]\n",
"\n",
"dskey = {\n",
" \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_1\",\n",
2023-05-04 13:47:33 +02:00
" # \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
2023-04-24 13:03:23 +02:00
"}\n",
"\n",
2023-05-04 19:16:35 +02:00
"dataSetDict = {\n",
2023-04-24 13:03:23 +02:00
" dskey[groupList[i]]: read_hdf5_file(filepath, groupList[i])\n",
" for i in range(len(groupList))\n",
"}"
]
},
2023-05-04 13:47:33 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rechunk the data for parallel computing"
]
},
2023-04-24 13:03:23 +02:00
{
"cell_type": "code",
2023-05-04 19:16:35 +02:00
"execution_count": 5,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-04 19:16:35 +02:00
"dataSet = dataSetDict[\"camera_1\"]\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-04 19:16:35 +02:00
"scanAxis = dataSet.scanAxis\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-04 19:16:35 +02:00
"# dataSet = dataSet.chunk(\n",
2023-05-04 18:32:17 +02:00
"# {\n",
"# # \"compZ_current_sg\": \"auto\",\n",
"# \"sin_mod_freq\": \"auto\",\n",
"# \"runs\": 2,\n",
"# \"x\": \"auto\",\n",
"# \"y\": \"auto\",\n",
"# }\n",
"# )"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculate absorption imaging"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## get OD images"
]
},
{
"cell_type": "code",
2023-05-05 18:25:03 +02:00
"execution_count": 6,
2023-04-24 13:03:23 +02:00
"metadata": {},
2023-05-04 19:16:35 +02:00
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<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",
"<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",
"<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",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<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",
"<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",
"<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",
"<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",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: 'â–º';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: 'â–¼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'><xarray.Dataset>\n",
2023-05-05 18:25:03 +02:00
"Dimensions: (runs: 3, x: 1200, y: 1920)\n",
2023-05-04 19:16:35 +02:00
"Coordinates:\n",
" * runs (runs) float64 0.0 1.0 2.0\n",
"Dimensions without coordinates: x, y\n",
"Data variables:\n",
2023-05-05 18:25:03 +02:00
" atoms (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
" background (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
" dark (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
2023-05-07 00:38:52 +02:00
" shotNum (runs) int64 0 1 2\n",
2023-05-05 18:25:03 +02:00
" OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
2023-05-06 11:23:38 +02:00
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
2023-05-04 19:16:35 +02:00
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
" blink_off_time: nan\n",
" blink_on_time: nan\n",
" ... ...\n",
2023-05-05 18:25:03 +02:00
" y_offset_img: 0\n",
2023-05-04 19:16:35 +02:00
" z_offset: 0.189\n",
" z_offset_img: 0.189\n",
2023-05-05 18:25:03 +02:00
" runs: [0. 1. 2.]\n",
" scanAxis: ['runs']\n",
2023-05-07 23:41:31 +02:00
" scanAxisLength: [3.]</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-f93fede0-0ffa-4c21-b9ba-c80d42838e9a' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f93fede0-0ffa-4c21-b9ba-c80d42838e9a' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>runs</span>: 3</li><li><span>x</span>: 1200</li><li><span>y</span>: 1920</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-3dec71c4-b180-4438-934e-50bc3c02d447' class='xr-section-summary-in' type='checkbox' checked><label for='section-3dec71c4-b180-4438-934e-50bc3c02d447' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>runs</span></div><div class='xr-var-dims'>(runs)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 1.0 2.0</div><input id='attrs-35d0177d-948f-4b66-b45d-edfed01c339f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-35d0177d-948f-4b66-b45d-edfed01c339f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6995abb3-bf0c-4aa7-9aa2-0c4082d0d6b1' class='xr-var-data-in' type='checkbox'><label for='data-6995abb3-bf0c-4aa7-9aa2-0c4082d0d6b1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0., 1., 2.])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6b5f08a3-382c-44dd-ac4e-312cf9dc366e' class='xr-section-summary-in' type='checkbox' checked><label for='section-6b5f08a3-382c-44dd-ac4e-312cf9dc366e' class='xr-section-summary' >Data variables: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>atoms</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray></div><input id='attrs-18c85580-860b-4be5-be6c-dfab7bdaa4b7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-18c85580-860b-4be5-be6c-dfab7bdaa4b7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0801c4a5-fd40-4956-924d-5871de1976c4' class='xr-var-data-in' type='checkbox'><label for='data-0801c4a5-fd40-4956-924d-5871de1976c4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
2023-05-04 19:16:35 +02:00
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
2023-05-05 18:25:03 +02:00
" <td> 13.18 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-05 18:25:03 +02:00
" <td> (3, 1200, 1920) </td>\n",
" <td> (1, 1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-05 18:25:03 +02:00
" <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
2023-05-05 18:25:03 +02:00
" <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
" <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-05 18:25:03 +02:00
" <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
" <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-07 23:41:31 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray></div><input id='attrs-48a73fd3-7731-4eb6-bcb7-d35cef143851' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-48a73fd3-7731-4eb6-bcb7-d35cef143851' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6d9bb466-2ed5-48b2-8991-b812f0633673' class='xr-var-data-in' type='checkbox'><label for='data-6d9bb466-2ed5-48b2-8991-b812f0633673' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
2023-05-04 19:16:35 +02:00
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
2023-05-05 18:25:03 +02:00
" <td> 13.18 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-05 18:25:03 +02:00
" <td> (3, 1200, 1920) </td>\n",
" <td> (1, 1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-05 18:25:03 +02:00
" <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
2023-05-05 18:25:03 +02:00
" <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
" <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-05 18:25:03 +02:00
" <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
" <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-07 23:41:31 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray></div><input id='attrs-ced29619-3399-44f1-af13-2104035019ad' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ced29619-3399-44f1-af13-2104035019ad' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-55f03d0d-eeed-4a0c-8a02-ad327d3b47ef' class='xr-var-data-in' type='checkbox'><label for='data-55f03d0d-eeed-4a0c-8a02-ad327d3b47ef' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
2023-05-04 19:16:35 +02:00
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
2023-05-05 18:25:03 +02:00
" <td> 13.18 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-05 18:25:03 +02:00
" <td> (3, 1200, 1920) </td>\n",
" <td> (1, 1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-05 18:25:03 +02:00
" <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
2023-05-05 18:25:03 +02:00
" <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
" <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-05 18:25:03 +02:00
" <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
" <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-07 23:41:31 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>(runs)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2</div><input id='attrs-06cd93c4-61f2-4562-8ba6-4c20d452e78b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-06cd93c4-61f2-4562-8ba6-4c20d452e78b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5ee97d7b-66bd-4c48-b1a3-53571521fef4' class='xr-var-data-in' type='checkbox'><label for='data-5ee97d7b-66bd-4c48-b1a3-53571521fef4' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2], dtype=int64)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>OD</span></div><div class='xr-var-dims'>(runs, x, y)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray></div><input id='attrs-c68900f2-6164-4204-843b-aa719b3b7b70' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c68900f2-6164-4204-843b-aa719b3b7b70' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f16fbad2-1a80-444c-bad8-56e3457eb05f' class='xr-var-data-in' type='checkbox'><label for='data-f16fbad2-1a80-444c-bad8-56e3457eb05f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
2023-05-04 19:16:35 +02:00
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
2023-05-05 18:25:03 +02:00
" <td> 52.73 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" <td> 17.58 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-05 18:25:03 +02:00
" <td> (3, 1200, 1920) </td>\n",
" <td> (1, 1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-05 18:25:03 +02:00
" <td colspan=\"2\"> 3 chunks in 40 graph layers </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
2023-05-05 18:25:03 +02:00
" <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"75\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"79\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"84\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,89.9485979497544 10.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"10.0,0.0 130.0,0.0 144.9485979497544,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" style=\"stroke-width:2\" />\n",
" <line x1=\"24\" y1=\"89\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-05 18:25:03 +02:00
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"89\" style=\"stroke-width:2\" />\n",
" <line x1=\"144\" y1=\"14\" x2=\"144\" y2=\"89\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-05 18:25:03 +02:00
" <polygon points=\"24.9485979497544,14.948597949754403 144.9485979497544,14.948597949754403 144.9485979497544,89.9485979497544 24.9485979497544,89.9485979497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-05 18:25:03 +02:00
" <text x=\"84.948598\" y=\"109.948598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"164.948598\" y=\"52.448598\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,164.948598,52.448598)\">1200</text>\n",
" <text x=\"7.474299\" y=\"102.474299\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,102.474299)\">3</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-07 23:41:31 +02:00
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-5c3d2d31-aba4-4f09-afe5-e28bb74a7c71' class='xr-section-summary-in' type='checkbox' ><label for='section-5c3d2d31-aba4-4f09-afe5-e28bb74a7c71' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>runs</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-decca0b6-3468-41ab-9850-a5b69dadce82' class='xr-index-data-in' type='checkbox'/><label for='index-decca0b6-3468-41ab-9850-a5b69dadce82' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([0.0, 1.0, 2.0], dtype='float64', name='runs'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f1e5c163-3f1f-4b5e-8a9d-be23047482a2' class='xr-section-summary-in' type='checkbox' ><label for='section-f1e5c163-3f1f-4b5e-8a9d-be23047482a2' class='xr-section-summary' >Attributes: <span>(96)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>TOF_free :</span></dt><dd>0.02</dd><dt><span>abs_img_freq :</span></dt><dd>110.858</dd><dt><span>absorption_imaging_flag :</span></dt><dd>True</dd><dt><span>backup_data :</span></dt><dd>True</dd><dt><span>blink_off_time :</span></dt><dd>nan</dd><dt><span>blink_on_time :</span></dt><dd>nan</dd><dt><span>c_duration :</span></dt><dd>0.2</dd><dt><span>cmot_final_current :</span></dt><dd>0.65</dd><dt><span>cmot_hold :</span></dt><dd>0.06</dd><dt><span>cmot_initial_current :</span></dt><dd>0.18</dd><dt><span>compX_current :</span></dt><dd>0.005</dd><dt><span>compX_current_sg :</span></dt><dd>0</dd><dt><span>compX_final_current :</span></dt><dd>0.002</dd><dt><span>compX_initial_current :</span></dt><dd>0.005</dd><dt><span>compY_current :</span></dt><dd>0</dd><dt><span>compY_current_sg :</span></dt><dd>0</dd><dt><span>compY_final_current :</span></dt><dd>0</dd><dt><span>compY_initial_current :</span></dt><dd>0</dd><dt><span>compZ_current :</span></dt><dd>0</dd><dt><span>compZ_current_sg :</span></dt><dd>0.189</dd><dt><span>compZ_final_current :</span></dt><dd>0.283</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_final_pow :</span></dt><dd>0.35</dd><dt><span>evap_1_arm_1_mod_depth_final :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_mod_depth_initial :</span></dt><dd>1.0</dd><dt><span>evap_1_arm_1_mod_ramp_duration :</span></dt><dd>1.15</dd><dt><span>evap_1_arm_1_pow_ramp_duration :</span></dt><dd>1.65</dd><dt><span>evap_1_arm_1_start_pow :</span></dt><dd>7</dd><dt><span>evap_1_arm_2_final_pow :</span></dt><dd>5</dd><dt><span>evap_1_arm_2_ramp_duration :</span></dt><dd>0.5</dd><dt><span>evap_1_arm_2_start_pow :</span></dt><dd>0</dd><dt><span>evap_1_mod_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_1_pow_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_1_rate_constant_1 :</span></dt><dd>0.525</dd><dt><span>evap_1_rate_constant_2 :</span></dt><dd>0.51</dd><dt><span>evap_2_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_2_arm_1_start_pow :</span></dt><dd>0.35</dd><dt><span>evap_2_arm_2_final_pow :</span></dt><dd>0.09</dd><dt><span>evap_2_arm_2_start_pow :</span></dt><dd>5</dd><dt><span>evap_2_ramp_duration :</span></dt><dd>1.0</dd><dt><span>evap_2_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_2_rate_constant_1 :</span></dt><dd>0.37</dd><dt><span>evap_2_rate_constant_2 :</span></dt><dd>0.71</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.1038</dd><dt><span>evap_3_arm_1_mod_depth_final :</span></dt><dd>0.43</dd><dt><span>evap_3_arm_1_mod_depth_initial :</span></dt><dd>0</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_ramp_duration :</span></dt><dd>0.1</dd><dt><span>evap_3_ramp_trunc_va
2023-05-04 19:16:35 +02:00
],
"text/plain": [
"<xarray.Dataset>\n",
2023-05-05 18:25:03 +02:00
"Dimensions: (runs: 3, x: 1200, y: 1920)\n",
2023-05-04 19:16:35 +02:00
"Coordinates:\n",
" * runs (runs) float64 0.0 1.0 2.0\n",
"Dimensions without coordinates: x, y\n",
"Data variables:\n",
2023-05-05 18:25:03 +02:00
" atoms (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
" background (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
" dark (runs, x, y) uint16 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
2023-05-07 00:38:52 +02:00
" shotNum (runs) int64 0 1 2\n",
2023-05-05 18:25:03 +02:00
" OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
2023-05-06 11:23:38 +02:00
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
2023-05-04 19:16:35 +02:00
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
" blink_off_time: nan\n",
" blink_on_time: nan\n",
" ... ...\n",
2023-05-05 18:25:03 +02:00
" y_offset_img: 0\n",
2023-05-04 19:16:35 +02:00
" z_offset: 0.189\n",
" z_offset_img: 0.189\n",
2023-05-05 18:25:03 +02:00
" runs: [0. 1. 2.]\n",
" scanAxis: ['runs']\n",
" scanAxisLength: [3.]"
2023-05-04 19:16:35 +02:00
]
},
2023-05-05 18:25:03 +02:00
"execution_count": 6,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"dataSet"
]
},
2023-05-05 18:25:03 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Select region of interests"
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": 9,
2023-05-05 18:25:03 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-06 11:23:38 +02:00
"# imageAnalyser.center = (529, 962)\n",
"# imageAnalyser.span = (100,100)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
2023-05-05 18:25:03 +02:00
"\n",
"# imageAnalyser.center = (890, 1150)\n",
"# imageAnalyser.span = (600,600)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
2023-05-06 11:23:38 +02:00
"imageAnalyser.center = (890, 950)\n",
"imageAnalyser.span = (100,100)\n",
"imageAnalyser.fraction = (0.1, 0.1)\n",
2023-05-05 18:25:03 +02:00
"\n",
"dataSet_crop = imageAnalyser.crop_image(dataSet)"
]
},
2023-05-04 19:16:35 +02:00
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": 10,
2023-05-04 19:16:35 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-05-07 23:41:31 +02:00
"<xarray.plot.facetgrid.FacetGrid at 0x274b90445e0>"
2023-05-04 19:16:35 +02:00
]
},
2023-05-07 23:41:31 +02:00
"execution_count": 10,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
2023-05-05 18:25:03 +02:00
},
{
"data": {
2023-05-07 23:41:31 +02:00
"image/png": "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
2023-05-05 18:25:03 +02:00
"text/plain": [
2023-05-07 23:41:31 +02:00
"<Figure size 288x216 with 2 Axes>"
2023-05-05 18:25:03 +02:00
]
},
2023-05-06 11:23:38 +02:00
"metadata": {
"needs_background": "light"
},
2023-05-05 18:25:03 +02:00
"output_type": "display_data"
2023-05-04 19:16:35 +02:00
}
],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-07 23:41:31 +02:00
"dataSet_crop.OD.isel(runs=[0]).plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
"# dataSet_crop.OD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0])"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-05 18:25:03 +02:00
"## Remove the background"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"dataSet_crop['OD'] = dataSet_crop['OD'] + 500"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-04 18:32:17 +02:00
"outputs": [],
2023-04-24 13:03:23 +02:00
"source": [
2023-05-05 18:25:03 +02:00
"dataSet_crop['OD'] = imageAnalyser.substract_offset(dataSet_crop['OD'])"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-05 18:25:03 +02:00
"# Test Fit"
2023-04-24 13:03:23 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-04-24 13:03:23 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"fitAnalyser = FitAnalyser(\"Two Gaussian-2D\", fitDim=2)\n",
"\n",
"params = fitAnalyser.guess(dataSet_crop.OD, dask=\"parallelized\")"
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-05 18:25:03 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-07 00:38:52 +02:00
"fitResult = fitAnalyser.fit(dataSet_crop.OD, params).load()"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-05 18:25:03 +02:00
"metadata": {},
"outputs": [],
"source": [
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-06 11:23:38 +02:00
"source": [
"# fitCurve.isel(**{scanAxis[0]:np.arange(30), 'runs':range(dataSet_crop.OD['runs'].size)}).plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
"\n",
"fitCurve.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0])"
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-07 00:38:52 +02:00
"metadata": {},
"outputs": [],
"source": [
"a = fitAnalyser.get_fit_value(fitResult)\n",
"b = fitAnalyser.get_fit_std(fitResult)\n",
"data = combine_uncertainty(a, b)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Get the Ncount"
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-07 00:38:52 +02:00
"metadata": {},
"outputs": [],
"source": [
"Ncount = dataSet_crop.OD.sum(dim=(scanAxis[0], 'x', 'y'))"
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-06 11:23:38 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-05 18:25:03 +02:00
"Ncount.load()\n",
"\n",
2023-05-04 18:32:17 +02:00
"fig = plt.figure()\n",
2023-05-05 18:25:03 +02:00
"ax = fig.gca()\n",
"Ncount.plot(ax=ax)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitAnalyser = FitAnalyser(\"Lorentzian With Offset\")\n",
"params = fitAnalyser.guess(Ncount, x='sin_mod_freq', dask=\"parallelized\", guess_kwargs=dict(negative=True))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitResult = fitAnalyser.fit(Ncount, params, x='sin_mod_freq', dask=\"parallelized\")\n",
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(40), dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"plt.errorbar([1], [1], yerr=[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitCurve.plot.errorbar(yerr=fitCurve)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.ufunc(fitCurve)"
2023-04-24 13:03:23 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
2023-05-04 13:47:33 +02:00
"display_name": "env",
2023-04-24 13:03:23 +02:00
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-05-19 18:52:33 +02:00
"version": "3.9.13"
2023-04-24 13:03:23 +02:00
},
2023-05-04 13:47:33 +02:00
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
}
}
2023-04-24 13:03:23 +02:00
},
"nbformat": 4,
"nbformat_minor": 2
}