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-24 16:54:29 +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",
2023-05-19 18:52:33 +02:00
"import pandas as pd\n",
2023-05-04 13:47:33 +02:00
"import numpy as np\n",
2023-05-19 18:52:33 +02:00
"import copy\n",
"\n",
"import glob\n",
"\n",
"import xrft\n",
"import finufft\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-05 18:25:03 +02:00
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
2023-05-19 18:52:33 +02:00
"from datetime import datetime\n",
"\n",
2023-05-04 13:47:33 +02:00
"import matplotlib.pyplot as plt\n",
2023-05-19 18:52:33 +02:00
"plt.rcParams['font.size'] = 18\n",
2023-05-04 13:47:33 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
2023-05-04 13:47:33 +02:00
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
"from Analyser.FitAnalyser import FitAnalyser\n",
2023-05-24 19:59:04 +02:00
"from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
2023-05-19 18:52:33 +02:00
"from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
2023-05-05 18:25:03 +02:00
"from ToolFunction.ToolFunction import *\n",
"\n",
"from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
"xr.plot.dataarray_plot.errorbar = errorbar\n",
"xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar\n",
2023-05-04 13:47:33 +02:00
"\n",
"imageAnalyser = ImageAnalyser()"
]
},
2023-05-24 16:54:29 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
{
"cell_type": "code",
"execution_count": 2,
"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 Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
"from Analyser.FitAnalyser import NewFitModel\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()"
]
},
2023-05-04 13:47:33 +02:00
{
"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-24 16:54:29 +02:00
"execution_count": 3,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-04 19:16:35 +02:00
"outputs": [
2023-05-24 16:54:29 +02:00
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\data\\AppData\\Roaming\\Python\\Python39\\site-packages\\distributed\\node.py:182: UserWarning: Port 8787 is already in use.\n",
"Perhaps you already have a cluster running?\n",
2023-05-24 19:59:04 +02:00
"Hosting the HTTP server on port 59239 instead\n",
2023-05-24 16:54:29 +02:00
" warnings.warn(\n"
]
},
2023-05-04 19:16:35 +02:00
{
"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-24 19:59:04 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-72432ab8-fa4d-11ed-a2d0-80e82ce2fa8e</p>\n",
2023-05-04 19:16:35 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59239/status\" target=\"_blank\">http://127.0.0.1:59239/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
2023-05-24 19:59:04 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">b4f1da7c</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-24 19:59:04 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:59239/status\" target=\"_blank\">http://127.0.0.1:59239/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 55.88 GiB\n",
" </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
" <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
"</tr>\n",
"\n",
" \n",
" </table>\n",
"\n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
" </summary>\n",
"\n",
" <div style=\"\">\n",
" <div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
2023-05-24 19:59:04 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-1c447eb9-c507-4810-aea3-3679987f2f3e</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-24 19:59:04 +02:00
" <strong>Comm:</strong> tcp://127.0.0.1:59240\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-24 19:59:04 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:59239/status\" target=\"_blank\">http://127.0.0.1:59239/status</a>\n",
2023-05-04 19:16:35 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Started:</strong> Just now\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 55.88 GiB\n",
" </td>\n",
" </tr>\n",
" </table>\n",
" </div>\n",
" </div>\n",
"\n",
" <details style=\"margin-left: 48px;\">\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Workers</h3>\n",
" </summary>\n",
"\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-05-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59282\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59283/status\" target=\"_blank\">http://127.0.0.1:59283/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59243\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-nw1je4oy\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-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59268\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59271/status\" target=\"_blank\">http://127.0.0.1:59271/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59244\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-o2y_ipun\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-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59274\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59277/status\" target=\"_blank\">http://127.0.0.1:59277/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59245\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-vkyen84d\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-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59275\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59280/status\" target=\"_blank\">http://127.0.0.1:59280/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59246\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-3iaj9i2x\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-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59273\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59276/status\" target=\"_blank\">http://127.0.0.1:59276/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59247\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-pkpso9u6\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-24 19:59:04 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:59267\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-24 19:59:04 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:59269/status\" target=\"_blank\">http://127.0.0.1:59269/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-24 19:59:04 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:59248\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-24 19:59:04 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-s2xtac3t\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-24 19:59:04 +02:00
"<Client: 'tcp://127.0.0.1:59240' processes=6 threads=60, memory=55.88 GiB>"
2023-05-04 19:16:35 +02:00
]
},
2023-05-24 16:54:29 +02:00
"execution_count": 3,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-04 13:47:33 +02:00
"source": [
"from dask.distributed import Client\n",
"client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
"client"
]
},
2023-05-19 18:52:33 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set global path for experiment"
]
},
{
"cell_type": "code",
2023-05-24 16:54:29 +02:00
"execution_count": 4,
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-24 16:54:29 +02:00
"# filepath = r\"./testData/0002/*.h5\"\n",
2023-04-24 13:03:23 +02:00
"\n",
2023-05-07 00:38:52 +02:00
"# filepath = r\"./testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5\"\n",
"\n",
"# filepath = r'd:/Jianshun Gao/Simulations/analyseScripts/testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5'\n",
"\n",
2023-05-05 18:25:03 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
"\n",
2023-05-24 16:54:29 +02:00
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\"\n",
"\n",
2023-05-24 19:59:04 +02:00
"filepath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_08.h5'"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-24 16:54:29 +02:00
"execution_count": 5,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-04-24 13:03:23 +02:00
"groupList = [\n",
" \"images/MOT_3D_Camera/in_situ_absorption\",\n",
2023-05-24 16:54:29 +02:00
" \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
" \"images/ODT_2_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-24 16:54:29 +02:00
" \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_3\",\n",
"}\n"
2023-05-04 13:47:33 +02:00
]
},
2023-04-24 13:03:23 +02:00
{
"cell_type": "code",
2023-05-24 16:54:29 +02:00
"execution_count": 6,
2023-05-04 13:47:33 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + '2023/05/23'# get_date()"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-24 16:54:29 +02:00
"# An example for one experimental run"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-24 16:54:29 +02:00
"## Load the data"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-24 16:54:29 +02:00
"execution_count": 7,
2023-04-24 13:03:23 +02:00
"metadata": {},
2023-05-04 19:16:35 +02:00
"outputs": [
2023-05-24 19:59:04 +02:00
{
"name": "stderr",
"output_type": "stream",
"text": [
"f:\\Jianshun\\analyseScript\\DataContainer\\ReadData.py:178: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n",
" if not key in datesetOfGlobal.scanAxis\n"
]
},
2023-05-04 19:16:35 +02:00
{
"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-24 19:59:04 +02:00
"Dimensions: (y: 1200, x: 1920)\n",
2023-05-24 16:54:29 +02:00
"Dimensions without coordinates: y, x\n",
2023-05-04 19:16:35 +02:00
"Data variables:\n",
2023-05-24 19:59:04 +02:00
" atoms (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" background (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" dark (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" shotNum int64 0\n",
" OD (y, x) float64 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
2023-05-04 19:16:35 +02:00
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
2023-05-24 19:59:04 +02:00
" blink_off_time: nan\n",
" blink_on_time: nan\n",
2023-05-04 19:16:35 +02:00
" ... ...\n",
2023-05-24 19:59:04 +02:00
" y_offset: 0\n",
" 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-24 19:59:04 +02:00
" scanAxis: []\n",
" scanAxisLength: []</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-c6409470-b974-4710-947f-9c7221cd6785' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c6409470-b974-4710-947f-9c7221cd6785' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>y</span>: 1200</li><li><span>x</span>: 1920</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-83d6b4ad-9415-4693-acb9-22158ac310d7' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-83d6b4ad-9415-4693-acb9-22158ac310d7' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-514c1139-1c51-492a-9bae-2578d4d55911' class='xr-section-summary-in' type='checkbox' checked><label for='section-514c1139-1c51-492a-9bae-2578d4d55911' class='xr-section-summary' >Data variables: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>atoms</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-fbb285cd-1b5a-47d7-8cf3-38acc14f2812' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-fbb285cd-1b5a-47d7-8cf3-38acc14f2812' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d8960312-9826-4051-bd0a-5f234daa7481' class='xr-var-data-in' type='checkbox'><label for='data-d8960312-9826-4051-bd0a-5f234daa7481' 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-24 19:59:04 +02:00
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-24 19:59:04 +02:00
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-24 19:59:04 +02:00
" <td colspan=\"2\"> 1 chunks in 2 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-24 19:59:04 +02:00
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-24 19:59:04 +02:00
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-24 19:59:04 +02:00
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-24 19:59:04 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-3dd92625-0949-40dc-8e31-cb51b242f3f8' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-3dd92625-0949-40dc-8e31-cb51b242f3f8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-62e7efad-494f-49ec-b557-aca60a8e58f2' class='xr-var-data-in' type='checkbox'><label for='data-62e7efad-494f-49ec-b557-aca60a8e58f2' 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-24 19:59:04 +02:00
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-24 19:59:04 +02:00
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-24 19:59:04 +02:00
" <td colspan=\"2\"> 1 chunks in 2 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-24 19:59:04 +02:00
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-24 19:59:04 +02:00
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-24 19:59:04 +02:00
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-24 19:59:04 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-c771e47d-2a6d-4dfc-a6d7-c886ccb657f0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c771e47d-2a6d-4dfc-a6d7-c886ccb657f0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-89b302d3-c9f7-4325-8ca3-872d30a4b2e2' class='xr-var-data-in' type='checkbox'><label for='data-89b302d3-c9f7-4325-8ca3-872d30a4b2e2' 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-24 19:59:04 +02:00
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-24 19:59:04 +02:00
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-24 19:59:04 +02:00
" <td colspan=\"2\"> 1 chunks in 2 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-24 19:59:04 +02:00
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-24 19:59:04 +02:00
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-24 19:59:04 +02:00
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-24 19:59:04 +02:00
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0</div><input id='attrs-fb0f62b1-bd1f-4126-9fa1-816e88474a57' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-fb0f62b1-bd1f-4126-9fa1-816e88474a57' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4be39c24-e4d6-4de1-bb57-23a178a9aa56' class='xr-var-data-in' type='checkbox'><label for='data-4be39c24-e4d6-4de1-bb57-23a178a9aa56' 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, dtype=int64)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>OD</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-37f08855-30e7-4226-b6a5-93d452d4743f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-37f08855-30e7-4226-b6a5-93d452d4743f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-32e72f21-edc9-45dd-a58e-9ff5e858c05e' class='xr-var-data-in' type='checkbox'><label for='data-32e72f21-edc9-45dd-a58e-9ff5e858c05e' 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-24 19:59:04 +02:00
" <td> 17.58 MiB </td>\n",
" <td> 17.58 MiB </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
2023-05-24 19:59:04 +02:00
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
2023-05-04 19:16:35 +02:00
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
2023-05-24 19:59:04 +02:00
" <td colspan=\"2\"> 1 chunks in 16 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-24 19:59:04 +02:00
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Horizontal lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Vertical lines -->\n",
2023-05-24 19:59:04 +02:00
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Colored Rectangle -->\n",
2023-05-24 19:59:04 +02:00
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
2023-05-04 19:16:35 +02:00
"\n",
" <!-- Text -->\n",
2023-05-24 19:59:04 +02:00
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
2023-05-04 19:16:35 +02:00
"</svg>\n",
" </td>\n",
" </tr>\n",
2023-05-24 19:59:04 +02:00
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-0af79019-0843-4663-9a2e-6cd3a9028e04' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0af79019-0843-4663-9a2e-6cd3a9028e04' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-9db6a54c-573c-47c9-b6a3-c845a2466e40' class='xr-section-summary-in' type='checkbox' ><label for='section-9db6a54c-573c-47c9-b6a3-c845a2466e40' class='xr-section-summary' >Attributes: <span>(96)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>TOF_free :</span></dt><dd>0.02</dd><dt><span>abs_img_freq :</span></dt><dd>110.858</dd><dt><span>absorption_imaging_flag :</span></dt><dd>True</dd><dt><span>backup_data :</span></dt><dd>True</dd><dt><span>blink_off_time :</span></dt><dd>nan</dd><dt><span>blink_on_time :</span></dt><dd>nan</dd><dt><span>c_duration :</span></dt><dd>0.2</dd><dt><span>cmot_final_current :</span></dt><dd>0.65</dd><dt><span>cmot_hold :</span></dt><dd>0.06</dd><dt><span>cmot_initial_current :</span></dt><dd>0.18</dd><dt><span>compX_current :</span></dt><dd>0.005</dd><dt><span>compX_current_sg :</span></dt><dd>0</dd><dt><span>compX_final_current :</span></dt><dd>0.005</dd><dt><span>compX_initial_current :</span></dt><dd>0.005</dd><dt><span>compY_current :</span></dt><dd>0</dd><dt><span>compY_current_sg :</span></dt><dd>0</dd><dt><span>compY_final_current :</span></dt><dd>0.0</dd><dt><span>compY_initial_current :</span></dt><dd>0</dd><dt><span>compZ_current :</span></dt><dd>0</dd><dt><span>compZ_current_sg :</span></dt><dd>0.189</dd><dt><span>compZ_final_current :</span></dt><dd>0.2812</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_final_pow :</span></dt><dd>0.35</dd><dt><span>evap_1_arm_1_mod_depth_final :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_mod_depth_initial :</span></dt><dd>1.0</dd><dt><span>evap_1_arm_1_mod_ramp_duration :</span></dt><dd>1.15</dd><dt><span>evap_1_arm_1_pow_ramp_duration :</span></dt><dd>1.65</dd><dt><span>evap_1_arm_1_start_pow :</span></dt><dd>7</dd><dt><span>evap_1_arm_2_final_pow :</span></dt><dd>5</dd><dt><span>evap_1_arm_2_ramp_duration :</span></dt><dd>0.5</dd><dt><span>evap_1_arm_2_start_pow :</span></dt><dd>0</dd><dt><span>evap_1_mod_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_1_pow_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_1_rate_constant_1 :</span></dt><dd>0.525</dd><dt><span>evap_1_rate_constant_2 :</span></dt><dd>0.51</dd><dt><span>evap_2_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_2_arm_1_start_pow :</span></dt><dd>0.35</dd><dt><span>evap_2_arm_2_final_pow :</span></dt><dd>0.09</dd><dt><span>evap_2_arm_2_start_pow :</span></dt><dd>5</dd><dt><span>evap_2_ramp_duration :</span></dt><dd>1.0</dd><dt><span>evap_2_ramp_trunc_value :</span></dt><dd>0.7</dd><dt><span>evap_2_rate_constant_1 :</span></dt><dd>0.37</dd><dt><span>evap_2_rate_constant_2 :</span></dt><dd>0.71</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.1038</dd><dt><span>evap_3_arm_1_mod_depth_final :</span></dt><dd>0.43</dd><dt><span>evap_3_arm_1_mod_depth_initial :</span></dt><dd>0</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_ramp_duration :</span></dt><dd>0.1</dd><dt><span>evap_3_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_3_rate_constant_1 :</span></dt><dd>-0.879</dd><dt><span>evap_3_rate_constant_2 :</span></dt><dd>-0.297</dd><dt><span>final_amp :</span></dt><dd>8e-05</dd><dt><span>final_freq :</span></dt><dd>104.0</dd><dt><span>gradCoil_current :</span></dt><dd>0.18</dd><dt><span>gradCoil_current_sg :</span></dt><dd>0</dd><dt><span>imaging_method :</span></dt><dd>in_situ_absorption</dd><dt><span>imaging_pulse_duration :</span></dt><dd>2.5e-05</dd><dt><span>imaging_wav
2023-05-04 19:16:35 +02:00
],
"text/plain": [
"<xarray.Dataset>\n",
2023-05-24 19:59:04 +02:00
"Dimensions: (y: 1200, x: 1920)\n",
2023-05-24 16:54:29 +02:00
"Dimensions without coordinates: y, x\n",
2023-05-04 19:16:35 +02:00
"Data variables:\n",
2023-05-24 19:59:04 +02:00
" atoms (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" background (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" dark (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" shotNum int64 0\n",
" OD (y, x) float64 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
2023-05-04 19:16:35 +02:00
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
2023-05-24 19:59:04 +02:00
" blink_off_time: nan\n",
" blink_on_time: nan\n",
2023-05-04 19:16:35 +02:00
" ... ...\n",
2023-05-24 19:59:04 +02:00
" y_offset: 0\n",
" 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-24 19:59:04 +02:00
" scanAxis: []\n",
" scanAxisLength: []"
2023-05-04 19:16:35 +02:00
]
},
2023-05-24 16:54:29 +02:00
"execution_count": 7,
2023-05-04 19:16:35 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-05-24 16:54:29 +02:00
"shotNum = \"0069\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"# filePath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/12/0065/*.h5\"\n",
2023-05-24 19:59:04 +02:00
"filePath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_08.h5'\n",
2023-05-24 16:54:29 +02:00
"\n",
"dataSetDict = {\n",
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
" for i in [0] # range(len(groupList))\n",
"}\n",
"\n",
"dataSet = dataSetDict[\"camera_1\"]\n",
"dataSet = swap_xy(dataSet)\n",
"\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
2023-05-04 19:16:35 +02:00
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"dataSet"
]
},
2023-05-05 18:25:03 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-24 16:54:29 +02:00
"## Calculate an plot OD images"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
2023-05-24 19:59:04 +02:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnIAAAHECAYAAAC9VcdgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9fXhW1ZX3/4kEbdQEQVqkwATG0JKx8Ag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2DNJt1uz+jZJxaScJJhhv6fd4Tza4He3v2O8HyF5AGXJC0+DfxAf/+BJGAe69TMqFBfV0A9W59pzkuwpAfULfGOaUaYHsgHL54M1GtsSwMKdcSAT0FWkR7f3oD0BzMmD5lQA9Am1nd8VjsEHJOJp0ZrrI/Kv+Jqsdtq95m/Cri/Dm7areWzoXu3JPDq54IxYxx01XHh6TZ4uhiu6KCPJwCItmPEWuaCcovWrYqOWddwMeNLLTGwBxgIbIuLPR0cBvbZu7b7aZ0XOrguF4BQr3+vdmJG2rwAlkyVbXXBMQCMkwUFwJol0L3Oa1d/kQr5bTadvLEyb6ENHbNr02BjDxjeqOW1QDlMqpfiwzmY6WLT6EP+YvsQ8PkMyGUSSQbkTrHEjNw3kM9mJ3kTQKWThVo0liiT1eyr5HwJVv4grM/T+nuDMT82YQRqShu4okkQGbse0d024I3V/WtWAbvh8Xq4ygac6VDZDZpapDi4L2zVuoMAj+UNFF5Zv0OpdbAsHOAhmij5hf4PBvRiBz31967kQHxh+3ieL+rOGS+KncrbF8wNbloOVMLOS7R4Z7A/VEvaBNEBO2HSR59jVwhmpyGgy0CEqcBXefuDd1/
2023-05-24 16:54:29 +02:00
"text/plain": [
2023-05-24 19:59:04 +02:00
"<Figure size 640x480 with 2 Axes>"
2023-05-24 16:54:29 +02:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-05-24 19:59:04 +02:00
"# imageAnalyser.center = (960, 1040)\n",
"# imageAnalyser.span = (100, 100)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"imageAnalyser.center = (960, 875)\n",
"imageAnalyser.span = (300, 300)\n",
2023-05-24 16:54:29 +02:00
"imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
"\n",
"dataSet_cropOD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Do a 2D two-peak gaussian fit to the OD images"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Do the fit"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": 9,
2023-05-05 18:25:03 +02:00
"metadata": {},
2023-05-24 19:59:04 +02:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"f:\\Jianshun\\analyseScript\\Analyser\\FitAnalyser.py:84: RuntimeWarning: invalid value encountered in power\n",
" res = (1- ((x-centerx)/(sigmax))**2 - ((y-centery)/(sigmay))**2)**(3 / 2)\n"
]
}
],
2023-05-05 18:25:03 +02:00
"source": [
2023-05-24 16:54:29 +02:00
"from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, polylog2_2d\n",
2023-05-05 18:25:03 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"fitModel = DensityProfileBEC2dModel()\n",
"# fitModel = ThomasFermi2dModel()\n",
2023-05-05 18:25:03 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"fitAnalyser = FitAnalyser(fitModel, fitDim=2)\n",
2023-05-05 18:25:03 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"# fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
"\n",
2023-05-24 19:59:04 +02:00
"# dataSet_cropOD = dataSet_cropOD.chunk((1,1,100,100))\n",
2023-05-24 16:54:29 +02:00
"\n",
"params = fitAnalyser.guess(dataSet_cropOD, guess_kwargs=dict(pureBECThreshold=0.3), dask=\"parallelized\")\n",
"fitResult = fitAnalyser.fit(dataSet_cropOD, params).load()"
2023-05-05 18:25:03 +02:00
]
},
2023-05-04 19:16:35 +02:00
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": 10,
2023-05-04 19:16:35 +02:00
"metadata": {},
"outputs": [
{
2023-05-24 19:59:04 +02:00
"data": {
"text/html": [
"<table><tr><th> name </th><th> value </th><th> initial value </th><th> min </th><th> max </th><th> vary </th><th> expression </th></tr><tr><td> BEC_amplitude </td><td> 0.00000000 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_amplitude </td><td> 3073.52821 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centerx </td><td> 146.943010 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centery </td><td> 147.472246 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centerx </td><td> 120.557038 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centery </td><td> 179.364624 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmax </td><td> 17.1554887 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmay </td><td> 18.3156015 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmax </td><td> 71.8465440 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmay </td><td> 86.2158528 </td><td> None </td><td> -inf </td><td> inf </td><td> False </td><td> thermalAspectRatio * thermal_sigmax </td></tr><tr><td> thermalAspectRatio </td><td> 1.20000000 </td><td> None </td><td> 0.80000000 </td><td> 1.20000000 </td><td> True </td><td> </td></tr><tr><td> condensate_fraction </td><td> 0.00000000 </td><td> None </td><td> -inf </td><td> inf </td><td> False </td><td> BEC_amplitude / (BEC_amplitude + thermal_amplitude) </td></tr></table>"
],
"text/plain": [
"Parameters([('BEC_amplitude', <Parameter 'BEC_amplitude', value=0, bounds=[0:inf]>), ('thermal_amplitude', <Parameter 'thermal_amplitude', value=3073.528205527723, bounds=[0:inf]>), ('BEC_centerx', <Parameter 'BEC_centerx', value=146.94301032591366, bounds=[-inf:inf]>), ('BEC_centery', <Parameter 'BEC_centery', value=147.47224593536436, bounds=[-inf:inf]>), ('thermal_centerx', <Parameter 'thermal_centerx', value=120.55703835420424, bounds=[-inf:inf]>), ('thermal_centery', <Parameter 'thermal_centery', value=179.3646237177809, bounds=[-inf:inf]>), ('BEC_sigmax', <Parameter 'BEC_sigmax', value=17.155488681677085, bounds=[0:inf]>), ('BEC_sigmay', <Parameter 'BEC_sigmay', value=18.315601451967396, bounds=[0:inf]>), ('thermal_sigmax', <Parameter 'thermal_sigmax', value=71.84654400127174, bounds=[0:inf]>), ('thermal_sigmay', <Parameter 'thermal_sigmay', value=86.21585280152608, bounds=[-inf:inf], expr='thermalAspectRatio * thermal_sigmax'>), ('thermalAspectRatio', <Parameter 'thermalAspectRatio', value=1.2, bounds=[0.8:1.2]>), ('condensate_fraction', <Parameter 'condensate_fraction', value=0.0, bounds=[-inf:inf], expr='BEC_amplitude / (BEC_amplitude + thermal_amplitude)'>)])"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"params.compute().item()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.QuadMesh at 0x1bdd890dfa0>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAoEAAAHECAYAAABGLvD6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAADLHElEQVR4nOz9e5hU1Zn3D3+rq7qqumka0TGDpwgTRVEwA2oSQ8hIMChG32QkKB5BMsqYDJkxQROiUfSJMSgmk0lGEx/Po8bEIfr4YwAxRCfqREfQREEuTZAGAmIiYJ+7quvw/lG1dq1911p7r32oY9+f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FhQyhJmmpRG/xRmmwtTDn0UtRV89vP5K4eW1VVMQ1YvVkK2EjEQMwUSgjyVimOrSGKsZMgzDMAzDMKHSzD/5GcYjtf5zqKb1r9avtRFwe48qbSmj10O1LYPi9bNFcMTClsCmh+8EzAinln8C1RB99fonHsZrr3WShdN7WwnhVCtRyC7iEUsUHBPY5DSMO3jfvn24//77cckll+CEE07AqFGjkEgkcOSRR+ILX/iCtZWLCnk/QafHH//4R8c5bNu2zVoRPJlM4kMf+hDOPPNMrFq1KuyXy1SUWu2/Wqk9cXV7y1bq9en2+PXyqId5VJJqfBa12GOZ9y1mmGaiYf6ax40bh0ym9Cs0mUyitbUVu3fvxu7du/H//t//w5w5c/Cf//mfaG9vV47R2tqKgw8+WHuOWEz/dqxZswbz5s3DwMAAAKCzsxP79u3D+vXrsX79elx++eW49957EYmw/bt
"text/plain": [
"<Figure size 640x480 with 2 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-24 19:59:04 +02:00
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
2023-05-24 16:54:29 +02:00
"\n",
"fitCurve.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])"
2023-05-04 13:47:33 +02:00
]
},
{
2023-05-24 16:54:29 +02:00
"cell_type": "code",
2023-05-24 19:59:04 +02:00
"execution_count": 12,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-24 16:54:29 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-24 16:54:29 +02:00
"fitModel2 = Polylog22dModel(prefix='thermal_')\n",
"fitAnalyser2 = FitAnalyser(fitModel2, fitDim=2)\n",
2023-05-24 19:59:04 +02:00
"fitCurve2 = fitAnalyser2.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()\n",
"\n",
"fitModel3 = ThomasFermi2dModel(prefix='BEC_')\n",
"fitAnalyser3 = FitAnalyser(fitModel3, fitDim=2)\n",
"fitCurve3 = fitAnalyser3.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-24 19:59:04 +02:00
"execution_count": 13,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-24 19:59:04 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHECAYAAAAkrR7VAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAChu0lEQVR4nOzdd3gc1dXA4d9sb+qSLfduY2OKwZhqSgDTS0joARJIIATyJZQUEgjpEHpCS4CEElpCdwymmWbTjG3ce6+S1bW9zvfH7MzOrlayZMuSJZ33efSw2p1Z3TXa1Zlzzz1XUVVVRQghhBBCtMnS3QMQQgghhOgJJGgSQgghhGgHCZqEEEIIIdpBgiYhhBBCiHaQoEkIIYQQoh0kaBJCCCGEaAcJmoQQQggh2sHW3QPo6VKpFNu3b6egoABFUbp7OEIIIYRoB1VV8fv9DBw4EIulfTkkCZr20Pbt2xkyZEh3D0MIIYQQu2HLli0MHjy4XcdK0LSHCgoKAO0fvbCwsJtHI4QQQoj2aG5uZsiQIcbf8faQoGkP6VNyhYWFEjQJIYQQPUxHSmukEFwIIYQQoh0kaBJCCCGEaAcJmoQQQggh2kGCJiGEEEKIdpCgSQghhBCiHSRoEkIIIYRoBwmahBBCCCHaQYImIYQQQoh2kKBJCCGEEKIdJGgSQgghhGgHCZqEEEIIIdpBgiYhhBBCiHaQoEkI0aepqko4luzuYQghegAJmoQQfdqvXlvCpD+8y5b6UHcPRQixj5OgSQjRp83b2EAknmL5jubuHooQYh8nQZMQok8LpafmApFEN49ECLGvk6BJCNGnBWNasBS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nji3IcffphAIIDVauXSSy/tlDELIfYt5pVzAKP7+Zh/28n8+ZtaNlrv1ZQv03T79GXc/NIirnr6K+OzKHd6bk837d3ZHDGeR1biCbFv6hFB05YtW5g0aRL/+Mc/WL9+fVYAtWXLFu68807OOeccVFWltLS0xca7N998M5WVlYRCIc444wzmz58PQCwW49FHH+W2224D4Oqrr2bs2LFd98KEEF3G3KNJV+iyoygKkNl/rrq5Zabpo1U1AMxeU8s/PtEy2i2n5/asELwuEDNud6TJphCi6/SY5paLFi3ihz/8IaBttFtYWEg4HCYYDBrHjBgxgldeeYXKysqsc4uKipgxYwannHIKy5cvZ/LkyRQUFBCJRIjHtSXG06ZN4/777++6FySE6FK5maZc+gq66vRWKzX+KCurmjlmdDklHjsN6XYE//lqCz88blSnF4LXBTMZrmAsQYnXsUfPJ4TofD0i0zRw4ED++9//8qMf/YhDDz2U8vJympubSaVSDB06lLPOOosnnniCZcuWMWnSpLzPceihh7Js2TJuuOEGxowZQzwex+v1cswxx/D4448zc+bMrE7iQojeZXt6C5WBxa0ETelMkz4994tXFnPZP+fy+bo6GsOZ/k21Ae3xzq5p0jcTBghGZSWeEPuiHpFpcjgcnH/++Zx//vl79Dz9+/fnvvvu47777uukkQkheor6dFBS7st/cdQ/p1fTyh3avpJfbWzAXFLpjySIJVKdvnoua3pONgAWYp/UIzJNQgixJ1RVNabXSluZ9tILwaubI8STKarStU0rq7Tgqchtx6KVP9EYinX+9FwgMz0XkkyTEPskCZqEEL1ecyRBMqWli4o99rzHZArBo1Q1RUgfzop0xqnc56DEowVcdcFYi0yTuSP4l+vruPE/C7MCoV0xT88FpBBciH2SBE1CiF6vIR2QeBxWXHZr3mP0QvCmcJy1NQHj/k312qq7Mq/TyFI1BGNGTZPdqqWfzNNzj8/ewKtfb2Pm0qp2j9E8PReS6Tkh9kkSNAkher2GkBaQ6Jm
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBOR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IYNh7U+S3qwo/e+9AWjvLqpmEhM5cX1Rc1+pMtuNTJNesPLbE+ipsnYf85qh0Xx2qqNT0HxxlN7rUKIHqNXBk2FhYWUlpbS0NBAWVkZjz76KFu2bGHOnDn8+Mc/Pq0/+4EHHqC2ttb4KipqfnEVQpxmH/9Ka2KZPRrO/Lpx98sbEotAAuFEjVKNL0RFQwiAqvi/JbVapmlUrpZV9oWiuO3WpB9z+1nDAJhWkA5g1DTpsr1OvHpNk3n/uWFnw9SbABWW3i+9m4ToI3pl0GSWl5fHvffeyzvvvIOiKPz0pz9NajmQmppq3Pb5Wu/6az5mfkxTTqeTtLS0pC8hRBeq2A9r/wxA2dkPsfD3a3h101H2H69nS1GNcZrfFDTphdugNacEKI5Pz43J04OmSFLbgQFpTn5yxSSeuWMOf/jSTAAy4pkmXbY3kWlqaLpp7yWPgMOrZZp2v3kqr1gI0UP0+qBJN2fOHObNmwdo/ZZ0gwYNMm4XFxc3e1zTY2lpaa3WMwkheoAPfgqxCIxZwPLQFPaU1fPa5mI2xLc30QVaC5oaQqiqatQ0jc5LZJr0wOe6mQX85vrpWCwK547NZUiWNn3fNNOU43EmF4Kb+J05/FNZrH2z4qcQbRJUCSF6nT4TNEGimHv//v3GfeYVc+aVdE3pxyZOnHiaRieEOGXHtsGu1wEFLn6IuoAWiNQHItT6w0mnthY0VTSEqPGFCYS1Qu+RuVptZFVjiGh8xd0jV01i3picZj8+s9n0nKmmqUmfp33H6/nf2oupVlOhch8H3v9rq1u1CCF6hz4VNB08eBBInl4bN26cURz+zjv
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-24 19:59:04 +02:00
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataSet_cropOD.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve2.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve3.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"\n",
"plt.show()\n",
"\n",
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataSet_cropOD.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve2.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve3.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"\n",
"plt.show()"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-24 19:59:04 +02:00
"execution_count": 14,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-24 19:59:04 +02:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\data\\AppData\\Roaming\\Python\\Python39\\site-packages\\numpy\\lib\\function_base.py:2246: RuntimeWarning: invalid value encountered in _get_fit_full_result_single (vectorized)\n",
" outputs = ufunc(*inputs)\n"
]
}
],
2023-04-24 13:03:23 +02:00
"source": [
2023-05-24 19:59:04 +02:00
"value = fitAnalyser.get_fit_full_result(fitResult)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"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: ()\n",
"Data variables:\n",
" BEC_amplitude object 0.0+/-nan\n",
" thermal_amplitude object 3066.9094836204504+/-nan\n",
" BEC_centerx object 146.94301032591366+/-nan\n",
" BEC_centery object 147.47224593536436+/-nan\n",
" thermal_centerx object 146.23870549779576+/-nan\n",
" thermal_centery object 148.7788885260284+/-nan\n",
" BEC_sigmax object 17.155488681677085+/-nan\n",
" BEC_sigmay object 18.315601451967396+/-nan\n",
" thermal_sigmax object 54.3744707945104+/-nan\n",
" thermal_sigmay object 65.24936495341248+/-nan\n",
" thermalAspectRatio object 1.2+/-nan\n",
" condensate_fraction object 0.0+/-nan</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-778068f2-9916-45b1-88c5-daebb1468087' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-778068f2-9916-45b1-88c5-daebb1468087' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-e9afc879-eb5f-4b18-b43f-e02b503a70da' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-e9afc879-eb5f-4b18-b43f-e02b503a70da' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-95ca6adb-bf26-4d9f-9f6d-7a09056f366d' class='xr-section-summary-in' type='checkbox' checked><label for='section-95ca6adb-bf26-4d9f-9f6d-7a09056f366d' class='xr-section-summary' >Data variables: <span>(12)</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>BEC_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>0.0+/-nan</div><input id='attrs-6c7a6cca-6c03-4e0f-8256-d2aa49b32534' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6c7a6cca-6c03-4e0f-8256-d2aa49b32534' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f2326020-1d64-492a-8fcd-84df392942a4' class='xr-var-data-in' type='checkbox'><label for='data-f2326020-1d64-492a-8fcd-84df392942a4' 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.0+/-nan, dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>thermal_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>3066.9094836204504+/-nan</div><input id='attrs-7a553c97-7292-405d-8f12-0fc16ed06209' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-7a553c97-7292-405d-8f12-0fc16ed06209' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6c2d7a07-027a-4b41-bf82-bfa4018d5acf' class='xr-var-data-in' type='checkbox'><label for='data-6c2d7a07-027a-4b41-bf82-bfa4018d5acf' 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(3066.9094836204504+/-nan, dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>BEC_centerx</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>146.94301032591366+/-nan</div><input id='attrs-e3a1da0b-6e8b-4623-a1e5-e1a81819ab2e' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e3a1da0b-6e8b-4623-a1e5-e1a81819ab2e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-26391797-36df-49da-8213-8262d45bdfbb' class='xr-var-data-in' type='checkbox'><label for='data-26391797-36df-49da-8213-8262d45bdfbb' 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(146.94301032591366+/-nan, dtype=object)</pre></div></li><li class='xr-var-item'><div clas
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" BEC_amplitude object 0.0+/-nan\n",
" thermal_amplitude object 3066.9094836204504+/-nan\n",
" BEC_centerx object 146.94301032591366+/-nan\n",
" BEC_centery object 147.47224593536436+/-nan\n",
" thermal_centerx object 146.23870549779576+/-nan\n",
" thermal_centery object 148.7788885260284+/-nan\n",
" BEC_sigmax object 17.155488681677085+/-nan\n",
" BEC_sigmay object 18.315601451967396+/-nan\n",
" thermal_sigmax object 54.3744707945104+/-nan\n",
" thermal_sigmay object 65.24936495341248+/-nan\n",
" thermalAspectRatio object 1.2+/-nan\n",
" condensate_fraction object 0.0+/-nan"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"value"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "unable to infer dtype on variable 'OD'; xarray cannot serialize arbitrary Python objects",
"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#Y216sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m fitResult\u001b[39m.\u001b[39;49mto_netcdf(\u001b[39m\"\u001b[39;49m\u001b[39msaved_on_disk.nc\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\core\\dataarray.py:3959\u001b[0m, in \u001b[0;36mDataArray.to_netcdf\u001b[1;34m(self, path, mode, format, group, engine, encoding, unlimited_dims, compute, invalid_netcdf)\u001b[0m\n\u001b[0;32m 3955\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m 3956\u001b[0m \u001b[39m# No problems with the name - so we're fine!\u001b[39;00m\n\u001b[0;32m 3957\u001b[0m dataset \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mto_dataset()\n\u001b[1;32m-> 3959\u001b[0m \u001b[39mreturn\u001b[39;00m to_netcdf( \u001b[39m# type: ignore # mypy cannot resolve the overloads:(\u001b[39;49;00m\n\u001b[0;32m 3960\u001b[0m dataset,\n\u001b[0;32m 3961\u001b[0m path,\n\u001b[0;32m 3962\u001b[0m mode\u001b[39m=\u001b[39;49mmode,\n\u001b[0;32m 3963\u001b[0m \u001b[39mformat\u001b[39;49m\u001b[39m=\u001b[39;49m\u001b[39mformat\u001b[39;49m,\n\u001b[0;32m 3964\u001b[0m group\u001b[39m=\u001b[39;49mgroup,\n\u001b[0;32m 3965\u001b[0m engine\u001b[39m=\u001b[39;49mengine,\n\u001b[0;32m 3966\u001b[0m encoding\u001b[39m=\u001b[39;49mencoding,\n\u001b[0;32m 3967\u001b[0m unlimited_dims\u001b[39m=\u001b[39;49munlimited_dims,\n\u001b[0;32m 3968\u001b[0m compute\u001b[39m=\u001b[39;49mcompute,\n\u001b[0;32m 3969\u001b[0m multifile\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[0;32m 3970\u001b[0m invalid_netcdf\u001b[39m=\u001b[39;49minvalid_netcdf,\n\u001b[0;32m 3971\u001b[0m )\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\backends\\api.py:1216\u001b[0m, in \u001b[0;36mto_netcdf\u001b[1;34m(dataset, path_or_file, mode, format, group, engine, encoding, unlimited_dims, compute, multifile, invalid_netcdf)\u001b[0m\n\u001b[0;32m 1211\u001b[0m \u001b[39m# TODO: figure out how to refactor this logic (here and in save_mfdataset)\u001b[39;00m\n\u001b[0;32m 1212\u001b[0m \u001b[39m# to avoid this mess of conditionals\u001b[39;00m\n\u001b[0;32m 1213\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m 1214\u001b[0m \u001b[39m# TODO: allow this work (setting up the file for writing array data)\u001b[39;00m\n\u001b[0;32m 1215\u001b[0m \u001b[39m# to be parallelized with dask\u001b[39;00m\n\u001b[1;32m-> 1216\u001b[0m dump_to_store(\n\u001b[0;32m 1217\u001b[0m dataset, store, writer, encoding\u001b[39m=\u001b[39;49mencoding, unlimited_dims\u001b[39m=\u001b[39;49munlimited_dims\n\u001b[0;32m 1218\u001b[0m )\n\u001b[0;32m 1219\u001b[0m \u001b[39mif\u001b[39;00m autoclose:\n\u001b[0;32m 1220\u001b[0m store\u001b[39m.\u001b[39mclose()\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\backends\\api.py:1263\u001b[0m, in \u001b[0;36mdump_to_store\u001b[1;34m(dataset, store, writer, encoder, encoding, unlimited_dims)\u001b[0m\n\u001b[0;32m 1260\u001b[0m \u001b[39mif\u001b[39;00m encoder:\n\u001b[0;32m 1261\u001b[0m variables, attrs \u001b[39m=\u001b[39m encoder(variables, attrs)\n\u001b[1;32m-> 1263\u001b[0m store\u001b[39m.\u001b[39;49mstore(variables, attrs, check_encoding, writer, unlimited_dims\u001b[39m=\u001b[39;49munlimited_dims)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\backends\\common.py:269\u001b[0m, in \u001b[0;36mAbstractWritableDataStore.store\u001b[1;34m(self, variables, attributes, check_encoding_set, writer, unlimited_dims)\u001b[0m\n\u001b[0;32m 266\u001b[0m \u001b[39mif\u001b[39;00m writer \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m 267\u001b[0m writer \u001b[39m=\u001b[39m ArrayWriter()\n\u001b[1;32m--> 269\u001b[0m variables, attributes \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(variables, attributes)\n\u001b[0;32m 271\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mset_attributes(attributes)\n\u001b[0;32m 272\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mset_dimensions(variables, unlimited_dims\u001b[39m=\u001b[39munlimited_dims)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\backends\\common.py:358\u001b[0m, in \u001b[0;36mWritableCFDataStore.encode\u001b[1;34m(self, variables, attributes)\u001b[0m\n\u001b[0;32m 355\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mencode\u001b[39m(\u001b[39mself\u001b[39m, variables, attributes):\n\u001b[0;32m 356\u001b[0m \u001b[39m# All NetCDF files get CF encoded by default, without this attempting\u001b[39;00m\n\u001b[0;32m 357\u001b[0m \u001b[39m# to write times, for example, would fail.\u001b[39;00m\n\u001b[1;32m--> 358\u001b[0m variables, attributes \u001b[39m=\u001b[39m cf_encoder(variables, attributes)\n\u001b[0;32m 359\u001b[0m variables \u001b[39m=\u001b[39m {k: \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mencode_variable(v) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m variables\u001b[39m.\u001b[39mitems()}\n\u001b[0;32m 360\u001b[0m attributes \u001b[39m=\u001b[39m {k: \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mencode_attribute(v) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m attributes\u001b[39m.\u001b[39mitems()}\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\conventions.py:775\u001b[0m, in \u001b[0;36mcf_encoder\u001b[1;34m(variables, attributes)\u001b[0m\n\u001b[0;32m 772\u001b[0m \u001b[39m# add encoding for time bounds variables if present.\u001b[39;00m\n\u001b[0;32m 773\u001b[0m _update_bounds_encoding(variables)\n\u001b[1;32m--> 775\u001b[0m new_vars \u001b[39m=\u001b[39m {k: encode_cf_variable(v, name\u001b[39m=\u001b[39mk) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m variables\u001b[39m.\u001b[39mitems()}\n\u001b[0;32m 777\u001b[0m \u001b[39m# Remove attrs from bounds variables (issue #2921)\u001b[39;00m\n\u001b[0;32m 778\u001b[0m \u001b[39mfor\u001b[39;00m var \u001b[39min\u001b[39;00m new_vars\u001b[39m.\u001b[39mvalues():\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\conventions.py:775\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 772\u001b[0m \u001b[39m# add encoding for time bounds variables if present.\u001b[39;00m\n\u001b[0;32m 773\u001b[0m _update_bounds_encoding(variables)\n\u001b[1;32m--> 775\u001b[0m new_vars \u001b[39m=\u001b[39m {k: encode_cf_variable(v, name\u001b[39m=\u001b[39;49mk) \u001b[39mfor\u001b[39;00m k, v \u001b[39min\u001b[39;00m variables\u001b[39m.\u001b[39mitems()}\n\u001b[0;32m 777\u001b[0m \u001b[39m# Remove attrs from bounds variables (issue #2921)\u001b[39;00m\n\u001b[0;32m 778\u001b[0m \u001b[39mfor\u001b[39;00m var \u001b[39min\u001b[39;00m new_vars\u001b[39m.\u001b[39mvalues():\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\conventions.py:189\u001b[0m, in \u001b[0;36mencode_cf_variable\u001b[1;34m(var, needs_copy, name)\u001b[0m\n\u001b[0;32m 186\u001b[0m var \u001b[39m=\u001b[39m coder\u001b[39m.\u001b[39mencode(var, name\u001b[39m=\u001b[39mname)\n\u001b[0;32m 188\u001b[0m \u001b[39m# TODO(kmuehlbauer): check if ensure_dtype_not_object can be moved to backends:\u001b[39;00m\n\u001b[1;32m--> 189\u001b[0m var \u001b[39m=\u001b[39m ensure_dtype_not_object(var, name\u001b[39m=\u001b[39;49mname)\n\u001b[0;32m 191\u001b[0m \u001b[39mfor\u001b[39;00m attr_name \u001b[39min\u001b[39;00m CF_RELATED_DATA:\n\u001b[0;32m 192\u001b[0m pop_to(var\u001b[39m.\u001b[39mencoding, var\u001b[39m.\u001b[39mattrs, attr_name)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\conventions.py:145\u001b[0m, in \u001b[0;36mensure_dtype_not_object\u001b[1;34m(var, name)\u001b[0m\n\u001b[0;32m 143\u001b[0m data[missing] \u001b[39m=\u001b[39m fill_value\n\u001b[0;32m 144\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m--> 145\u001b[0m data \u001b[39m=\u001b[39m _copy_with_dtype(data, dtype\u001b[39m=\u001b[39m_infer_dtype(data, name))\n\u001b[0;32m 147\u001b[0m \u001b[39massert\u001b[39;00m data\u001b[39m.\u001b[39mdtype\u001b[39m.\u001b[39mkind \u001b[39m!=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mO\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mor\u001b[39;00m data\u001b[39m.\u001b[39mdtype\u001b[39m.\u001b[39mmetadata\n\u001b[0;32m 148\u001b[0m var \u001b[39m=\u001b[39m Variable(dims, data, attrs, encoding, fastpath\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray\\conventions.py:77\u001b[0m, in \u001b[0;36m_infer_dtype\u001b[1;34m(array, name)\u001b[0m\n\u001b[0;32m 74\u001b[0m \u001b[39mif\u001b[39;00m dtype\u001b[39m.\u001b[39mkind \u001b[39m!=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mO\u001b[39m\u001b[39m\"\u001b[39m:\n\u001b[0;32m 75\u001b[0m \u001b[39mreturn\u001b[39;00m dtype\n\u001b[1;32m---> 77\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m 78\u001b[0m \u001b[39m\"\u001b[39m\u001b[39munable to infer dtype on variable \u001b[39m\u001b[39m{!r}\u001b[39;00m\u001b[39m; xarray \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 79\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mcannot serialize arbitrary Python objects\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(name)\n\u001b[0;32m 80\u001b[0m )\n",
"\u001b[1;31mValueError\u001b[0m: unable to infer dtype on variable 'OD'; xarray cannot serialize arbitrary Python objects"
]
}
],
"source": [
"fitResult.to_netcdf(\"saved_on_disk.nc\")"
2023-05-04 13:47:33 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-24 16:54:29 +02:00
"# Get the Ncount"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Ncount = dataSet_crop.OD.sum(dim=(scanAxis[0], 'x', 'y'))"
2023-04-24 13:03:23 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-04-24 13:03:23 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"Ncount.load()\n",
2023-05-05 18:25:03 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"Ncount.plot(ax=ax)"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-05 18:25:03 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"fitAnalyser = FitAnalyser(\"Lorentzian With Offset\")\n",
"params = fitAnalyser.guess(Ncount, x='runs', dask=\"parallelized\", guess_kwargs=dict(negative=True))"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-05 18:25:03 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"fitResult = fitAnalyser.fit(Ncount, params, x='runs', dask=\"parallelized\")\n",
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(40), dask=\"parallelized\").load()"
2023-05-04 13:47:33 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-04 13:47:33 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-06 11:23:38 +02:00
"source": [
2023-05-24 16:54:29 +02:00
"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)"
2023-05-06 11:23:38 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-07 00:38:52 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"np.ufunc(fitCurve)"
2023-05-07 00:38:52 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
2023-05-24 16:54:29 +02:00
"# Read CSV"
2023-05-07 00:38:52 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-07 00:38:52 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"# filePath = 'Z:/Dy_Lab/Data/Measurements/Experiments/DyBEC/BEC Stability Check/20230509-0007/*.csv'\n",
"\n",
"# filePath = np.sort(glob.glob(filePath))\n",
"\n",
"# read_csv_file(filePath, maxFileNum=5, csvEngine='pandas', csvKwargs=dict(header=[0,1], na_filter=False, index_col=0))\n",
"# read_csv_file(filePath, csvEngine='dask')"
2023-05-07 00:38:52 +02:00
]
},
{
"cell_type": "code",
2023-05-07 23:41:31 +02:00
"execution_count": null,
2023-05-06 11:23:38 +02:00
"metadata": {},
2023-05-07 23:41:31 +02:00
"outputs": [],
2023-05-04 13:47:33 +02:00
"source": [
2023-05-24 16:54:29 +02:00
"filePath = 'Z:/Dy_Lab/Data/Measurements/Experiments/DyBEC/BEC Stability Check/20230509-0007/*.csv'\n",
2023-05-05 18:25:03 +02:00
"\n",
2023-05-24 16:54:29 +02:00
"filePath = np.sort(glob.glob(filePath))\n",
"\n",
"data = np.empty(filePath.shape,dtype=object)\n",
"\n",
"i = 0\n",
"for fp in filePath:\n",
" data_single = pd.read_csv(fp)\n",
" data_single = xr.Dataset.from_dataframe(data_single)\n",
" data_single = data_single.drop_isel(index=0)\n",
" # data_single = data_single.expand_dims(dim='runs')\n",
" data[i] = data_single\n",
" i = i + 1\n",
"\n",
"data = xr.concat(data, 'runs')\n",
"\n",
"data = data.assign_coords(dict(index=data.Time.isel(runs=0).astype(float))).rename(dict(index='time')).astype(float)"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"data"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"arm2_mean = data['Channel A'].mean(dim='runs')\n",
"arm2_std = data['Channel A'].std(dim='runs')"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"arm2_mean.plot.errorbar(yerr=arm2_std, fmt='ob')"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"arm2_std.plot.errorbar(fmt='ob')"
2023-05-05 18:25:03 +02:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2023-05-24 16:54:29 +02:00
"data['Channel A'].sel(time=4.55, method='nearest').plot.errorbar(fmt='ob')\n",
"\n",
"plt.ylim([0, 0.15])\n",
"plt.show()"
2023-04-24 13:03:23 +02:00
]
},
2023-05-24 16:54:29 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2023-04-24 13:03:23 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
2023-05-04 13:47:33 +02:00
"display_name": "env",
2023-04-24 13:03:23 +02:00
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
2023-05-19 18:52:33 +02:00
"version": "3.9.13"
2023-04-24 13:03:23 +02:00
},
2023-05-04 13:47:33 +02:00
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
}
}
2023-04-24 13:03:23 +02:00
},
"nbformat": 4,
"nbformat_minor": 2
}