analyseScript/20230630_Data_Analysis copy.ipynb

1600 lines
2.8 MiB
Plaintext
Raw Normal View History

2023-09-08 14:13:27 +02:00
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"import numpy as np\n",
"import copy\n",
"\n",
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"import random\n",
"import matplotlib.pyplot as plt\n",
"plt.rcParams['font.size'] = 12\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 NewFitModel, DensityProfileBEC2dModel\n",
"from ToolFunction.ToolFunction import *\n",
"\n",
"from scipy.optimize import curve_fit\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()\n",
"\n",
"# %matplotlib notebook"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Start a client for parallel computing"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-08-23 16:46:30,819 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,836 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,855 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,867 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,878 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,888 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,900 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n",
"2023-08-23 16:46:30,910 - distributed.nanny.memory - WARNING - Ignoring provided memory limit 20GB due to system memory limit of 15.78 GiB\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-d849915f-41c3-11ee-bc5c-6c02e09174aa</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">5e37be83</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 8\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 128\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 126.24 GiB\n",
" </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
" <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
"</tr>\n",
"\n",
" \n",
" </table>\n",
"\n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
" </summary>\n",
"\n",
" <div style=\"\">\n",
" <div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-7e1ebaa1-17ce-4093-98e9-6fa1df40617f</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm:</strong> tcp://127.0.0.1:57184\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 8\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 128\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> 126.24 GiB\n",
" </td>\n",
" </tr>\n",
" </table>\n",
" </div>\n",
" </div>\n",
"\n",
" <details style=\"margin-left: 48px;\">\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Workers</h3>\n",
" </summary>\n",
"\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57237\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57238/status\" target=\"_blank\">http://127.0.0.1:57238/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57189\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-ad8uv68r\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57231\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57235/status\" target=\"_blank\">http://127.0.0.1:57235/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57190\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-se1wrrud\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57222\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57223/status\" target=\"_blank\">http://127.0.0.1:57223/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57191\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-qziykqmu\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57243\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57244/status\" target=\"_blank\">http://127.0.0.1:57244/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57192\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-_jkmw0l4\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57225\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57226/status\" target=\"_blank\">http://127.0.0.1:57226/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57193\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-g21t5hxt\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57232\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57233/status\" target=\"_blank\">http://127.0.0.1:57233/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57194\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-z3830qus\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 6</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57228\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57229/status\" target=\"_blank\">http://127.0.0.1:57229/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57195\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-4_nt2c7b\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 7</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57240\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 16\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57241/status\" target=\"_blank\">http://127.0.0.1:57241/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 15.78 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:57196\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\JIANSH~1\\AppData\\Local\\Temp\\dask-scratch-space\\worker-q9c2bvua\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
"\n",
" </details>\n",
"</div>\n",
"\n",
" </details>\n",
" </div>\n",
"</div>\n",
" </details>\n",
" \n",
"\n",
" </div>\n",
"</div>"
],
"text/plain": [
"<Client: 'tcp://127.0.0.1:57184' processes=8 threads=128, memory=126.24 GiB>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from dask.distributed import Client\n",
"client = Client(n_workers=8, threads_per_worker=16, processes=True, memory_limit='20GB')\n",
"client"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set global path for experiment"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"groupList = [\n",
" \"images/MOT_3D_Camera/in_situ_absorption\",\n",
" \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\",\n",
"]\n",
"\n",
"dskey = {\n",
" \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_0\",\n",
" \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_1\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
"}\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Evaporative Cooling"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + '2023/06/30'# get_date()\n",
"\n",
"# mongoDB = mongoClient[SequenceName]\n",
"\n",
"# DB = MongoDB(mongoClient, mongoDB, date=get_date())"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Check BEC"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The detected scaning axes and values are: \n",
"\n",
"{'compZ_current_sg': array([0.15 , 0.155, 0.16 , 0.165, 0.17 , 0.175, 0.18 , 0.185, 0.19 ,\n",
" 0.195, 0.2 , 0.205, 0.21 , 0.215, 0.22 , 0.225, 0.23 , 0.235,\n",
" 0.24 , 0.245]), 'runs': array([0., 1., 2.])}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHPCAYAAAAFwj37AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB0W0lEQVR4nO3deVxU5f4H8M8w7CiKioqCgvuCisuVNHGpXEtNrppWLqVxK8ula5mVmZWZP9P0pnbzVu6lRlhplmC5YJpmaVm5paIIuIOAIMtwfn88nYFhBhiY5ZwzfN6vl685nHNmzjOcAb88z/P9PjpJkiQQERERkSa4Kd0AIiIiIrIegzciIiIiDWHwRkRERKQhDN6IiIiINITBGxEREZGGMHgjIiIi0hAGb0REREQa4q50A7SiqKgIqampqFmzJnQ6ndLNISIiIhcjSRKysrLQqFEjuLmV3b/G4M1KqampCAkJUboZRERE5OKSk5MRHBxc5nEGb1a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Y2MrHj6XJNGLd+sWkJEhHktuHz3q2p81vV4EcNevi6HTBg2UbhERWUtVwVtmZiYAoEGp3yJBQUFwc3ODp6cnMjMzkZCQgBkzZhgDN0AEZTNmzMCWLVuMwVtsbCz0ej1iYmKM53l7e2PSpEl46aWXkJycjBAtj3tUQ2lp9j2PrFdQIII3wHHlQaxRq1bZw3xyL9mkScDPP4sCunJQVjpIu3VLJF/YSsuftfr1RfDGpAUibVFV8Na3b18sXLgQkyZNwrx581C3bl0cOHAA77//PqZOnQo/Pz/88MMPKCwsRLdu3Uye6+npiYiICBw9etS47+jRo2j
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"shotNum = \"0000\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"\n",
"dataSetDict = {\n",
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
" for i in [0]\n",
"}\n",
"\n",
"dataSet = dataSetDict[\"camera_0\"]\n",
"\n",
"print_scanAxis(dataSet)\n",
"\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"imageAnalyser.center = (880, 990)\n",
"imageAnalyser.span = (150, 200)\n",
"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",
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
"Ncount_mean = calculate_mean(Ncount)\n",
"Ncount_std = calculate_std(Ncount)\n",
"\n",
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='-ob')\n",
"plt.xlabel('comp Z current (A)')\n",
"plt.ylabel('NCount')\n",
"plt.tight_layout()\n",
"plt.grid(visible=1)\n",
"plt.show()\n",
"\n",
"# DB.create_global(shotNum, dataSet)\n",
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<xarray.plot.facetgrid.FacetGrid at 0x211ef7066a0>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAFJAAAAN0CAYAAABFVBb4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9e5heZXnv/w3MQIYwkQxmAgwwAQZMhNAYNRRjib1Ei0cUKYpWqYe6/Xlsa+uh1ordRdu6W+22Vbu1m+2u59p67AGlG2mlVcSIREosg2bQgSbIIJnAoBlZvz/W+uT5Ps+73pkcJiST3N/rmmtm3ncdntP3Pj33WveCqqoqBQKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQOWBy2vxsQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEJgZ8QLJQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgQMc8QLJQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgQMc8QLJQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAIBAKBQCAQCAQCgUAgEAgEAoFAIBAI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Rev/736+f/exnD0HLDw4EJ2dHcHLfcPLBBx/UH//xH+uUU07RwoULdfbZZ+vjH/94x3Ghf3cPwenZEZzeN5y+4oor9MxnPlPLli2LdbYLCK7OjuDq/uVqt73ihQsX7m1XD0oEp2dHcHruOb1p0ya94Q1v0OrVq9Xf36/jjz9eT3va03TDDTfsq27NewRXZ0dwdf9yNfTv7iE4PTuC03PP6TvuuEO/8iu/okc84hHq7+/XMccco7Vr1+rDH/6wqqraV12b1wiuzo7g6v7laujf3UNwenYEp/f9Pu9HP/pRLViwQEcfffRcdeOgQ3B1dgRX9y9XY/83EAgEAg81evZ3AwL7B3/913/d9bvLL79ct912m84555yHsEUHHu644w69/e1v1/Lly7V69er93Zx9iu3bt+sXf/EXde+99+p3fud31Nvbq3e/+91av369brzxRh177LEznv+xj31Mn/zkJ7VmzRqdcMIJs97v0ksv1VOf+tTss3PPPXev+nAwIng6O4Kn+5+nRx55pD70oQ9lnz3sYQ/bhR4dmghez47g9b7h9Y033qgnPOEJGhoa0utf/3ode+yxuv322/WDH/xgLrt0UCB4OjuCp/ufp6F/dw/B69kRvJ57Xl900UUaGRnp+Px3fud3tH37dj32sY/d674cTAiezo7g6f7naejf3UPwenYEr+ee19u3b9e5556r++67T6985St10kkn6dvf/rb+/M//XNdcc42++c1v6rDDoq4aCJ7OjuDp/udp6N/dQ/B6dgSv557XP/jBD3Tuuefq8MMP12//9m9r0aJFuvLKK/XkJz9Z//zP/6zzzjtvrrs2rxE8nR3B0/3P09C/e4/g+uwIru8a17/3ve/pNa95jZ74xCfqN3/zN7V48WJdddVVeuUrX6mvfe1r+vCHP/wQ9mT+Ijg5O4KT+4aTb3nLW/SHf/iH+rVf+zU99rGP1ec+9zk9//nP14IFC/S85z0vOzb0764jOD07gtP7htO/+7u/q+OOO06PetSjdNVVV+3rrs17BFdnR3D1wODq+9///uwB38MPP3zPO3oQIzg9O4LTc8/pD33oQ/qrv/orPec5z9ErX/lK3XvvvfrLv/xL/fzP/7z+6Z/+Seeff/5D0d15heDq7AiuHhhcDf27awhOz47g9Nxz+kc/+pF++MMf6uKLL9bJJ5+sHTt26Mtf/rJ+9Vd/Vd/97nf1jne846Ho7rxCcHV2BFcPDK6G/t01BKdnR3B63+7zbt++XW94wxu0aNGifdWtgwLB1dkRXN3/XI3930AgEAg8pKgCAcMHP/jBSlL1mte8Zn83JcOOHTuqn/zkJ63fbd++fZ/c8xvf+EYlqbryyiv3yfUPJPzRH/1RJam6/vrrd352yy23VIcffnj15je/edbzx8fHq5/+9KdVVVXV0572tGp4eLj1uO9///uVpOpd73rXnLT7UEXwNCF4un95etlll1WLFi3atQ4EZkTwOiF4Pfe8/tnPfladddZZ1TnnnFPdf//9c9L2QxHB04Tg6f7laejfuUPwOiF4Pfe8bsPtt99eLViwoPq1X/u13W73oYrgaULwdP/yNPTv3CF4nRC8nntef/SjH60kVV/84hezz3/v936vklRt2LBhzztxCCF4mhA83b88Df07dwheJwSv557Xr3zlK6uenp5q06ZNOz+77777qpNOOqlas2bN3nXiEELwNCF4un95Gvp33yK4nhBc3zWu33XXXdV3vvOdjs9f/OIXV5KqW2+9dc7beyghOJkQnJx7Tv7whz+sent7q1e96lU7P3vwwQerX/iFX6hOPPHEanp6eufnoX/nBsHphOD0vtGz3//+93eeJ6l629vettftPxQRXE0Iru5frr7tbW+rJFV33XXX7nUmkCE4nRCcnntO33DDDdXk5GR23I9+9KNq6dKl1bp16/ayF4cWgqsJwdX9y9XQv3OD4HRCcPqhizM//elPrxYtWpTFtAIzI7iaEFzdv1wN/Ts3CE4nBKf3Laff+MY3Vo94xCOqF7zgBbF3tAcIriYEV/cvV2P/NxAIBAIPNeIFknOAH/7wh9VLXvKS6vjjj6+OOOKIavny5dUrXvGKzJC77bbbqosvvrhasmRJ1dfXV51zzjkdD0ddc801laTqk5/8ZHX55ZdXJ5xwQnX00Ud
"text/plain": [
"<Figure size 6100x900 with 61 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dataSet_cropOD.plot.pcolormesh(cmap='jet', col=scanAxis[0], row=scanAxis[1], vmin=0, vmax=3)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"ename": "type",
"evalue": "name 'fitCurve' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[10], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m (fitCurve \u001b[39m-\u001b[39m dataSet_cropOD)\u001b[39m.\u001b[39mplot\u001b[39m.\u001b[39mpcolormesh(cmap\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mjet\u001b[39m\u001b[39m'\u001b[39m, col\u001b[39m=\u001b[39mscanAxis[\u001b[39m0\u001b[39m], row\u001b[39m=\u001b[39mscanAxis[\u001b[39m1\u001b[39m], vmin\u001b[39m=\u001b[39m\u001b[39m-\u001b[39m\u001b[39m0.1\u001b[39m, vmax\u001b[39m=\u001b[39m\u001b[39m0.1\u001b[39m)\n",
"\u001b[1;31mNameError\u001b[0m: name 'fitCurve' is not defined"
]
}
],
"source": [
"(fitCurve - dataSet_cropOD).plot.pcolormesh(cmap='jet', col=scanAxis[0], row=scanAxis[1], vmin=-0.1, vmax=0.1)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"data = dataSet_cropOD[3,0]\n",
"data.to_netcdf('test_data.nc')"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"with xr.open_dataarray('test_data.nc') as data:\n",
" data"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"x = np.linspace(500,649, 150)\n",
"y = np.linspace(800,999, 200)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"shape: (150, 200)\n",
"150\n",
"200\n",
"[500. 501. 502. 503. 504. 505. 506. 507. 508. 509. 510. 511. 512. 513.\n",
" 514. 515. 516. 517. 518. 519. 520. 521. 522. 523. 524. 525. 526. 527.\n",
" 528. 529. 530. 531. 532. 533. 534. 535. 536. 537. 538. 539. 540. 541.\n",
" 542. 543. 544. 545. 546. 547. 548. 549. 550. 551. 552. 553. 554. 555.\n",
" 556. 557. 558. 559. 560. 561. 562. 563. 564. 565. 566. 567. 568. 569.\n",
" 570. 571. 572. 573. 574. 575. 576. 577. 578. 579. 580. 581. 582. 583.\n",
" 584. 585. 586. 587. 588. 589. 590. 591. 592. 593. 594. 595. 596. 597.\n",
" 598. 599. 600. 601. 602. 603. 604. 605. 606. 607. 608. 609. 610. 611.\n",
" 612. 613. 614. 615. 616. 617. 618. 619. 620. 621. 622. 623. 624. 625.\n",
" 626. 627. 628. 629. 630. 631. 632. 633. 634. 635. 636. 637. 638. 639.\n",
" 640. 641. 642. 643. 644. 645. 646. 647. 648. 649.]\n",
"[800. 801. 802. 803. 804. 805. 806. 807. 808. 809. 810. 811. 812. 813.\n",
" 814. 815. 816. 817. 818. 819. 820. 821. 822. 823. 824. 825. 826. 827.\n",
" 828. 829. 830. 831. 832. 833. 834. 835. 836. 837. 838. 839. 840. 841.\n",
" 842. 843. 844. 845. 846. 847. 848. 849. 850. 851. 852. 853. 854. 855.\n",
" 856. 857. 858. 859. 860. 861. 862. 863. 864. 865. 866. 867. 868. 869.\n",
" 870. 871. 872. 873. 874. 875. 876. 877. 878. 879. 880. 881. 882. 883.\n",
" 884. 885. 886. 887. 888. 889. 890. 891. 892. 893. 894. 895. 896. 897.\n",
" 898. 899. 900. 901. 902. 903. 904. 905. 906. 907. 908. 909. 910. 911.\n",
" 912. 913. 914. 915. 916. 917. 918. 919. 920. 921. 922. 923. 924. 925.\n",
" 926. 927. 928. 929. 930. 931. 932. 933. 934. 935. 936. 937. 938. 939.\n",
" 940. 941. 942. 943. 944. 945. 946. 947. 948. 949. 950. 951. 952. 953.\n",
" 954. 955. 956. 957. 958. 959. 960. 961. 962. 963. 964. 965. 966. 967.\n",
" 968. 969. 970. 971. 972. 973. 974. 975. 976. 977. 978. 979. 980. 981.\n",
" 982. 983. 984. 985. 986. 987. 988. 989. 990. 991. 992. 993. 994. 995.\n",
" 996. 997. 998. 999.]\n",
"[69.53793103 96.44137931]\n",
"[570. 896.]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA3YAAAHQCAYAAADtd/hXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABxuElEQVR4nO3dd3gUVcPG4SeFNNLoBIi00KSDtFBCewOiAlIEpINERAQEBBExVMEXxQ4CKr1plCIYETBIL0JoogaBKCUiUhJKCknm+4Nv92XZTSUQNv5ur70wZ87MnpndnZ1n58wcB8MwDAEAAAAA7JZjbjcAAAAAAHBvCHYAAAAAYOcIdgAAAABg5wh2AAAAAGDnCHYAAAAAYOcIdgAAAABg5wh2AAAAAGDnCHYAAAAAYOcIdgAAAABg5x5IsFu4cKEcHBy0cOHCB/F0WfKwta158+ZycHDIdP0yZcqoTJky969Bdur7779XYGCgfH195eDgoI4dO+Z2k/Ks6OhoOTg4qF+/frndFPy/fv36ycHBQdHR0ZmeJzv7kokTJ8rBwUFbt27N0nxAWrL6HSg9fN/jd7p06ZIKFiyoIUOG5HZTHlrZec0dHBzUvHnzLM2Tnf0ikBU5sS86d+6c3N3d9frrr2dr/iwHOwcHB6uHq6urypQpo759++qXX37JVkOAnBIdHa0OHTro9OnTGjBggEJDQ9W9e/fcbhYeMNOX+J0PJycnFSpUSC1bttSyZctszlemTBmb+7k7H2nttDdt2qSePXuqbNmy8vDwkLu7uwICAtS7d2+Fh4ffx7W9Px7mA2Z7xo8hWbN161Y5ODho4sSJud2ULAsNDVV8fLzVQZrpR5E7H46OjvLx8VFgYKA+/vhjJScnW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LFqXbxTc7bYiLi9PIkSNVpkwZ5cuXL8Pui3d+fn/99Vfzr/f58+dXkyZN9P3339ucLzExUTNmzFD16tXl4eEhb29vNW3aVF988YXN+uvWrVOrVq3k5+dn7vYVFBSk2bNnW9S7ez/Xr18/tWjRQpI0adIki+1l2n+m12X4wIED6ty5s/k1L126tIYMGaKYmBirutndZ9liGIYWLFggf39/BQYGZno+SXrkkUdUqVIlSdbHU1m1c+dOzZ8/XwULFtTGjRvNy72Tk5OTevfuneZxVFquX78uFxcXNW7c2KI8Pj5ebm5ucnBw0JIlSyymzZkzRw4ODvr888/NZWl9tyUlJWnKlCkqX768XF1dVbZsWb3++us2j6vKlCmjSZMmSbL87k/rO/NeX9+0fP3113JwcFDDhg2tujMeO3ZMHh4eKlGihP7+++97fi6Tli1b6qmnnpKjo+UhffHixTV48GBJsuqe6uLiYlVfkvLly2e+J4GtY6LMSklJkb+/v7y9vXX9+nWbdV566SU5ODg8kLPE3377rc6ePauGDRuqRo0amZonO/tGW/uid999Vw4ODurcubNV/c2bN8vJyUnVq1dXfHy8xbTu3bvrxo0bWrlyZZbWNUfPsZq+HB977LFMz3Pr1i21adNG58+f1+OPPy5nZ2etWbNGr776qhISEiy6fErSCy+8oKpVq6pZs2by8/PTpUuX9O2336p379767bffrA56TDp37qz9+/fr8ccfV8eOHVW0aNE029SxY0ebB+5Hjx7V119/LQ8PD4vyAQMGaMGCBSpVqpQ6d+4sX19f7dmzRxMmTNCWLVu0adMmi9PZ7777rkaOHClfX1/16dNHvr6+2rhxowIDA3O0O9u6deu0fv16Pfnkkxo8eLB27dqlhQsXKjo6WtOnT1erVq3UtGlTDRw4UEePHtU333yjU6dO6ciRIxYf+Pnz52v16tUKCgpS69atlZq
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"y smaller x, 1d fit along y\n",
"\n",
"1d fit initialization\n",
"center = [69.53793103 96.44137931]\n",
"BEC widths: [23 7]\n",
"\n",
"1d init fit values\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.773 0 2.01 None True None None\n",
"amp_th 0.773 0 2.01 None True None None\n",
"deltax 21 0 200 None True None None\n",
"sigma_bec 5.738 0 14 None True None None\n",
"sigma_th 14.5 0 inf None False 0.632*sigma_bec + 0.518*deltax None\n",
"x0_bec 896 886 906 None True None None\n",
"x0_th 896 886 906 None True None None\n",
"1d fitted values\n",
"x0_bec: 896.208, (init = 896.000), bounds = [886.00 : 906.00] \n",
"x0_th: 897.042, (init = 896.000), bounds = [886.00 : 906.00] \n",
"amp_bec: 1.018, (init = 0.773), bounds = [0.00 : 2.01] \n",
"amp_th: 0.452, (init = 0.773), bounds = [0.00 : 2.01] \n",
"sigma_bec: 6.789, (init = 5.738), bounds = [0.00 : 14.00] \n",
"sigma_th: 15.283, (init = 14.504), bounds = [0.00 : inf] \n",
"\n"
]
},
{
"ename": "type",
"evalue": "x and y must have same first dimension, but have shapes (200,) and (30000,)",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[4], line 3\u001b[0m\n\u001b[0;32m 1\u001b[0m fitModel \u001b[39m=\u001b[39m DensityProfileBEC2dModel(is_debug\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n\u001b[0;32m 2\u001b[0m fitAnalyser_1 \u001b[39m=\u001b[39m FitAnalyser(fitModel, fitDim\u001b[39m=\u001b[39m\u001b[39m2\u001b[39m)\n\u001b[1;32m----> 3\u001b[0m params \u001b[39m=\u001b[39m fitAnalyser_1\u001b[39m.\u001b[39;49mguess(data, x\u001b[39m=\u001b[39;49mx, y\u001b[39m=\u001b[39;49my, dask\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mparallelized\u001b[39;49m\u001b[39m\"\u001b[39;49m, guess_kwargs\u001b[39m=\u001b[39;49m\u001b[39mdict\u001b[39;49m(pureBECThreshold\u001b[39m=\u001b[39;49m\u001b[39m1.2\u001b[39;49m))\n\u001b[0;32m 4\u001b[0m params\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\Analyser\\FitAnalyser.py:1060\u001b[0m, in \u001b[0;36mFitAnalyser.guess\u001b[1;34m(self, dataArray, x, y, guess_kwargs, input_core_dims, dask, vectorize, keep_attrs, daskKwargs, **kwargs)\u001b[0m\n\u001b[0;32m 1049\u001b[0m \u001b[39m# dataArray = dataArray.stack(_z=(kwargs[\"input_core_dims\"][0][0], kwargs[\"input_core_dims\"][0][1]))\u001b[39;00m\n\u001b[0;32m 1050\u001b[0m \n\u001b[0;32m 1051\u001b[0m \u001b[39m# kwargs[\"input_core_dims\"][0] = ['_z']\u001b[39;00m\n\u001b[0;32m 1053\u001b[0m guess_kwargs\u001b[39m.\u001b[39mupdate(\n\u001b[0;32m 1054\u001b[0m {\n\u001b[0;32m 1055\u001b[0m \u001b[39m'\u001b[39m\u001b[39mx\u001b[39m\u001b[39m'\u001b[39m:_x, \n\u001b[0;32m 1056\u001b[0m \u001b[39m'\u001b[39m\u001b[39my\u001b[39m\u001b[39m'\u001b[39m:_y,\n\u001b[0;32m 1057\u001b[0m }\n\u001b[0;32m 1058\u001b[0m )\n\u001b[1;32m-> 1060\u001b[0m \u001b[39mreturn\u001b[39;00m xr\u001b[39m.\u001b[39mapply_ufunc(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_guess_2D, dataArray, kwargs\u001b[39m=\u001b[39mguess_kwargs,\n\u001b[0;32m 1061\u001b[0m output_dtypes\u001b[39m=\u001b[39m[\u001b[39mtype\u001b[39m(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfitModel\u001b[39m.\u001b[39mmake_params())],\n\u001b[0;32m 1062\u001b[0m \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs\n\u001b[0;32m 1063\u001b[0m )\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\xarray\\core\\computation.py:1197\u001b[0m, in \u001b[0;36mapply_ufunc\u001b[1;34m(func, input_core_dims, output_core_dims, exclude_dims, vectorize, join, dataset_join, dataset_fill_value, keep_attrs, kwargs, dask, output_dtypes, output_sizes, meta, dask_gufunc_kwargs, *args)\u001b[0m\n\u001b[0;32m 1195\u001b[0m \u001b[39m# feed DataArray apply_variable_ufunc through apply_dataarray_vfunc\u001b[39;00m\n\u001b[0;32m 1196\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39many\u001b[39m(\u001b[39misinstance\u001b[39m(a, DataArray) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args):\n\u001b[1;32m-> 1197\u001b[0m \u001b[39mreturn\u001b[39;00m apply_dataarray_vfunc(\n\u001b[0;32m 1198\u001b[0m variables_vfunc,\n\u001b[0;32m 1199\u001b[0m \u001b[39m*\u001b[39;49margs,\n\u001b[0;32m 1200\u001b[0m signature\u001b[39m=\u001b[39;49msignature,\n\u001b[0;32m 1201\u001b[0m join\u001b[39m=\u001b[39;49mjoin,\n\u001b[0;32m 1202\u001b[0m exclude_dims\u001b[39m=\u001b[39;49mexclude_dims,\n\u001b[0;32m 1203\u001b[0m keep_attrs\u001b[39m=\u001b[39;49mkeep_attrs,\n\u001b[0;32m 1204\u001b[0m )\n\u001b[0;32m 1205\u001b[0m \u001b[39m# feed Variables directly through apply_variable_ufunc\u001b[39;00m\n\u001b[0;32m 1206\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39many\u001b[39m(\u001b[39misinstance\u001b[39m(a, Variable) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args):\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\xarray\\core\\computation.py:304\u001b[0m, in \u001b[0;36mapply_dataarray_vfunc\u001b[1;34m(func, signature, join, exclude_dims, keep_attrs, *args)\u001b[0m\n\u001b[0;32m 299\u001b[0m result_coords, result_indexes \u001b[39m=\u001b[39m build_output_coords_and_indexes(\n\u001b[0;32m 300\u001b[0m args, signature, exclude_dims, combine_attrs\u001b[39m=\u001b[39mkeep_attrs\n\u001b[0;32m 301\u001b[0m )\n\u001b[0;32m 303\u001b[0m data_vars \u001b[39m=\u001b[39m [\u001b[39mgetattr\u001b[39m(a, \u001b[39m\"\u001b[39m\u001b[39mvariable\u001b[39m\u001b[39m\"\u001b[39m, a) \u001b[39mfor\u001b[39;00m a \u001b[39min\u001b[39;00m args]\n\u001b[1;32m--> 304\u001b[0m result_var \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39;49mdata_vars)\n\u001b[0;32m 306\u001b[0m out: \u001b[39mtuple\u001b[39m[DataArray, \u001b[39m.\u001b[39m\u001b[39m.\u001b[39m\u001b[39m.\u001b[39m] \u001b[39m|\u001b[39m DataArray\n\u001b[0;32m 307\u001b[0m \u001b[39mif\u001b[39;00m signature\u001b[39m.\u001b[39mnum_outputs \u001b[39m>\u001b[39m \u001b[39m1\u001b[39m:\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\xarray\\core\\computation.py:761\u001b[0m, in \u001b[0;36mapply_variable_ufunc\u001b[1;34m(func, signature, exclude_dims, dask, output_dtypes, vectorize, keep_attrs, dask_gufunc_kwargs, *args)\u001b[0m\n\u001b[0;32m 756\u001b[0m \u001b[39mif\u001b[39;00m vectorize:\n\u001b[0;32m 757\u001b[0m func \u001b[39m=\u001b[39m _vectorize(\n\u001b[0;32m 758\u001b[0m func, signature, output_dtypes\u001b[39m=\u001b[39moutput_dtypes, exclude_dims\u001b[39m=\u001b[39mexclude_dims\n\u001b[0;32m 759\u001b[0m )\n\u001b[1;32m--> 761\u001b[0m result_data \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39;49minput_data)\n\u001b[0;32m 763\u001b[0m \u001b[39mif\u001b[39;00m signature\u001b[39m.\u001b[39mnum_outputs \u001b[39m==\u001b[39m \u001b[39m1\u001b[39m:\n\u001b[0;32m 764\u001b[0m result_data \u001b[39m=\u001b[39m (result_data,)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\numpy\\lib\\function_base.py:2372\u001b[0m, in \u001b[0;36mvectorize.__call__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 2369\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_init_stage_2(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[0;32m 2370\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\n\u001b[1;32m-> 2372\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_call_as_normal(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\numpy\\lib\\function_base.py:2365\u001b[0m, in \u001b[0;36mvectorize._call_as_normal\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 2362\u001b[0m vargs \u001b[39m=\u001b[39m [args[_i] \u001b[39mfor\u001b[39;00m _i \u001b[39min\u001b[39;00m inds]\n\u001b[0;32m 2363\u001b[0m vargs\u001b[39m.\u001b[39mextend([kwargs[_n] \u001b[39mfor\u001b[39;00m _n \u001b[39min\u001b[39;00m names])\n\u001b[1;32m-> 2365\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_vectorize_call(func\u001b[39m=\u001b[39;49mfunc, args\u001b[39m=\u001b[39;49mvargs)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\numpy\\lib\\function_base.py:2446\u001b[0m, in \u001b[0;36mvectorize._vectorize_call\u001b[1;34m(self, func, args)\u001b[0m\n\u001b[0;32m 2444\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Vectorized call to `func` over positional `args`.\"\"\"\u001b[39;00m\n\u001b[0;32m 2445\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39msignature \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m-> 2446\u001b[0m res \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_vectorize_call_with_signature(func, args)\n\u001b[0;32m 2447\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39mnot\u001b[39;00m args:\n\u001b[0;32m 2448\u001b[0m res \u001b[39m=\u001b[39m func()\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\numpy\\lib\\function_base.py:2486\u001b[0m, in \u001b[0;36mvectorize._vectorize_call_with_signature\u001b[1;34m(self, func, args)\u001b[0m\n\u001b[0;32m 2483\u001b[0m nout \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(output_core_dims)\n\u001b[0;32m 2485\u001b[0m \u001b[39mfor\u001b[39;00m index \u001b[39min\u001b[39;00m np\u001b[39m.\u001b[39mndindex(\u001b[39m*\u001b[39mbroadcast_shape):\n\u001b[1;32m-> 2486\u001b[0m results \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39;49m(arg[index] \u001b[39mfor\u001b[39;49;00m arg \u001b[39min\u001b[39;49;00m args))\n\u001b[0;32m 2488\u001b[0m n_results \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(results) \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(results, \u001b[39mtuple\u001b[39m) \u001b[39melse\u001b[39;00m \u001b[39m1\u001b[39m\n\u001b[0;32m 2490\u001b[0m \u001b[39mif\u001b[39;00m nout \u001b[39m!=\u001b[39m n_results:\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\Analyser\\FitAnalyser.py:950\u001b[0m, in \u001b[0;36mFitAnalyser._guess_2D\u001b[1;34m(self, data, x, y, **kwargs)\u001b[0m\n\u001b[0;32m 938\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Call the guess function of the 2D fit model to guess the initial value.\u001b[39;00m\n\u001b[0;32m 939\u001b[0m \u001b[39m\u001b[39;00m\n\u001b[0;32m 940\u001b[0m \u001b[39m:param data: The flattened data to fit\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 947\u001b[0m \u001b[39m:rtype: lmfit Parameters\u001b[39;00m\n\u001b[0;32m 948\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[0;32m 949\u001b[0m data \u001b[39m=\u001b[39m data\u001b[39m.\u001b[39mflatten(order\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mF\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m--> 950\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfitModel\u001b[39m.\u001b[39mguess(data\u001b[39m=\u001b[39mdata, x\u001b[39m=\u001b[39mx, y\u001b[39m=\u001b[39my, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\Analyser\\FitAnalyser.py:518\u001b[0m, in \u001b[0;36mDensityProfileBEC2dModel.guess\u001b[1;34m(self, data, x, y, pre_check, post_check, **kwargs)\u001b[0m\n\u001b[0;32m 515\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mprint_bval(res_1d)\n\u001b[0;32m 517\u001b[0m plt\u001b[39m.\u001b[39mplot(x_fit, X_guess, label\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39m1d int. data\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m--> 518\u001b[0m plt\u001b[39m.\u001b[39;49mplot(x_fit, density_1d(x,\u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mbval_1d), label\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39mbimodal fit\u001b[39;49m\u001b[39m'\u001b[39;49m)\n\u001b[0;32m 519\u001b[0m plt\u001b[39m.\u001b[39mplot(x_fit, thermal(x,x0\u001b[39m=\u001b[39mbval_1d[\u001b[39m'\u001b[39m\u001b[39mx0_th\u001b[39m\u001b[39m'\u001b[39m], amp\u001b[39m=\u001b[39mbval_1d[\u001b[39m'\u001b[39m\u001b[39mamp_th\u001b[39m\u001b[39m'\u001b[39m], sigma\u001b[39m=\u001b[39mbval_1d[\u001b[39m'\u001b[39m\u001b[39msigma_th\u001b[39m\u001b[39m'\u001b[39m]), label\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mthermal part\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[0;32m 520\u001b[0m plt\u001b[39m.\u001b[39mlegend()\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\matplotlib\\pyplot.py:2812\u001b[0m, in \u001b[0;36mplot\u001b[1;34m(scalex, scaley, data, *args, **kwargs)\u001b[0m\n\u001b[0;32m 2810\u001b[0m \u001b[39m@_copy_docstring_and_deprecators\u001b[39m(Axes\u001b[39m.\u001b[39mplot)\n\u001b[0;32m 2811\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mplot\u001b[39m(\u001b[39m*\u001b[39margs, scalex\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m, scaley\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m, data\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs):\n\u001b[1;32m-> 2812\u001b[0m \u001b[39mreturn\u001b[39;00m gca()\u001b[39m.\u001b[39mplot(\n\u001b[0;32m 2813\u001b[0m \u001b[39m*\u001b[39margs, scalex\u001b[39m=\u001b[39mscalex, scaley\u001b[39m=\u001b[39mscaley,\n\u001b[0;32m 2814\u001b[0m \u001b[39m*\u001b[39m\u001b[39m*\u001b[39m({\u001b[39m\"\u001b[39m\u001b[39mdata\u001b[39m\u001b[39m\"\u001b[39m: data} \u001b[39mif\u001b[39;00m data \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39melse\u001b[39;00m {}), \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\matplotlib\\axes\\_axes.py:1688\u001b[0m, in \u001b[0;36mAxes.plot\u001b[1;34m(self, scalex, scaley, data, *args, **kwargs)\u001b[0m\n\u001b[0;32m 1445\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[0;32m 1446\u001b[0m \u001b[39mPlot y versus x as lines and/or markers.\u001b[39;00m\n\u001b[0;32m 1447\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1685\u001b[0m \u001b[39m(``'green'``) or hex strings (``'#008000'``).\u001b[39;00m\n\u001b[0;32m 1686\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[0;32m 1687\u001b[0m kwargs \u001b[39m=\u001b[39m cbook\u001b[39m.\u001b[39mnormalize_kwargs(kwargs, mlines\u001b[39m.\u001b[39mLine2D)\n\u001b[1;32m-> 1688\u001b[0m lines \u001b[39m=\u001b[39m [\u001b[39m*\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_get_lines(\u001b[39m*\u001b[39margs, data\u001b[39m=\u001b[39mdata, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)]\n\u001b[0;32m 1689\u001b[0m \u001b[39mfor\u001b[39;00m line \u001b[39min\u001b[39;00m lines:\n\u001b[0;32m 1690\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39madd_line(line)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\matplotlib\\axes\\_base.py:311\u001b[0m, in \u001b[0;36m_process_plot_var_args.__call__\u001b[1;34m(self, data, *args, **kwargs)\u001b[0m\n\u001b[0;32m 309\u001b[0m this \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m args[\u001b[39m0\u001b[39m],\n\u001b[0;32m 310\u001b[0m args \u001b[39m=\u001b[39m args[\u001b[39m1\u001b[39m:]\n\u001b[1;32m--> 311\u001b[0m \u001b[39myield from\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_plot_args(\n\u001b[0;32m 312\u001b[0m this, kwargs, ambiguous_fmt_datakey\u001b[39m=\u001b[39;49mambiguous_fmt_datakey)\n",
"File \u001b[1;32mc:\\Users\\Jianshun Gao\\VisualCodeProjects\\analyseScript\\.venv\\lib\\site-packages\\matplotlib\\axes\\_base.py:504\u001b[0m, in \u001b[0;36m_process_plot_var_args._plot_args\u001b[1;34m(self, tup, kwargs, return_kwargs, ambiguous_fmt_datakey)\u001b[0m\n\u001b[0;32m 501\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39maxes\u001b[39m.\u001b[39myaxis\u001b[39m.\u001b[39mupdate_units(y)\n\u001b[0;32m 503\u001b[0m \u001b[39mif\u001b[39;00m x\u001b[39m.\u001b[39mshape[\u001b[39m0\u001b[39m] \u001b[39m!=\u001b[39m y\u001b[39m.\u001b[39mshape[\u001b[39m0\u001b[39m]:\n\u001b[1;32m--> 504\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mx and y must have same first dimension, but \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 505\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mhave shapes \u001b[39m\u001b[39m{\u001b[39;00mx\u001b[39m.\u001b[39mshape\u001b[39m}\u001b[39;00m\u001b[39m and \u001b[39m\u001b[39m{\u001b[39;00my\u001b[39m.\u001b[39mshape\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[0;32m 506\u001b[0m \u001b[39mif\u001b[39;00m x\u001b[39m.\u001b[39mndim \u001b[39m>\u001b[39m \u001b[39m2\u001b[39m \u001b[39mor\u001b[39;00m y\u001b[39m.\u001b[39mndim \u001b[39m>\u001b[39m \u001b[39m2\u001b[39m:\n\u001b[0;32m 507\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mx and y can be no greater than 2D, but have \u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 508\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mshapes \u001b[39m\u001b[39m{\u001b[39;00mx\u001b[39m.\u001b[39mshape\u001b[39m}\u001b[39;00m\u001b[39m and \u001b[39m\u001b[39m{\u001b[39;00my\u001b[39m.\u001b[39mshape\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m)\n",
"\u001b[1;31mValueError\u001b[0m: x and y must have same first dimension, but have shapes (200,) and (30000,)"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAikAAAGjCAYAAADpUIU9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABjx0lEQVR4nO3dd3hTZcMG8DtJ2yRdgdINZVP2klF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cNmvVW1NSSwmnIRFQ1hhQispp8rSF4eCoqL4lv1IT37yGiajCkEJHVGKcfe8prCim8fw8RVY0hhYisJl9bFlJqaklRGhd0Y0ghoooYUojIaoxjUrxqaElp6sGBs0RUNYYUIrIasSWlhpCi4v17iKgaDClEZDV5JnT3NOWdkImoGgwpRGQ1+SYMnPX1lAMArqs1NikTETkOhhQishpjd49XDS0prX3dARhm93BcChGVx5BCRFZzqyWl+sXc3N1cEKRSAACu3iiwSbmIyDEwpBCR1ZgyBRkA2vp5AADibuRbvUxE5DgYUojIavI0ZSvO1jAmBQDa+noCAOIy2ZJCRLcwpBCRVQiCgIJiHYCax6QAQBtfQ0tKPLt7iKgchhQisgpNiR46vQDAhJYUY3dPJrt7iOgWhhQisoq8spsLSiSAu5usxn3b+Rm6exJuForBhoiIIYWIrKL8GikSiaTGfYObKOHmIkVxqR4p2UW2KB4ROQCzQ0p+fj7mzp2LkSNHwsfHBxKJBKtXrzbp2D179uD5559HaGgo3N3d0bZtW7zwwgtIS0sztxh
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"\n",
"fitModel = DensityProfileBEC2dModel(is_debug=True)\n",
"fitAnalyser_1 = FitAnalyser(fitModel, fitDim=2)\n",
"params = fitAnalyser_1.guess(data, x=x, y=y, dask=\"parallelized\", guess_kwargs=dict(pureBECThreshold=1.2))\n",
"params"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"ename": "type",
"evalue": "name 'dataSet_cropOD' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data \u001b[39m=\u001b[39m dataSet_cropOD\u001b[39m.\u001b[39mchunk((\u001b[39m1\u001b[39m,\u001b[39m1\u001b[39m,\u001b[39m150\u001b[39m,\u001b[39m150\u001b[39m))\u001b[39m#.sel(runs = 0)\u001b[39;00m\n\u001b[0;32m 3\u001b[0m fitModel \u001b[39m=\u001b[39m DensityProfileBEC2dModel()\n\u001b[0;32m 4\u001b[0m fitAnalyser_1 \u001b[39m=\u001b[39m FitAnalyser(fitModel, fitDim\u001b[39m=\u001b[39m\u001b[39m2\u001b[39m)\n",
"\u001b[1;31mNameError\u001b[0m: name 'dataSet_cropOD' is not defined"
]
}
],
"source": [
"data = dataSet_cropOD.chunk((1,1,150,150))#.sel(runs = 0)\n",
"\n",
"fitModel = DensityProfileBEC2dModel()\n",
"fitAnalyser_1 = FitAnalyser(fitModel, fitDim=2)\n",
"\n",
"params = fitAnalyser_1.guess(data, dask=\"parallelized\", guess_kwargs=dict(pureBECThreshold=1.2))\n",
"\n",
"fitResult_1 = fitAnalyser_1.fit(data, params).load()\n",
"\n",
"fitCurve = fitAnalyser_1.eval(fitResult_1, x=np.arange(150), y=np.arange(150), dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"params.sel(runs=0, compZ_current_sg=0.2).item()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitResult_1 = fitAnalyser_1.fit(data.sel(runs=0, compZ_current_sg=0.2), params.sel(runs=0, compZ_current_sg=0.2)).load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitAnalyser_1.get_fit_full_result(fitResult_1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitCurve = fitAnalyser_1.eval(fitResult_1, x=np.arange(150), y=np.arange(150), dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<xarray.plot.facetgrid.FacetGrid at 0x1eb2ef34d00>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
},
{
"data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QceaDz++OOBP8ezzz5rtLa2GgcccMCg/Ybxhz/8wXj7299udHZ2Gm1tbcZ+++1nfOUrXyl+fuSRRxpHHnnkoO3OP//8sgfZ7YOXffnLXzb22GMPo76+3njmmWeKnRXPPfecceaZZxqdnZ3GvHnzitt+97vfNQ488EBjxIgRxpgxY4x3v/vdxquvvlp2vCOPPNLYd999jeeee854y1veYrS2thqTJ082Pv/5zxfLFP5fOL/CNpK3b99uLFy40Jg1a5bR0tJijB071jjssMOMRx99tKzc9773PWPvvfc2WlpajH333dd46KGHBv17VMPBBx9sHHzwwYPWH3PMMcbMmTMj7SvswHSbNm3yvNipBHJqIqcl5HS662dRclq4gN25c6exYcOGSOeQBnJtItcl5Hq662f//d//bUgy/uu//sswDPOlwGrduCWnJnJaQk6nu34WJafUvyXkmlzHUa1cuynclPrVr34V6ThRkVMTOS0hp9NDl/fKKfVvCbkm13FUK9df//rXDUnGk08+6br++eefj3SsKMipiZyWkNPprp9FySn1bwm5JtdxVCvX++23n+txLr30UkOS8dJLL0U6VhTk1EROS8jpdNfPouS01vWvG7JuIuslwznrBT/+8Y8NScaPf/zjpKcXGZk0kckSMumeya997WvF/3929957ryHJ+M1vflNcV8v6l0ybyHQJmQ6uZ2sxgCRZNZHVErKaPKuF/9erVq0yNmzYYOzevTvWecRBpk1kuoRMR7vOPfXUU42
"text/plain": [
"<Figure size 6100x900 with 61 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fitCurve.plot.pcolormesh(cmap='jet', col=scanAxis[0], row=scanAxis[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val = fitAnalyser_1.get_fit_value(fitResult_1)\n",
"std = fitAnalyser_1.get_fit_std(fitResult_1)\n",
"\n",
"data = val['condensate_fraction']\n",
"data_std = std['condensate_fraction']\n",
"\n",
"data.plot.errorbar(x=scanAxis[0], hue=scanAxis[1], fmt='o')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = data.sel(runs=[0, 1])\n",
"data_mean = calculate_mean(data)\n",
"data_std = calculate_std(data)\n",
"\n",
"data_mean.plot.errorbar(x=scanAxis[0], yerr=data_std, fmt='o')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val = fitAnalyser_1.get_fit_value(fitResult_1)\n",
"std = fitAnalyser_1.get_fit_std(fitResult_1)\n",
"\n",
"data = val['BEC_amplitude']\n",
"data_std = std['BEC_amplitude']\n",
"\n",
"data.plot.errorbar(x=scanAxis[0], hue=scanAxis[1], fmt='o')\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Check BEC"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"shotNum = \"0001\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"\n",
"dataSetDict = {\n",
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
" for i in [0]\n",
"}\n",
"\n",
"dataSet = dataSetDict[\"camera_0\"]\n",
"\n",
"print_scanAxis(dataSet)\n",
"\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"imageAnalyser.center = (880, 990)\n",
"imageAnalyser.span = (150, 150)\n",
"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",
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
"Ncount_mean = calculate_mean(Ncount)\n",
"Ncount_std = calculate_std(Ncount)\n",
"\n",
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='-ob')\n",
"plt.xlabel('comp Z current (A)')\n",
"plt.ylabel('NCount')\n",
"plt.tight_layout()\n",
"plt.grid(visible=1)\n",
"plt.show()\n",
"\n",
"# DB.create_global(shotNum, dataSet)\n",
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dataSet_cropOD.plot.pcolormesh(cmap='jet', col=scanAxis[0], row=scanAxis[1], vmin=0, vmax=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"dataSet_cropOD.chunk((1,1,150,150))#.sel(runs = 0)\n",
"\n",
"fitModel = DensityProfileBEC2dModel()\n",
"fitAnalyser_1 = FitAnalyser(fitModel, fitDim=2)\n",
"\n",
"params = fitAnalyser_1.guess(data, dask=\"parallelized\", guess_kwargs=dict(pureBECThreshold=1.2))\n",
"\n",
"# fitResult_1 = fitAnalyser_1.fit(data, params).load()\n",
"\n",
"# fitCurve = fitAnalyser.eval(fitResult, x=np.range(150), y=np.range(150), dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"params.sel(runs=0, compZ_current_sg=0.195).item()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitResult_1 = fitAnalyser_1.fit(data.sel(runs=0, compZ_current_sg=0.195), params.sel(runs=0, compZ_current_sg=0.195)).load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitAnalyser_1.get_fit_full_result(fitResult_1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitCurve = fitAnalyser_1.eval(fitResult_1, x=np.arange(150), y=np.arange(150), dask=\"parallelized\").load()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitCurve.plot.pcolormesh(cmap='jet', col=scanAxis[0], row=scanAxis[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val = fitAnalyser_1.get_fit_value(fitResult_1)\n",
"std = fitAnalyser_1.get_fit_std(fitResult_1)\n",
"\n",
"data = val['condensate_fraction']\n",
"data_std = std['condensate_fraction']\n",
"\n",
"data.plot.errorbar(x=scanAxis[0], hue=scanAxis[1], fmt='o')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"data = data.sel(runs=[0, 1])\n",
"data_mean = calculate_mean(data)\n",
"data_std = calculate_std(data)\n",
"\n",
"data_mean.plot.errorbar(x=scanAxis[0], yerr=data_std, fmt='o')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fitAnalyser_1.get_fit_full_result(fitResult_1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val = fitAnalyser_1.get_fit_value(fitResult_1)\n",
"std = fitAnalyser_1.get_fit_std(fitResult_1)\n",
"\n",
"data = val['BEC_amplitude']\n",
"data_std = std['BEC_amplitude']\n",
"\n",
"data.plot.errorbar(x=scanAxis[0], hue=scanAxis[1], fmt='o')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"val = fitAnalyser_1.get_fit_value(fitResult_1)\n",
"std = fitAnalyser_1.get_fit_std(fitResult_1)\n",
"\n",
"data = val['BEC_amplitude'].mean('runs')* 146.59032426564943 / 1e5\n",
"data_std = val['BEC_amplitude'].std('runs')* 146.59032426564943 / 1e5\n",
"\n",
"data.plot.errorbar(yerr=data_std, fmt='o')\n",
"\n",
"plt.ylabel('Atom number in BEC (1e5)')\n",
"plt.xlabel('comp Z current (A)')\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"1 / 8.4743e-14 /0.5 / 2.3513**2 * 5.86e-6**2 "
]
},
{
"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": []
},
{
"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": []
},
{
"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": []
},
{
"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": []
},
{
"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": []
},
{
"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": [
"%matplotlib notebook\n",
"shotNum = \"0024\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"\n",
"dataSetDict = {\n",
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
" for i in [0]\n",
"}\n",
"\n",
"dataSet = dataSetDict[\"camera_0\"]\n",
"\n",
"print_scanAxis(dataSet)\n",
"\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"imageAnalyser.center = (135, 990)\n",
"imageAnalyser.span = (250, 250)\n",
"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",
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
"Ncount_mean = calculate_mean(Ncount)\n",
"Ncount_std = calculate_std(Ncount)\n",
"\n",
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
"\n",
"plt.ylabel('NCount')\n",
"plt.tight_layout()\n",
"#plt.ylim([0, 3500])\n",
"plt.grid(visible=1)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"l = list(np.arange(0.15, 0.25, 0.005))\n",
"# l = np.logspace(np.log10(250e-6), np.log10(500e-3), num=15)\n",
"\n",
"l = [round(item, 7) for item in l]\n",
"random.shuffle(l)\n",
"\n",
"print(l)\n",
"print(len(l))\n",
"np.mean(l)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"[10.25, 10.255, 10.26, 10.265, 10.27, 10.275, 10.28, 10.285, 10.29, 10.295, 10.3, 10.305, 10.31, 10.315, 10.32, 10.325, 10.33, 10.335, 10.34, 10.345, 10.35, 10.355]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pixel = 5.86e-6\n",
"M = 0.6827\n",
"F = (1/(0.3725*8.4743e-14)) * (pixel / M)**2\n",
"NCount = 85000\n",
"AtomNumber = NCount * F / 1e8\n",
"print(AtomNumber)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"muB = 9.274e-24\n",
"hbar = 6.626e-34 / (2 * np.pi)\n",
"gJ = 1.24\n",
"Delta = 2 * np.pi * 100 * 1e3\n",
"\n",
"Bz = (Delta*hbar) / (muB*gJ)\n",
"print(Bz * 1e4)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## ODT 1 Calibration"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"v_high = 2.7\n",
"\"\"\"High Power\"\"\"\n",
"P_arm1_high = 5.776 * v_high - 0.683\n",
"\n",
"v_mid = 0.2076\n",
"\"\"\"Intermediate Power\"\"\"\n",
"P_arm1_mid = 5.815 * v_mid - 0.03651\n",
"\n",
"v_low = 0.0587\n",
"\"\"\"Low Power\"\"\"\n",
"P_arm1_low = 5271 * v_low - 27.5\n",
"\n",
"print(round(P_arm1_high, 3))\n",
"print(round(P_arm1_mid, 3))\n",
"print(round(P_arm1_low, 3))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## ODT 2 Power Calibration"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"v = 0.7607\n",
"P_arm2 = 2.302 * v - 0.06452\n",
"print(round(P_arm2, 3))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
},
"vscode": {
"interpreter": {
"hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}