analyseScript/Joschka/Parameter_guessing_comp.ipynb

437 lines
825 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"outputs": [],
"source": [
"import xarray as xr\n",
"import pandas as pd\n",
"import numpy as np\n",
"import copy\n",
"\n",
"import glob\n",
"\n",
"import xrft\n",
"import finufft\n",
"\n",
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
"from datetime import datetime\n",
"\n",
"import matplotlib.pyplot as plt\n",
"\n",
"\n",
"plt.rcParams['font.size'] = 18\n",
"\n",
"from scipy.ndimage import gaussian_filter\n",
"import matplotlib as mpl\n",
"from scipy.optimize import curve_fit\n",
"mpl.rc('xtick', labelsize=8)\n",
"mpl.rc('ytick', labelsize=8)\n",
"\n",
"from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
"from Analyser.FitAnalyser import FitAnalyser\n",
"from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
"from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
"from ToolFunction.ToolFunction import *\n",
"\n",
"import time\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",
"\n",
"\n",
"\n",
"#dataSet"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:09:57.820003800Z",
"start_time": "2023-07-19T14:09:56.001606300Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Some functions"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 2,
"outputs": [],
"source": [
"# get center of thresholded image\n",
"\n",
"def calc_cen(thresh1):\n",
" \"\"\"\n",
" returns array: [Y_center,X_center]\n",
" \"\"\"\n",
" cen = np.zeros(2)\n",
" (Y,X) = np.shape(thresh1)\n",
"\n",
"\n",
" thresh1 = thresh1 /np.sum(thresh1)\n",
"\n",
" # marginal distributions\n",
" dx = np.sum(thresh1, 0)\n",
" dy = np.sum(thresh1, 1)\n",
"\n",
" # expected values\n",
" cen[0] = np.sum(dx * np.arange(X))\n",
" cen[1] = np.sum(dy * np.arange(Y))\n",
" return cen\n",
"\n",
"def calc_cen_bulk(thresh):\n",
" \"\"\"\n",
" returns array in shape of input, containing array with [Y_center,X_center] for each image\n",
" \"\"\"\n",
" shape = np.shape(thresh)\n",
" cen = np.zeros((shape[0], shape[1], 2))\n",
" for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" cen[i,j] = calc_cen(thresh[i,j])\n",
" return cen\n",
"\n",
"def guess_BEC_width(thresh, center):\n",
" \"\"\"\n",
" returns width of thresholded area along both axis through the center with shape of thresh and [X_width, Y_width] for each image\n",
" \"\"\"\n",
" shape = np.shape(thresh)\n",
" BEC_width_guess = np.zeros((shape[0], shape[1], 2))\n",
"\n",
" for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" BEC_width_guess[i, j, 0] = np.sum(thresh[i, j, round(center[i,j,1]), :])\n",
" BEC_width_guess[i, j, 1] = np.sum(thresh[i, j, :, round(center[i,j,0])])\n",
"\n",
" return BEC_width_guess\n",
"\n",
"\n",
"\n",
"def gaussian(x, x0, sigma, A):\n",
" return A * np.exp(-0.5 * (x-x0)**2 / sigma**2)\n",
"\n",
"def polylog(power, numerator, order = 15):\n",
"\n",
" dataShape = numerator.shape\n",
" numerator = np.tile(numerator, (order, 1))\n",
" numerator = np.power(numerator.T, np.arange(1, order+1)).T\n",
"\n",
" denominator = np.arange(1, order+1)\n",
" denominator = np.tile(denominator, (dataShape[0], 1))\n",
" denominator = denominator.T\n",
"\n",
" data = numerator/ np.power(denominator, power)\n",
"\n",
" return np.sum(data, axis=0)\n",
"\n",
"def thermal(x, x0, amp, sigma, order = 15):\n",
" res = np.exp(-0.5 * (x-x0)**2 / sigma**2)\n",
" return amp * polylog(2, res, order)\n",
"\n",
"def Thomas_Fermi_1d(x, x0, amp, sigma):\n",
" res = (1-(( x - x0 ) / sigma) **2) **3/2\n",
" return amp * np.where(res > 0, res, 0)\n",
"\n",
"def density_1d(x, x0_bec, x0_th, amp_bec, amp_th, sigma_bec, sigma_th, polyorder=15):\n",
" return thermal(x, x0_th, amp_th, sigma_th, polyorder) + Thomas_Fermi_1d(x, x0_bec, amp_bec, sigma_bec)\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:09:59.764265200Z",
"start_time": "2023-07-19T14:09:59.697445300Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Import Data"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [],
"source": [
"\n",
"# import data\n",
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + '2023/04/17'# get_date()\n",
"\n",
"\n",
"shotNum = \"import\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"dataSet = read_hdf5_file(filePath, \"images/MOT_3D_Camera/in_situ_absorption\")\n",
"dataSet = swap_xy(dataSet)\n",
"\n",
"# get the scan axis name of the shot\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"# calculate the absorption imaging\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"dataSet\n",
"OD = dataSet[\"OD\"]\n",
"OD_np = OD.to_numpy()\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:10:07.730652800Z",
"start_time": "2023-07-19T14:10:05.350091900Z"
}
}
},
{
"cell_type": "code",
"execution_count": 4,
"outputs": [
{
"data": {
"text/plain": "<Figure size 700x1500 with 11 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAqQAAAXcCAYAAAD0kJyLAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9f3yWV33//wzc2IY2FFIKUkCCC0q+GlYig2HakX6Ms2zLJljBFjtwxVmmTFu7flXmbjOtdV1b7Jc5qqOfwmqL1Ap+zD6japQgyxBkoKRb6ogjGCgF06RN2qaVwP3947zf13mf674Tghaw7Xk9Hnnkuu7r17nOdc77vM771ynK5XI5IiIiIiIiIiIiIs4Thp3vAkRERERERERERLy2EQlpRERERERERETEeUUkpBEREREREREREecVkZBGREREREREREScV0RCGhERERERERERcV4RCWlERERERERERMR5RSSkERERERERERER5xWRkEZERERERERERJxXREIaERERERERERFxXhEJaURERERERERExHlFJKQRERERERERZw2PPPIIGzZsON/FiPgNR1Fcyz4iIiIiIiLibOHyyy/nqaee4tSpU+e7KBG/wcic7wJEREREREREvLLQ1tbGhg0bePzxx+np6RmUbHZ1dQFw9dVXJ78tW7aMpUuXnvVyRrxyEAlpRERERERExJCxe/duampqePHFFykqKhrydT/4wQ8AyOVy1NTUnKXSRbxSEQlpRERERERExJBxxx138NJLLzFt2jT+4A/+gNGjRw9KTO+66y6ee+45stls8lskpBFpRB/SiIiIiIiIiCHj8ssv5/jx4/z85z/n8ssvH9L50Yc04nSIUfYRERERERERQ8bTTz/NZZddNiQyGhExVERCGhERERERETFk9Pf3c+GFF57vYkS8yhAJaURERERERMSQcSaBTL/K+RGvTcSgpoiIiIiIiIgh43/+53/IZIZOH3bv3s3JkyfPYokiXg2IQU0RERERERERERHnFdFkHxERERERERERcV4RTfYRERERERERQ8awYb+aLiumfYoYDJGQRkRERERERAwZw4YN40y9/aJ3YMTpEAlpRERERERExJDx/e9/f8BjJ0+e5Pjx4zQ3N/Pggw9y8uRJVq9ezbRp085hCSNeiYhBTREREREREREvO44ePco73vEOurq6aGlp4bLLLjvfRYr4DUYMaoqIiIiIiIh42TFhwgTWrl3LL37xC+64447zXZyI33BEDWlERERERETEWcNFF13EpEmT+OlPf3q+ixLxG4yoIY2IiIiIiIg4axgxYgSHDx8+38WI+A1HDGqKiIiIiIiIOCtoa2vjueeeiymfIk6LaLKPiIiIiIiIiIg4r4gm+4iIiIiIiIiIiPOKaLKPiIiIiIiIOGMcOHCARx55hJ/85Cd0d3fT398/4Lm5XI6mpqZzV7iIVxwiIY2IiIiIiIg4I3zmM5/hc5/7HKdOnaKoqOi050fvwIjTIRLSiIiIiIiIiCHj4Ycf5rOf/SwAY8eO5V3veheTJ0/mwgsvPM8li3glIxLSiIiIiIiIiCHjS1/6Erlcjrq6Or72ta9RXFx8vosU8SpAjLKPiIiIiIiIGDJGjRrFc889R0dHBxMnTjzfxYl4lSAS0oiIiIiIiIgh45JLLmHYsGF0d3ef76JEvIoQ0z5FREREREREDBkVFRU8//zzvPjii+e7KBGvIkRCGhERERERETFkLF++nJMnT7Jp06bzXZSIVxGiyT4iIiIiIiLijHDttdfS2NjI5s2b+V//63+d7+JEvAoQCWlERERERETEkFFfX8/JkydZu3YtTz/9NHPnzmXOnDlccsklg16XzWbPUQkjXomIhDQiIiIiIiJiyBg+fDi5XC5JiD9UGnHq1KmzWayIVzhiHtKIiIiIiIiIIaOmpiauvBTxsiNqSCMiIiIiIiIiIs4rYpR9RERERERERETEeUUkpBEREREREREREecVkZBGREREREREREScV8SgpoiIiIiIiIgh4+qrrz7ja3K5HE1NTS9/YSJeNYhBTRERERERERFDxvDhw097jlILmxoqpn2KGAxRQxoRERERERExZJwuwX1vby+7du2iubmZ0aNH85GPfGRIJDbitY2oIY2IOEP88pe/5B/+4R/YuHEj//3f/83JkyeZOnUqCxcu5NZbb6WkpOTXun9vby9333033/jGNzh48CDDhw/nTW96E+973/tYuXIlr3vd616mN4mIeHWiv7+f7du3s3fvXv7jP/6DvXv30tbWRi6XY+nSpaxfv/5leU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f+AS33HILY8eOpaenh7vvvpu//du/Zdu2bWzYsIE/+7M/S645dOgQ9fX1ANxyyy18/OMf5/LLLwfg2WefpaWlhY0bN/7akelnG08//TRPPfUUwKCCVY+dOnWK1tZWqqqqhnT/1tbWJEffUO7/1FNP0dXVRWlp6ZDuH/GbgdhXX/mIfZWknQyE/v5+nnzySb797W/z5JNPAvDhD3/4XBQt4hWMSEhfBXjuuef41re+RV1dXfLbpZde+rI/55lnniGbzfKZz3wm+W3UqFHU19fz+OOPs3nzZjZu3BgMcrt27eLUqVO86U1v4u677w7ud8kll3DllVdy5ZVXnnFZBouiHQrS73E6qFAFmDhx4oDn2WNPPvnkkAnpr3r/V9Mg91pA7KtnjjPtq2cbsa86TfpQTPBFRUUMHz6cv/7rv2bJkiXnoGQRr2REQvoqwFve8pZggDtbuOCCC7j11lsLHvuTP/kTNm/enGfOGz16NODy9T3//PNcdNFFL0tZhg8fzvjx43/l6y+++OIzOr+3tzfZHjly5IDn2WP2mvN9/4jfDMS+euY40756thH7qvOJHoyQjhgxgtLSUmbMmMGiRYv4rd/6rXNYuohXKiIhfRWgurr6nDznLW95y4CDg5r20gEPs2fPZuz
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"imageAnalyser.center = (960, 890)\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",
"cropOD = dataSet_cropOD.to_numpy()\n",
"dataSet_cropOD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[1], row=scanAxis[0])\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:10:10.343320700Z",
"start_time": "2023-07-19T14:10:07.733644900Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Guess center\n",
"\n",
"ToDo: Crop from center guess"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 5,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"fitting time: 133.1346035003662 ms\n"
]
}
],
"source": [
"# from opencv import moments\n",
"shape = np.shape(cropOD)\n",
"sigma = 0.4\n",
"blurred = gaussian_filter(cropOD, sigma=sigma)\n",
"\n",
"thresh = np.zeros(shape)\n",
"for i in range(0,shape[0]):\n",
" for j in range(0, shape[1]):\n",
" thresh[i,j] = np.where(blurred[i,j] < np.max(blurred[i,j])*0.5,0,1)\n",
"\n",
"center = calc_cen_bulk(thresh)\n",
"\n",
"BEC_width_guess = guess_BEC_width(thresh, center)\n",
"\n",
"X_guess_og = np.zeros((shape[0], shape[1], shape[3]))\n",
"# Y_guess_og = np.zeros((shape[0], shape[1], shape[2]))\n",
"\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" X_guess_og[i,j] = np.sum(cropOD[i,j,round(center[i,j,1] - BEC_width_guess[i,j,1]/2) : round(center[i,j,1] + BEC_width_guess[i,j,1]/2) , :], 0) / len(cropOD[i,j,round(center[i,j,1] - BEC_width_guess[i,j,1]/2) : round(center[i,j,1] + BEC_width_guess[i,j,1]/2),0])\n",
"\n",
" # Y_guess_og[i,j] = np.sum(cropOD[i,j, :, round(center[i,j,0] - BEC_width_guess[i,j,0]/2) : round(center[i,j,0] + BEC_width_guess[i,j,0]/2)], 1) / len(cropOD[i,j,0,round(center[i,j,0] - BEC_width_guess[i,j,0]/2) : round(center[i,j,0] + BEC_width_guess[i,j,0]/2)])\n",
"\n",
"#[nr images x, nr images y, X / Y, center / sigma]\n",
"x = np.linspace(0,149,150)\n",
"y = np.linspace(0,199, 200)\n",
"\n",
"popt = np.zeros((shape[0], shape[1], 6))\n",
"\n",
"p0 = np.ones((shape[0], shape[1], 6))\n",
"\n",
"max = np.zeros((shape[0], shape[1]))\n",
"\n",
"for i in range(0, shape[0]):\n",
" max[i] = np.ndarray.max(X_guess_og[i],axis=1)\n",
"\n",
"\n",
"p0[:, :, 0] = center[:, :, 0] # center BEC\n",
"p0[:, :, 1] = center[:, :, 0] # center th\n",
"p0[:, :, 2] = 0.7 * max # amp BEC\n",
"p0[:, :, 3] = 0.3 * max # amp th\n",
"p0[:, :, 4] = BEC_width_guess[:, :, 0] / 1.22 # sigma BEC\n",
"p0[:, :, 5] = BEC_width_guess[:, :, 0] * 3 # sigma th\n",
"\n",
"start = time.time()\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" popt[i,j], pcov = curve_fit(density_1d, x, X_guess_og[i,j] , p0[i, j], nan_policy='omit')\n",
"stop = time.time()\n",
"\n",
"print(f'fitting time: {(stop-start)*1e3} ms')"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:10:14.430793Z",
"start_time": "2023-07-19T14:10:14.234569Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Bimodal 1d Fit"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 9,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1500x1000 with 10 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAABMMAAAMpCAYAAAAJkfRRAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9eZxc1X3n/7/urb2qV+1bt4QktAJqCYRtmWCMN9lmSSCxcYIdOcZS7K8zv5iZATPYM+MkDiQziYfYcawJNhmCYydmcYjj3RiCjTCSQCAkQGurW2tr6a327f7+OLdK3aiX6lZ3123p/Xw86kF11a2q07Zu173v+zmfYzmO4yAiIiIiIiIiInIRsKs9ABERERERERERkYmiMExERERERERERC4aCsNEREREREREROSioTBMREREREREREQuGgrDRERERERERETkoqEwTERERERERERELhoKw0RERERERERE5KLhr/YARqJYLHL06FFqa2uxLKvawxHxHMdx6O3tZc6cO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/AO+yXySRedPKkyJSdSm3MuwSy4Rh8UYzvYoj26o1JBEZDbcy7LgzhSPONABqszqZFvG6+oJpru2rn0NjLFDuGeYoDBOZVJLZPHWWG4bVTMEXNWFYTbGXXKFYzaFJhRSGybD6riaZzBYgfrJcRfKvicsBWDAtZjZYuh6Aa+xXyaQ0TVLEa0orws53w7DDTTeaJ1QZJjKp/Md2M7X5mDMFolMAiOY1NUPEy9K5ArWOOT4O1U6hMRrklDtNshhXGCYymaSyBepIAhCINuK
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fsize=(15,10)\n",
"vmax = 1.5\n",
"fig, ax = plt.subplots(shape[0],shape[1],figsize=fsize)\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" lab = f\"A$_{{BEC}}$ = {popt[i,j,0]:.1f} \\n A$_{{th}}$ = {popt[i,j,1]:.1f} \"\n",
" ax[i,j].plot(x, X_guess_og[i,j])\n",
" ax[i,j].plot(x, density_1d(x, *popt[i,j]), label = lab)\n",
" ax[i,j].plot(x, thermal(x, popt[i,j,1], popt[i,j, 3], popt[i,j, 5]))\n",
"\n",
"\n",
" #ax[i,j].legend(fontsize=10)\n",
" ax[i,j].set_facecolor('#FFFFFF')\n",
"plt.show()\n",
"\n",
"# fig, ax = plt.subplots(shape[0],shape[1],figsize=fsize)\n",
"# for i in range(0,shape[0]):\n",
"# for j in range(0,shape[1]):\n",
"# ax[i][j].pcolormesh(cropOD[i][j], cmap='jet', vmin=0, vmax=vmax)\n",
"# #ax[i][j].plot(max[i,j,1],max[i,j,0], marker='x', markersize=12)\n",
"# ax[i][j].plot(center[i,j,0],center[i,j,1], marker='x', color='g', markersize=12)\n",
"# plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:11:19.303385Z",
"start_time": "2023-07-19T14:11:17.704358600Z"
}
}
},
{
"cell_type": "code",
"execution_count": 11,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[76.98612316 76.98612316 0.22849011 0.09792433 24.59016393 90. ]\n",
"[ 7.54164943e+01 7.71704306e+01 7.15133560e-02 1.76207641e-01\n",
" 1.30666164e+01 -3.38844382e+01]\n",
"\n"
]
}
],
"source": [
"for i in range(0,1):\n",
" for j in range(0,1):\n",
" print(p0[i,j])\n",
" print(popt[i,j])\n",
" print(\"\")"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:13:10.622384700Z",
"start_time": "2023-07-19T14:13:10.578499800Z"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}