|
|
{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Import supporting package" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "import numpy as np\n", "\n", "from uncertainties import ufloat\n", "from uncertainties import unumpy as unp\n", "from uncertainties import umath\n", "\n", "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", "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", "\n", "imageAnalyser = ImageAnalyser()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Start a client for parallel computing" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "D:\\Program Files\\Python\\Python38\\Lib\\site-packages\\distributed\\node.py:182: UserWarning: Port 8787 is already in use.\n", "Perhaps you already have a cluster running?\n", "Hosting the HTTP server on port 59390 instead\n", " warnings.warn(\n" ] }, { "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", " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-9a0ca19d-ecb4-11ed-af18-9c7bef43b4fb</p>\n", " <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:59390/status\" target=\"_blank\">http://127.0.0.1:59390/status</a>\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " \n", "\n", " </table>\n", "\n", " \n", " <button style=\"margin-bottom: 12px;\" data-commandlinker-command=\"dask:populate-and-launch-layout\" data-commandlinker-args='{\"url\": \"http://127.0.0.1:59390/status\" }'>\n", " Launch dashboard in JupyterLab\n", " </button>\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", " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">40e09024</p>\n", " <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:59390/status\" target=\"_blank\">http://127.0.0.1:59390/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", " <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-616be11d-c546-4d58-ad88-3bacd53b13c0</p>\n", " <table style=\"width: 100%; text-align: left;\">\n", " <tr>\n", " <td style=\"text-align: left;\">\n", " <strong>Comm:</strong> tcp://127.0.0.1:59391\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>Dashboard:</strong> <a href=\"http://127.0.0.1:59390/status\" target=\"_blank\">http://127.0.0.1:59390/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", " <strong>Comm: </strong> tcp://127.0.0.1:59424\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59428/status\" target=\"_blank\">http://127.0.0.1:59428/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59394\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-ybrgy95q\n", " </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", " <strong>Comm: </strong> tcp://127.0.0.1:59422\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59427/status\" target=\"_blank\">http://127.0.0.1:59427/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59395\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-ms_3izxs\n", " </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", " <strong>Comm: </strong> tcp://127.0.0.1:59434\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59437/status\" target=\"_blank\">http://127.0.0.1:59437/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59396\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-qteiamcm\n", " </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", " <strong>Comm: </strong> tcp://127.0.0.1:59421\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59426/status\" target=\"_blank\">http://127.0.0.1:59426/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59397\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-r2y5vxh3\n", " </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", " <strong>Comm: </strong> tcp://127.0.0.1:59425\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59435/status\" target=\"_blank\">http://127.0.0.1:59435/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59398\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-3ykst_31\n", " </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", " <strong>Comm: </strong> tcp://127.0.0.1:59423\n", " </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", " <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59429/status\" target=\"_blank\">http://127.0.0.1:59429/status</a>\n", " </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", " <strong>Nanny: </strong> tcp://127.0.0.1:59399\n", " </td>\n", " <td style=\"text-align: left;\"></td>\n", " </tr>\n", " <tr>\n", " <td colspan=\"2\" style=\"text-align: left;\">\n", " <strong>Local directory: </strong> C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\dask-worker-space\\worker-egpqiwk3\n", " </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": [ "<Client: 'tcp://127.0.0.1:59391' processes=6 threads=60, memory=55.88 GiB>" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "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", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/03/0043/*.h5\"\n", "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/2023-04-18_0003_Evaporative_Cooling_000.h5\"\n", "\n", "# filepath = \"//DyLabNAS/Data/Repetition_scan/2023/04/21/0002/*.h5\"\n", "\n", "filepath = r\"./testData/0002/*.h5\"\n", "\n", "# 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", "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n", "\n", "# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "groupList = [\n", " \"images/MOT_3D_Camera/in_situ_absorption\",\n", " # \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n", "]\n", "\n", "dskey = {\n", " \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_1\",\n", " # \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n", "}\n", "\n", "dataSetDict = {\n", " dskey[groupList[i]]: read_hdf5_file(filepath, groupList[i])\n", " for i in range(len(groupList))\n", "}" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Rechunk the data for parallel computing" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "dataSet = dataSetDict[\"camera_1\"]\n", "\n", "scanAxis = dataSet.scanAxis\n", "\n", "# dataSet = dataSet.chunk(\n", "# {\n", "# # \"compZ_current_sg\": \"auto\",\n", "# \"sin_mod_freq\": \"auto\",\n", "# \"runs\": 2,\n", "# \"x\": \"auto\",\n", "# \"y\": \"auto\",\n", "# }\n", "# )" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Calculate absorption imaging" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## get OD images" ] }, { "cell_type": "code", "execution_count": 6, "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: (runs: 3, x: 1200, y: 1920)\n", "Coordinates:\n", " * runs (runs) float64 0.0 1.0 2.0\n", "Dimensions without coordinates: x, y\n", "Data variables:\n", " 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) int64 0 1 2\n", " OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n", "Attributes: (12/96)\n", " TOF_free: 0.02\n", " 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", " y_offset_img: 0\n", " z_offset: 0.189\n", " z_offset_img: 0.189\n", " 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-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", " <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", " <td> 13.18 MiB </td>\n", " <td> 4.39 MiB </td>\n", " </tr>\n", " \n", " <tr>\n", " <th> Shape </th>\n", " <td> (3, 1200, 1920) </td>\n", " <td> (1, 1200, 1920) </td>\n", " </tr>\n", " <tr>\n", " <th> Dask graph </th>\n", " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n", " </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", " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Text -->\n", " <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", "</svg>\n", " </td>\n", " </tr>\n", "</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", " <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", " <td> 13.18 MiB </td>\n", " <td> 4.39 MiB </td>\n", " </tr>\n", " \n", " <tr>\n", " <th> Shape </th>\n", " <td> (3, 1200, 1920) </td>\n", " <td> (1, 1200, 1920) </td>\n", " </tr>\n", " <tr>\n", " <th> Dask graph </th>\n", " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n", " </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", " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Text -->\n", " <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", "</svg>\n", " </td>\n", " </tr>\n", "</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", " <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", " <td> 13.18 MiB </td>\n", " <td> 4.39 MiB </td>\n", " </tr>\n", " \n", " <tr>\n", " <th> Shape </th>\n", " <td> (3, 1200, 1920) </td>\n", " <td> (1, 1200, 1920) </td>\n", " </tr>\n", " <tr>\n", " <th> Dask graph </th>\n", " <td colspan=\"2\"> 3 chunks in 10 graph layers </td>\n", " </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", " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Text -->\n", " <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", "</svg>\n", " </td>\n", " </tr>\n", "</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", " <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", " <td> 52.73 MiB </td>\n", " <td> 17.58 MiB </td>\n", " </tr>\n", " \n", " <tr>\n", " <th> Shape </th>\n", " <td> (3, 1200, 1920) </td>\n", " <td> (1, 1200, 1920) </td>\n", " </tr>\n", " <tr>\n", " <th> Dask graph </th>\n", " <td colspan=\"2\"> 3 chunks in 40 graph layers </td>\n", " </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", " <svg width=\"194\" height=\"139\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Horizontal lines -->\n", " <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", "\n", " <!-- Vertical lines -->\n", " <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", "\n", " <!-- Colored Rectangle -->\n", " <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", "\n", " <!-- Text -->\n", " <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", "</svg>\n", " </td>\n", " </tr>\n", "</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 ], "text/plain": [ "<xarray.Dataset>\n", "Dimensions: (runs: 3, x: 1200, y: 1920)\n", "Coordinates:\n", " * runs (runs) float64 0.0 1.0 2.0\n", "Dimensions without coordinates: x, y\n", "Data variables:\n", " 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) int64 0 1 2\n", " OD (runs, x, y) float64 dask.array<chunksize=(1, 1200, 1920), meta=np.ndarray>\n", "Attributes: (12/96)\n", " TOF_free: 0.02\n", " 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", " y_offset_img: 0\n", " z_offset: 0.189\n", " z_offset_img: 0.189\n", " runs: [0. 1. 2.]\n", " scanAxis: ['runs']\n", " scanAxisLength: [3.]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataSet = imageAnalyser.get_absorption_images(dataSet)\n", "\n", "dataSet" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Select region of interests" ] }, { "cell_type": "code", "execution_count": 9, "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)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "<xarray.plot.facetgrid.FacetGrid at 0x274b90445e0>" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "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 "text/plain": [ "<Figure size 288x216 with 2 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "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])" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Remove the background" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dataSet_crop['OD'] = dataSet_crop['OD'] + 500" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dataSet_crop['OD'] = imageAnalyser.substract_offset(dataSet_crop['OD'])" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Test Fit" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fitAnalyser = FitAnalyser(\"Two Gaussian-2D\", fitDim=2)\n", "\n", "params = fitAnalyser.guess(dataSet_crop.OD, dask=\"parallelized\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fitResult = fitAnalyser.fit(dataSet_crop.OD, params).load()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fitCurve = fitAnalyser.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "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", "execution_count": null, "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", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Ncount = dataSet_crop.OD.sum(dim=(scanAxis[0], 'x', 'y'))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Ncount.load()\n", "\n", "fig = plt.figure()\n", "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)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "env", "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", "version": "3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650" } } }, "nbformat": 4, "nbformat_minor": 2 }
|