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-04 19:16:35 +02:00
"execution_count": 1,
2023-04-24 13:03:23 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-04 13:47:33 +02:00
"import xarray as xr\n",
"import numpy as np\n",
"\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-04 13:47:33 +02:00
"import matplotlib.pyplot as plt\n",
"\n",
"from DataContainer.ReadData import read_hdf5_file\n",
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
"from Analyser.FitAnalyser import FitAnalyser\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-04 19:16:35 +02:00
"execution_count": 2,
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-05 18:25:03 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-40fde82e-eb61-11ed-b5b8-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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </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-05 18:25:03 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">59371be7</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",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </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-05 18:25:03 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-7426a0dc-a821-4183-aff9-f5e87cca3088</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-05 18:25:03 +02:00
" <strong>Comm:</strong> tcp://127.0.0.1:63721\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>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63745\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63749/status\" target=\"_blank\">http://127.0.0.1:63749/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63724\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-0sq_olis\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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63751\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63753/status\" target=\"_blank\">http://127.0.0.1:63753/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63725\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-4q4rmsbv\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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63752\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63756/status\" target=\"_blank\">http://127.0.0.1:63756/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63726\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-b4p4jg9b\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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63761\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63762/status\" target=\"_blank\">http://127.0.0.1:63762/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63727\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-a20xylwp\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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63760\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63763/status\" target=\"_blank\">http://127.0.0.1:63763/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63728\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-00umhxwt\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-05 18:25:03 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:63755\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-05 18:25:03 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63758/status\" target=\"_blank\">http://127.0.0.1:63758/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-05 18:25:03 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:63729\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-05 18:25:03 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-m7f8f51i\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-05 18:25:03 +02:00
"<Client: 'tcp://127.0.0.1:63721' processes=6 threads=60, memory=55.88 GiB>"
2023-05-04 19:16:35 +02:00
]
},
"execution_count": 2,
"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"
]
},
{
"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-04 18:32:17 +02:00
"# filepath = r\"./testData/0000/*.h5\"\n",
2023-04-24 13:03:23 +02:00
"\n",
2023-05-05 18:25:03 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
"\n",
"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": {},
"outputs": [],
"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",
" shotNum (runs) <U1 '0' '1' '2'\n",
" OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/101)\n",
" TOF_free: 0.015\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.]</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-5deb8af3-eb55-41fb-89ec-8c33a7bdadaf' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-5deb8af3-eb55-41fb-89ec-8c33a7bdadaf' 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-677562cd-c762-441a-8466-ed362be43008' class='xr-section-summary-in' type='checkbox' checked><label for='section-677562cd-c762-441a-8466-ed362be43008' 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-4ba8d9be-dffb-4603-a274-135aaadd6801' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-4ba8d9be-dffb-4603-a274-135aaadd6801' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b3a58c78-0886-4f42-b169-8d839fb7f04d' class='xr-var-data-in' type='checkbox'><label for='data-b3a58c78-0886-4f42-b169-8d839fb7f04d' 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-f131e957-99c1-4cfb-b32e-c6626a50212c' class='xr-section-summary-in' type='checkbox' checked><label for='section-f131e957-99c1-4cfb-b32e-c6626a50212c' 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-2fb9e741-a01e-486b-a9ee-3bc550412dad' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-2fb9e741-a01e-486b-a9ee-3bc550412dad' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3c281367-0f9a-4bf3-bf47-55fa832606ba' class='xr-var-data-in' type='checkbox'><label for='data-3c281367-0f9a-4bf3-bf47-55fa832606ba' 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-05 18:25:03 +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-b4ffbb55-6454-4082-b7ef-a4fec6f7d5a2' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-b4ffbb55-6454-4082-b7ef-a4fec6f7d5a2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2cf7f8e1-f185-4d87-a150-3a2e638f4508' class='xr-var-data-in' type='checkbox'><label for='data-2cf7f8e1-f185-4d87-a150-3a2e638f4508' 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-05 18:25:03 +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-f0d1b660-ef29-4412-b14d-5f1c921d0fc5' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f0d1b660-ef29-4412-b14d-5f1c921d0fc5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-31bbcbe6-813f-4258-818c-c9346479369f' class='xr-var-data-in' type='checkbox'><label for='data-31bbcbe6-813f-4258-818c-c9346479369f' 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-05 18:25:03 +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'><U1</div><div class='xr-var-preview xr-preview'>'0' '1' '2'</div><input id='attrs-6c954df7-f4c3-404a-8cac-04805b597747' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6c954df7-f4c3-404a-8cac-04805b597747' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-43f6390b-7148-428f-88ed-df11f443c13a' class='xr-var-data-in' type='checkbox'><label for='data-43f6390b-7148-428f-88ed-df11f443c13a' 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='<U1')</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-d2e53e6b-c985-4b8f-a545-d86db62204a0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-d2e53e6b-c985-4b8f-a545-d86db62204a0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-080a29b0-945e-42f9-beba-9a1fcaade5a9' class='xr-var-data-in' type='checkbox'><label for='data-080a29b0-945e-42f9-beba-9a1fcaade5a9' 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-05 18:25:03 +02:00
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-3218394e-5367-4e30-81a3-56a5adb05e76' class='xr-section-summary-in' type='checkbox' ><label for='section-3218394e-5367-4e30-81a3-56a5adb05e76' 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-3d3f5f94-d2c5-4ff2-852d-b1ca9c9df984' class='xr-index-data-in' type='checkbox'/><label for='index-3d3f5f94-d2c5-4ff2-852d-b1ca9c9df984' 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-bfedf659-5baa-4241-84a6-c2ced0e84be7' class='xr-section-summary-in' type='checkbox' ><label for='section-bfedf659-5baa-4241-84a6-c2ced0e84be7' class='xr-section-summary' >Attributes: <span>(101)</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.015</dd><dt><span>abs_img_freq :</span></dt><dd>110.858</dd><dt><span>absorption_imaging_flag :</span></dt><dd>True</dd><dt><span>backup_data :</span></dt><dd>True</dd><dt><span>blink_off_time :</span></dt><dd>nan</dd><dt><span>blink_on_time :</span></dt><dd>nan</dd><dt><span>c_duration :</span></dt><dd>0.2</dd><dt><span>cmot_final_current :</span></dt><dd>0.65</dd><dt><span>cmot_hold :</span></dt><dd>0.06</dd><dt><span>cmot_initial_current :</span></dt><dd>0.18</dd><dt><span>compX_current :</span></dt><dd>0.005</dd><dt><span>compX_current_sg :</span></dt><dd>0</dd><dt><span>compX_final_current :</span></dt><dd>0.005</dd><dt><span>compX_initial_current :</span></dt><dd>0.005</dd><dt><span>compY_current :</span></dt><dd>0</dd><dt><span>compY_current_sg :</span></dt><dd>0</dd><dt><span>compY_final_current :</span></dt><dd>0.0</dd><dt><span>compY_initial_current :</span></dt><dd>0</dd><dt><span>compZ_current :</span></dt><dd>0</dd><dt><span>compZ_current_sg :</span></dt><dd>0.189</dd><dt><span>compZ_final_current :</span></dt><dd>0.275</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_final_pow :</span></dt><dd>0.35</dd><dt><span>evap_1_arm_1_mod_depth_final :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_mod_depth_initial :</span></dt><dd>1.0</dd><dt><span>evap_1_arm_1_mod_ramp_duration :</span></dt><dd>1.15</dd><dt><span>evap_1_arm_1_pow_ramp_duration :</span></dt><dd>1.65</dd><dt><span>evap_1_arm_1_start_pow :</span></dt><dd>7</dd><dt><span>evap_1_arm_2_final_pow :</span></dt><dd>5</dd><dt><span>evap_1_arm_2_ramp_duration :</span></dt><dd>0.5</dd><dt><span>evap_1_arm_2_start_pow :</span></dt><dd>0</dd><dt><span>evap_1_mod_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_1_pow_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_1_rate_constant_1 :</span></dt><dd>0.525</dd><dt><span>evap_1_rate_constant_2 :</span></dt><dd>0.51</dd><dt><span>evap_2_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_2_arm_1_start_pow :</span></dt><dd>0.35</dd><dt><span>evap_2_arm_2_final_pow :</span></dt><dd>0.09</dd><dt><span>evap_2_arm_2_start_pow :</span></dt><dd>5</dd><dt><span>evap_2_ramp_duration :</span></dt><dd>1.0</dd><dt><span>evap_2_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_2_rate_constant_1 :</span></dt><dd>0.37</dd><dt><span>evap_2_rate_constant_2 :</span></dt><dd>0.71</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.1038</dd><dt><span>evap_3_arm_1_mod_depth_final :</span></dt><dd>0.43</dd><dt><span>evap_3_arm_1_mod_depth_initial :</span></dt><dd>0</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_ramp_duration :</span></dt><dd>0.1</dd><dt><span>evap_3_ramp_trunc_
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",
" shotNum (runs) <U1 '0' '1' '2'\n",
" OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/101)\n",
" TOF_free: 0.015\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",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"imageAnalyser.center = (529, 962)\n",
"imageAnalyser.span = (100,100)\n",
"imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"# imageAnalyser.center = (890, 1150)\n",
"# imageAnalyser.span = (600,600)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"# imageAnalyser.center = (890, 950)\n",
"# imageAnalyser.span = (100,100)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"dataSet_crop = imageAnalyser.crop_image(dataSet)"
]
},
2023-05-04 19:16:35 +02:00
{
"cell_type": "code",
2023-05-05 18:25:03 +02:00
"execution_count": 8,
2023-05-04 19:16:35 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-05-05 18:25:03 +02:00
"<xarray.plot.facetgrid.FacetGrid at 0x157ebfe65b0>"
2023-05-04 19:16:35 +02:00
]
},
2023-05-05 18:25:03 +02:00
"execution_count": 8,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
2023-05-05 18:25:03 +02:00
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA5EAAAEiCAYAAABgE1ZNAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOx9e7xWU/7/+6mmhFQ0EsXpK5JkRIPGpNNXLg0h+rpOOWiGMigMNcYktzCuY9QwjEOuv8m1MQ0yHRNiXGIMuU6HcIyJVGhK9fz+2J/P2u+9ns9ZZz+nQ6X1fr3Oa+1nrbXXXnvttdbe5/P+XArFYrGIiIiIiIiIiIiIiIiIiIgcaLamOxARERERERERERERERGx7iD+ExkRERERERERERERERGRG/GfyIiIiIiIiIiIiIiIiIjciP9ERkRERERERERERERERORG/CcyIiIiIiIiIiIiIiIiIjfiP5ERERERERERERERERERuRH/iYyIiIiIiIiIiIiIiIjIjfhPZERERERERERERERERERuxH8iIyIiIiIiIiIiIiIiInIj/hMZERERERERERERERERkRvxn8iI9RLFYhHnn38+ttxyS7Ru3RqVlZV49dVXGzzv3nvvxY477ohWrVphxx13xP333/8N9DYiImJ1cN9992H//fdHhw4dUCgU8NJLL+U6L673iIh1B1999RXOOecc9OrVCxtttBG23HJLDB8+HB9++GGD58a1HhFRPuI/kRGNxvLly9d0FxqNyy+/HFdddRV++9vf4rnnnsMWW2yBfffdF0uWLKn3nNmzZ+PII4/EsGHD8PLLL2PYsGE44ogj8Oyzz36DPY+IWDNYl9f7F198gb322guXXnpp7nPieo9YX7GurvUvv/wSL774Is477zy8+OKLuO+++/Dmm2/i4IMPDp4X13pERCNRjIjIif79+xdPOeWU4pgxY4qbbbZZce+99y7OmzevCKA4Z84cV2/hwoVFAMWZM2cWi8VicebMmUUAxRkzZhR32223YuvWrYt9+/Ytvv766+6cl156qVhZWVnceOONi23atCnuuuuuxeeee+5ruY9Vq1YVt9hii+Kll17q8v773/8W27ZtW/zd735X73lHHHFE8YADDsjk7b///sWjjjrqa+lnRMSaxLdlvTOs/teHuN4j1hd8G9e64u9//3sRQPHdd9+tt05c6xERjUNkIiPKwq233ooWLVrgqaeewg033FDWueeeey6uvPJKPP/882jRogVOOOEEV3bssceic+fOeO655/DCCy9g7Nix+M53vlNvW4MGDcLGG28c/KsP8+bNw0cffYT99tvP5bVq1Qr9+/fH008/Xe95s2fPzpwDAPvvv3/wnIiIdRnfhvXeWMT1HrE+4du61hctWoRCoYB27drVWyeu9YiIxqHFmu5AxLqFbt264fLLL3e/a2trc5978cUXo3///gCAsWPH4sADD8R///tfbLDBBnjvvffw85//HDvssAMAYLvttgu2ddNNN2Hp0qXl3wCAjz76CADQsWPHTH7Hjh3x7rvvBs+zztH2IiK+bfg2rPfGIq73iPUJ38a1/t///hdjx47FMcccg0022aTeenGtR0Q0DvGfyIiy0KdPn0afu/POO7vjTp06AQA+/vhjbL311jjjjDMwYsQITJkyBQMHDsT//d//Ydttt623ra222qrR/VAUCoXM72KxWJLXFOdERKyr+Dat98YgrveI9QXftrX+1Vdf4aijjsKqVaswadKkBuvHtR4RUT6iOmtEWdhoo40yv5s1S6ZQsVh0eV999ZV5Lquw6Oa8atUqAMD555+PV199FQceeCD++te/NugdbXVUXrbYYgsAKJEyfvzxxyXSSP+8cs+JiFiX8W1Y741FXO8R6xO+TWv9q6++whFHHIF58+bhscceC7KQQFzrERGNRWQiI1YL3/3udwEAdXV16N27NwDkdp/vY/vtt8f222+PMWPG4Oijj8Ytt9yCIUOGmHVXR+Wla9eu2GKLLfDYY4+5Pi9fvhxPPPEELrvssnrP69u3Lx577DGMGTPG5T366KP4wQ9+0Kh+RESsa1gX13tjEdd7xPqMdXWt6z+Qb731FmbOnInNNtuswXPiWo+IaBziP5ERq4XWrVtjzz33xKWXXoqKigosWLAAv/zlL8tqY+nSpfj5z3+OoUOHomvXrnj//ffx3HPP4fDDD6/3nNVReSkUChg9ejQuueQSbLfddthuu+1wySWXYMMNN8Qxxxzj6g0fPhxbbbUVJk6cCAA4/fTTsffee+Oyyy7DIYccggcffBAzZszAk08+2ei+RESsS1gX1zsAfPrpp3jvvfdcvLg33ngDQMJAqGZCXO8RESnWxbW+YsUKDB06FC+++CL+9Kc/YeXKlY5h3HTTTdGyZUsAca1HRDQVojprxGrjD3/4A7766iv06dMHp59+Oi666KKyzm/evDk++eQTDB8+HNtvvz2OOOIIDBo0CBMmTPiaegycffbZGD16NEaNGoU+ffrggw8+wKOPPoo2bdq4Ou+99x7q6urc7x/84Ae4++67ccstt2DnnXdGdXU17rnnHuyxxx5fWz8jItY2rIvr/aGHHkLv3r1x4IEHAgCOOuoo9O7dG7/73e9cnbjeIyKyWNfW+vvvv4+HHnoI77//PnbZZRd06tTJ/bGn1bjWIyKaBoUiK7xHRERERERERERERERERAQQmciIiIiIiIiIiIiIiIiI3Ij/REZERERERERERERERETkRvwnMiIiIiIiIiIiIiIiIiI34j+REREREREREREREREREbkR/4mMiIiIiIiIiIiIiIiIyI34T2REREREREREREREREREbrRY0x34urFq1Sp8+OGHaNOmDQqFwpruTkRERADFYhFLlizBlltuiWbNypNxxbUeEbHuYHXWOhDXe0TEuoLVXetrErW1tZmYoiHsvvvuaN68+dfco7UL3/o4ke+//z66dOmyprsRERFRBubPn4/OnTuXdU5c6xER6x4as9aBuN4jItY1NHatr0lssskmWLVkSYNqm0sBXPWb3+DUU0/9Jrq11uBbz0S2adNGjsYAOJRKpns1TzLOvoGOT5T05sDVtM4GadY2myTpu88nabs+adkjku4x0WjrfyT9l6SD06INdkrS/95L9beR9DH5OS4tetdq38fWct6xdN49Xh/4ctL+u4sp8/okGShlM/i62p88fQmgOd3Xysa2FejL/0jZv8pte2sj7z1tlPKMsXTQOajzjtt8D/nxQzru6bXJ8OfY6sBvK+89D5f0NkmXAbia1m1+ZNd6KwD7yu/HqJb/7E9Mi3bePEn/YT17fRaVkrZOi/5n0yTVOfPPn6dlOz0oB2/W3/G+NKdnSxubSt6nZc7DreS8D4zzdpayzP0NknR6A/UU8lxPOrK06AbdL3Qv2p4L6+sx0r1tGuXtKekzRv1jJL2z/ibd/hQaP3r2bl/XZ8HXlX9Ujt0qzbrjY+88fn9499qOnu9n8h5wc5LP0zkyU9J9qYznsIdDpP0HjXsNlR0gZX+x9uk7JC1n3wHS+QSkc6q+fabxax2w1rtA19Pscvdw2Yv6yXOelfd84/7ukj4cfW9JbWCApPpMrf3RekeNTpIjZe+5p4H+VUobNaF61h6ZB7q2A/tagzgiSZpvm6Qr36Cy+7J18P8C7dD6cp9pjf02OIKOda2W+X4s+f7hddxJ0tvSLP2muV1+H0/V9XNM7+cAute/+PdIZTpvzpa8yz+gsq2ydUyMK83qKOm/+Tx9Lza0T6zeWl+TWLJkCX4OoG0D9aYCWLx4cQO1vn341jORixcvRtu2bYHzFmHjsctd/ucbXZ+t2Ht8ejznWTn4S5rXY3ymOuZOyNkD75/P9tTOQr+NHej49fqb1DYW3kOZgfolH2ndqOztJLlY2jzXuK++Ujabys6SvCusPug95h2jEH4h6SWS0odc7xFJOoeuM0auffVTktGD2pKPmn6yM896lsr0WfeXdFcqu9rr0zZ0/K6X9y6V6Ti/jRK4Z0h97yJ58zXvAKN/AYyU839PeSu0Le7zd+rvl6KDtLWAn6G2sZ2
"text/plain": [
"<Figure size 1000x300 with 4 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
2023-05-04 19:16:35 +02:00
}
],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-05 18:25:03 +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-05 18:25:03 +02:00
"execution_count": 9,
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-05 18:25:03 +02:00
"execution_count": 10,
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-05 18:25:03 +02:00
"execution_count": 11,
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",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"fitResult = fitAnalyser.fit(dataSet_crop.OD, params, dask=\"parallelized\")# .load()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"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-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"fitCurve"
2023-05-04 13:47:33 +02:00
]
},
{
2023-05-05 18:25:03 +02:00
"cell_type": "code",
"execution_count": 14,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-05 18:25:03 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-05 18:25:03 +02:00
"fitResult = fitAnalyser.fit(dataSet_crop.OD, params, dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"f:\\Jianshun\\analyseScript\\Analyser\\FitAnalyser.py:544: FutureWarning: ``meta`` should be given in the ``dask_gufunc_kwargs`` parameter. It will be removed as direct parameter in a future version.\n",
" return xr.apply_ufunc(self._eval_2D, fitResultArray, kwargs={\"x\":_x, \"y\":_y, \"shape\":(len(x), len(y))}, **kwargs)\n"
]
},
{
"ename": "ValueError",
"evalue": "Invalid otype specification",
"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 25\u001b[0m in \u001b[0;36m1\n\u001b[1;32m----> <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/test.ipynb#Y114sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m fitCurve \u001b[39m=\u001b[39m fitAnalyser\u001b[39m.\u001b[39;49meval(fitResult, x\u001b[39m=\u001b[39;49mnp\u001b[39m.\u001b[39;49marange(\u001b[39m100\u001b[39;49m), y\u001b[39m=\u001b[39;49mnp\u001b[39m.\u001b[39;49marange(\u001b[39m100\u001b[39;49m), dask\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mparallelized\u001b[39;49m\u001b[39m\"\u001b[39;49m, meta \u001b[39m=\u001b[39;49m np\u001b[39m.\u001b[39;49mndarray((\u001b[39m0\u001b[39;49m,\u001b[39m0\u001b[39;49m), dtype\u001b[39m=\u001b[39;49m\u001b[39mfloat\u001b[39;49m))\u001b[39m.\u001b[39mload()\n",
"File \u001b[1;32mf:\\Jianshun\\analyseScript\\Analyser\\FitAnalyser.py:544\u001b[0m, in \u001b[0;36mFitAnalyser.eval\u001b[1;34m(self, fitResultArray, x, y, output_core_dims, prefix, dask, vectorize, **kwargs)\u001b[0m\n\u001b[0;32m 541\u001b[0m _x \u001b[39m=\u001b[39m _x\u001b[39m.\u001b[39mflatten()\n\u001b[0;32m 542\u001b[0m _y \u001b[39m=\u001b[39m _y\u001b[39m.\u001b[39mflatten()\n\u001b[1;32m--> 544\u001b[0m \u001b[39mreturn\u001b[39;00m xr\u001b[39m.\u001b[39mapply_ufunc(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_eval_2D, fitResultArray, kwargs\u001b[39m=\u001b[39m{\u001b[39m\"\u001b[39m\u001b[39mx\u001b[39m\u001b[39m\"\u001b[39m:_x, \u001b[39m\"\u001b[39m\u001b[39my\u001b[39m\u001b[39m\"\u001b[39m:_y, \u001b[39m\"\u001b[39m\u001b[39mshape\u001b[39m\u001b[39m\"\u001b[39m:(\u001b[39mlen\u001b[39m(x), \u001b[39mlen\u001b[39m(y))}, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\computation.py:1196\u001b[0m, in \u001b[0;36mapply_ufunc\u001b[1;34m(func, input_core_dims, output_core_dims, exclude_dims, vectorize, join, dataset_join, dataset_fill_value, keep_attrs, kwargs, dask, output_dtypes, output_sizes, meta, dask_gufunc_kwargs, *args)\u001b[0m\n\u001b[0;32m 1194\u001b[0m \u001b[39m# feed DataArray apply_variable_ufunc through apply_dataarray_vfunc\u001b[39;00m\n\u001b[0;32m 1195\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39many\u001b[39m(\u001b[39misinstance\u001b[39m(a, DataArray) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args):\n\u001b[1;32m-> 1196\u001b[0m \u001b[39mreturn\u001b[39;00m apply_dataarray_vfunc(\n\u001b[0;32m 1197\u001b[0m variables_vfunc,\n\u001b[0;32m 1198\u001b[0m \u001b[39m*\u001b[39;49margs,\n\u001b[0;32m 1199\u001b[0m signature\u001b[39m=\u001b[39;49msignature,\n\u001b[0;32m 1200\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 1201\u001b[0m exclude_dims\u001b[39m=\u001b[39;49mexclude_dims,\n\u001b[0;32m 1202\u001b[0m keep_attrs\u001b[39m=\u001b[39;49mkeep_attrs,\n\u001b[0;32m 1203\u001b[0m )\n\u001b[0;32m 1204\u001b[0m \u001b[39m# feed Variables directly through apply_variable_ufunc\u001b[39;00m\n\u001b[0;32m 1205\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39many\u001b[39m(\u001b[39misinstance\u001b[39m(a, Variable) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args):\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\computation.py:303\u001b[0m, in \u001b[0;36mapply_dataarray_vfunc\u001b[1;34m(func, signature, join, exclude_dims, keep_attrs, *args)\u001b[0m\n\u001b[0;32m 298\u001b[0m result_coords, result_indexes \u001b[39m=\u001b[39m build_output_coords_and_indexes(\n\u001b[0;32m 299\u001b[0m args, signature, exclude_dims, combine_attrs\u001b[39m=\u001b[39mkeep_attrs\n\u001b[0;32m 300\u001b[0m )\n\u001b[0;32m 302\u001b[0m data_vars \u001b[39m=\u001b[39m [\u001b[39mgetattr\u001b[39m(a, \u001b[39m\"\u001b[39m\u001b[39mvariable\u001b[39m\u001b[39m\"\u001b[39m, a) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args]\n\u001b[1;32m--> 303\u001b[0m result_var \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39;49mdata_vars)\n\u001b[0;32m 305\u001b[0m out: \u001b[39mtuple\u001b[39m[DataArray, \u001b[39m.\u001b[39m\u001b[39m.\u001b[39m\u001b[39m.\u001b[39m] \u001b[39m|\u001b[39m DataArray\n\u001b[0;32m 306\u001b[0m \u001b[39mif\u001b[39;00m signature\u001b[39m.\u001b[39mnum_outputs \u001b[39m>\u001b[39m \u001b[39m1\u001b[39m:\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\computation.py:756\u001b[0m, in \u001b[0;36mapply_variable_ufunc\u001b[1;34m(func, signature, exclude_dims, dask, output_dtypes, vectorize, keep_attrs, dask_gufunc_kwargs, *args)\u001b[0m\n\u001b[0;32m 754\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 755\u001b[0m \u001b[39mif\u001b[39;00m vectorize:\n\u001b[1;32m--> 756\u001b[0m func \u001b[39m=\u001b[39m _vectorize(\n\u001b[0;32m 757\u001b[0m func, signature, output_dtypes\u001b[39m=\u001b[39;49moutput_dtypes, exclude_dims\u001b[39m=\u001b[39;49mexclude_dims\n\u001b[0;32m 758\u001b[0m )\n\u001b[0;32m 760\u001b[0m result_data \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39minput_data)\n\u001b[0;32m 762\u001b[0m \u001b[39mif\u001b[39;00m signature\u001b[39m.\u001b[39mnum_outputs \u001b[39m==\u001b[39m \u001b[39m1\u001b[39m:\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\computation.py:637\u001b[0m, in \u001b[0;36m_vectorize\u001b[1;34m(func, signature, output_dtypes, exclude_dims)\u001b[0m\n\u001b[0;32m 635\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_vectorize\u001b[39m(func, signature, output_dtypes, exclude_dims):\n\u001b[0;32m 636\u001b[0m \u001b[39mif\u001b[39;00m signature\u001b[39m.\u001b[39mall_core_dims:\n\u001b[1;32m--> 637\u001b[0m func \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39;49mvectorize(\n\u001b[0;32m 638\u001b[0m func,\n\u001b[0;32m 639\u001b[0m otypes\u001b[39m=\u001b[39;49moutput_dtypes,\n\u001b[0;32m 640\u001b[0m signature\u001b[39m=\u001b[39;49msignature\u001b[39m.\u001b[39;49mto_gufunc_string(exclude_dims),\n\u001b[0;32m 641\u001b[0m )\n\u001b[0;32m 642\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 643\u001b[0m func \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mvectorize(func, otypes\u001b[39m=\u001b[39moutput_dtypes)\n",
"File \u001b[1;32mc:\\ProgramData\\Anaconda3\\envs\\py39\\lib\\site-packages\\numpy\\lib\\function_base.py:2122\u001b[0m, in \u001b[0;36mvectorize.__init__\u001b[1;34m(self, pyfunc, otypes, doc, excluded, cache, signature)\u001b[0m\n\u001b[0;32m 2120\u001b[0m otypes \u001b[39m=\u001b[39m \u001b[39m'\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39mjoin([_nx\u001b[39m.\u001b[39mdtype(x)\u001b[39m.\u001b[39mchar \u001b[39mfor\u001b[39;00m x \u001b[39min\u001b[39;00m otypes])\n\u001b[0;32m 2121\u001b[0m \u001b[39melif\u001b[39;00m otypes \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m-> 2122\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39mInvalid otype specification\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m 2123\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39motypes \u001b[39m=\u001b[39m otypes\n\u001b[0;32m 2125\u001b[0m \u001b[39m# Excluded variable support\u001b[39;00m\n",
"\u001b[1;31mValueError\u001b[0m: Invalid otype specification"
]
}
],
"source": [
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\", meta = np.ndarray((0,0), dtype=float)).load()"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"auto_rechunk(fitResult)\n",
"fitResult"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"# 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])"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-05 18:25:03 +02:00
"fitResult.load()"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-04 18:32:17 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-05 18:25:03 +02:00
"def resolve_fit_result(fitResult):\n",
" \n",
" \n",
" \n",
" return"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Get the Ncount"
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-04 19:16:35 +02:00
"Ncount = dataSet_crop.OD.sum(dim=(scanAxis[1], 'x', 'y'))"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-04 18:32:17 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-04 18:32:17 +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-04 18:32:17 +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
}