analyseScript/Joschka/Parameter guessing.ipynb

960 lines
2.3 MiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"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
}
},
{
"cell_type": "markdown",
"source": [
"## Some functions"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 253,
"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",
"\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-19T12:36:06.445703Z",
"start_time": "2023-07-19T12:36:06.423639600Z"
}
}
},
{
"cell_type": "code",
"execution_count": 252,
"outputs": [
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGZCAYAAAApXFOJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA7a0lEQVR4nO3de3jUd533/9cckklCkgkBAgmZECAEyikhJdjS1mrd1v6qtm5Z23pvrWhbcKvrent7t8tv9fLu3q6t1666bt1a1C6r4nb7s1TLtura2nNpLedDgJIEQiYkEE7J5DjJZL6/P2a+A5QAmTAz3zk8H9eV6+LwzeT9zSSZVz6f9+fzsRmGYQgAACBB7FYXAAAAMgvhAwAAJBThAwAAJBThAwAAJBThAwAAJBThAwAAJBThAwAAJBThAwAAJJTT6gLeLxgMqr29XQUFBbLZbFaXAwAAxsAwDPX09KisrEx2+8XHNpIufLS3t8vj8VhdBgAAGAev16vy8vKLXpN04aOgoEBSqPjCwkKLqwEAAGPh8/nk8Xgir+MXk3Thw5xqKSwsJHwAAJBixtIyQcMpAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIKMIHAABIqKjDR2Njo5YvX67q6mrV19eroaHhvGteffVV5ebmqra2NvI2MDAQk4IBAEBqi/psl9WrV2vVqlVauXKlnnnmGa1cuVKbN28+77q5c+dqx44dsagRAACkkajCR2dnp7Zs2aI//OEPkqQVK1boS1/6kpqamlRVVTWuAvx+v/x+f+TvPp9vXI8DIHkNjwT1VtMJNbT71NU/pKK8bC2pKNLSGcXKdjL7C2SaqMKH1+tVaWmpnM7Qu9lsNlVUVKi1tfW88NHc3Ky6ujo5HA597nOf0wMPPDDqYz7yyCN6+OGHx1k+gGQ2FAjq3zcd0hOvHdSpvqHz/r+kwKW/+tBsfea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rb46MLplpcyYWdPfXy3w3HLK4GwFgRPgCcZ3B4RK++d1yS9NEF0yyu5uJuCtf38v5ONhwDUgThA8B53mg8of6hEZW5c7Routvqci7qyhkTVTwhW90Dw9rccsrqcgCMAeEDwHnMKZebFkxLulUu7+ew23TDvNBZLy/uZeoFSAWEDwDnCIwE9cd9oRfxm5K43+NsN84P1fni3mMyDMPiagBcCuEDwDk2t5zW6f5hTczL0rIkOcvlUq6bM1kup11tpwe0/2iP1eUAuATCB4BzvLw/NOrx4XklcjpS40dEXrZT182ZLEl6iakXIOmlxk8WAAljrnL58NwSiyuJjjn18tI+wgeQ7AgfACLaTversbNXdpv0wTlTrC4nKmZY2nWkWyd7/RZXA+BiCB8AIsxRj7qKiXLnZVlcTXRKCnN0RWmhDEN6s4mD5oBkRvgAEBGZcpmXWlMupuurQ6M1r4XvA0ByInwAkCT5AyPaFD5IznwRTzUfmhsOHweOKxhkyS2QrAgfACRJmw+dVv/QiKYUuLSgrNDqcsalrmKi8l1OnewbUkO7z+pyAFwA4QOAJOmV8KmwH6qekvS7ml5IttOu5bMnSZJeO8Apt0CyInwAkKTIkfQfSrEltu9n1v8qfR9A0iJ8AFDb6X41H++Tw27TteHNulLV9eG+j22tp9XdP2xxNQBGQ/gAoE1NJyVJi8vdcuem1hLb95telKs5JfkKsuQWSFqEDwB6K7zK5ZrZqT3qYfpgeLUO4QNIToQPIMMZhqFNzaGRj+VVkyyuJjauCd+HuXQYQHIhfAAZrrGzV8d7/MrJsquuYqLV5cTEspmT5LDbdPhkv9pO91tdDoD3IXwAGe6t8NREfWWxcrIcFlcTG/kup2rK3ZLO9LMASB6EDyDDvRV+cV6eJv0
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x = np.linspace(-1,3, 1000)\n",
"plt.plot(x, Thomas_Fermi_1d(x, 1, 1, 1))\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:27:53.792186700Z",
"start_time": "2023-07-19T12:27:53.612653200Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Import Data"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"# import data\n",
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + '2023/04/24'# get_date()\n",
"\n",
"\n",
"shotNum = \"0009\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/2023-04-24_0009_Evaporative_Cooling_*0.h5\"\n",
"\n",
"# # load the data from HDF5 files\n",
"# dataSetDict = {\n",
"# dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
"# for i in [0] # range(len(groupList))\n",
"# }\n",
"\n",
"# selecte the data for centain camera\n",
"dataSet = read_hdf5_file(filePath, \"images/MOT_3D_Camera/in_situ_absorption\")\n",
"# flip the x and y axis\n",
"dataSet = swap_xy(dataSet)\n",
"\n",
"# get the scan axis name of the shot\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"# rechunck the data for parallel computing\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
"# calculate the absorption imaging\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"dataSet\n",
"\n",
"OD = dataSet[\"OD\"]\n",
"\n",
"OD_np = OD.to_numpy()"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 211,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1000x900 with 10 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA4UAAAOlCAYAAADafEKWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9fZxeVX3vD78nmQEGmIEMkBEGyKATTNRQjBp6jApiVKjS1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xRLYUFBQUFBQUFBQcFBgMsuu2yv1XXhhRfutboK9j+KpbCgoKCgoKCgoKDgIMD8+fPZW6z/zp0790o9BQcGiqWwoKCgoKCgoKCg4CDA4ODgrELh+Pg4o6OjAHR3d7Nw4cK5alrBfkaxFBYUFBQUFBQUFBQUAHDbbbfxN3/zN1x++eX87//9vzn//PP3d5MK5gBFKCwoKCgoKCgoKCgoyPCWt7yFT33qU/zrv/4rz3nOc/Z3cwr2MYpQWFBQUFBQUFBQUFCQYWRkhJNPPplXv/rVfOELX9jfzSnYxyiH1xcUPAY8+uijfOhDH+J5z3seRx11FEceeSTLli3jPe95D+Pj44+7/vHxcS6++GKWLVvGkUceyVFHHcXznvc8/v7v/55HH310L7xBQcHBgampKb71rW/xgQ98gN/6rd/i1FNPZd68eXR0dHDRRRftteeUNVtQ8Pjx4IMP8vnPf57/8l/+C7/0S79ET08PhxxyCE95ylM455xzuPTSS5mamnrcz9nXe/iTBQMDAxx11FF897vf3d9NKZgDFEthQcEeYtu2bbzkJS/h5ptvBuDQQw9l/vz5PPzwwwAsWrSIG264gUW
},
"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-19T12:09:08.446295800Z",
"start_time": "2023-07-19T12:09:00.896322400Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Guess center\n",
"\n",
"ToDo: Crop from center guess"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 214,
"outputs": [],
"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",
"# thresh = gaussian_filter(thresh, sigma=0.1)\n",
"# thresh = np.where(thresh<0.1,0,1)\n",
"\n",
"#M = moments(thresh)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:09:26.336425100Z",
"start_time": "2023-07-19T12:09:26.282568400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 215,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[[75.69178082 88.5 ]\n",
" [77.85648148 83.31944444]\n",
" [74.20467836 83.28654971]]\n",
"\n",
" [[77.33333333 84.52136752]\n",
" [74.9516129 84.98387097]\n",
" [78.32758621 90.42528736]]\n",
"\n",
" [[76.02054795 84.00684932]\n",
" [76.22058824 83.63970588]\n",
" [75.00787402 84.74015748]]]\n"
]
}
],
"source": [
"center = calc_cen_bulk(thresh)\n",
"print(center)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:09:26.898612200Z",
"start_time": "2023-07-19T12:09:26.833267600Z"
}
}
},
{
"cell_type": "code",
"execution_count": 216,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9QAAAKTCAYAAAD4/kDkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABiR0lEQVR4nO3db3CU9b3//9fStZuhZhcJAwayIdAQHYc0EY2lqfz72oxWnJIjdHBaKulRkzsM9c/v1HDnqGc6CeccSgZ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qhoYGdXZ2qrGxMXbb888/rxMnTujYsWNasmSJ7rnnnlFfY9OmTQqHw7FLKBSyc0QAcAT5CACJjTcjyUcATrGtUG/ZskW7d+/WK6+8oqlTp8ZuH/yE0OPxaMOGDerq6lJ/f3/C1/H5fPL7/cMuAJDJyEcASMyOjCQfATjFlkK9detW7dq1S6+++qqmTZsWu31gYEBnzpyJXW9tbdWsWbOUl5dnx2IBwPXIRwBIjIwEkOm8qTy4rq5ObW1t6u3t1Z133qnc3Fy98cYbeuyxxzR//nytWLFC0pVPCQ8dOqRoNKqVK1cqGo1qypQpmjFjhvbs2TMh/xAAcBL5CACJkZEAspXHGGOcHmI0kUhEgUBAUr2kHKfHAZBxLkjarHA4nHWHAJKPAMYvOzOSfAQwfsnlo+1n+QYAAAAAYDKgUAMAAAAAYAGFGgAAAAAACyjUAAAAAABYQKEGAAAAAMACCjUAAAAAABZQqAEAAAAAsIBCDQAAAACABRRqAAAAAAAsoFADAAAAAGABhRoAAAAAAAso1AAAAAA
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9QAAAKTCAYAAAD4/kDkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9f7RdV3nfjX4FR7GPX46wjo2EkW3tmGMiBeQYlcpJRbDyRoyYJk4w4YYWRmKPQiHpGxiFvoNCmlziOwpOGQRGShK4HXBjmkCCX35d+03MTcyIDKitDZWplSBTK2ELWxgJ+xh0wAdFJ9X9Y8/Pmc/+zjnX3ke2peiwn3/m3mvNNdf88cxnPr/XmpMnT57UBCYwgQlMYAITmMAEJjCBCUxgAhNYETzlTHdgAhOYwAQmMIEJTGACE5jABCYwgbMRJgL1BCYwgQlMYAITmMAEJjCBCUxgA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94LwvDPIgM/VKyvtQKOY34PKeAfjdrfVqYGfN7tSGc/ZUUz5vDLjDy0e5UlQa8fnvIt3qK3lK1PJuQOev0aDvl/+pNPIM0cfP6as2HLYJOma9PuDdo91AWc+pBK6zirahSbVaCJr1drf3lcp0xSvG+mk9wH8jPuqhVs1elSzDnZdj8B7/MzuAnim20Pb8Ck1w8C49PuNkjDi0C/a22rt9pVxgHXm7It7j3u047SLdd+lTG+wRI/D/3MG+Pm9Q1q/a/Dz0VaoQzwvoVXgEevRS2U/lUfDPd7F3EfcoF/gN/95T6Q/rA/tOl/qY5RKXpF2o8fwKDlkU+Vd0EL4jT2pvFvlHt2
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9QAAAKTCAYAAAD4/kDkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9f7yeV13nC3+iu1M2ww40jYklDbmpu04iBErEoAZMOIbHdo7RtsMULUeTGRh+zBl4hDlTEZ1X7HMGcHgQxoMKxwNaHgYQRODVqK1jHFKlMi1M2mmUlGmkO6QRGksK2cCm0637+eNe73t9789a67rvHWg63dzff9Z9X9e61rV+fNd3fX9fq5aWlpY0gQlMYAITmMAEJjCBCUxgAhOYwASWBd/xaHdgAhOYwAQmMIEJTGACE5jABCYwgcciTATqCUxgAhOYwAQmMIEJTGACE5jABM4CJgL1BCYwgQlMYAITmMAEJjCBCUxgAmcBE4F6AhOYwAQmMIEJTGACE5jABCYwgbOAiUA9gQlMYAITmMAEJjCBCUxgAhOYwFnARKCewAQmMIEJTGACE5jABCYwgQlM4CxgIlBPYAITmMAEJjCBCUxgAhOYwAQmcBYwEagnMIEJTGACE5jABCYwgQlMYAITOAuYCNQTmMAEJjCBCU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nlKeE9aDMbngKrX3vs/VfkmMJQrkUqYxdyvjB7T4FqszDuxNZRSIW3SHvhwLv8EBn7cu/sPHS91tavf9FamMSvrrUolwAp7vV5+WP/ERp5GPHn38U2UBy2GTBgL0kHJKygLDdY37Up+fkLJCKYLTqtqZHAUJqdsqzvOu0OGZdSr
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fsize = (12,8)\n",
"\n",
"nr_plots = 3\n",
"\n",
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"\n",
"for i in range(0,nr_plots):\n",
" for j in range(0,nr_plots):\n",
" # ax[i][j].pcolormesh(blurred[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" ax[i][j].pcolormesh(thresh[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(cropOD[i][j], cmap='hot', vmin=0, vmax=1, alpha=1)\n",
" ax[i][j].plot(center[i,j,0],center[i,j,1], marker='x', markersize=12)\n",
"plt.show()\n",
"\n",
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"for i in range(0,nr_plots):\n",
" for j in range(0,nr_plots):\n",
" ax[i][j].pcolormesh(blurred[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(thresh[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(cropOD[i][j], cmap='hot', vmin=0, vmax=1, alpha=1)\n",
" ax[i][j].plot(center[i,j,0],center[i,j,1], marker='x', markersize=12)\n",
"plt.show()\n",
"\n",
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"for i in range(0,nr_plots):\n",
" for j in range(0,nr_plots):\n",
" ax[i][j].pcolormesh(cropOD[i][j], cmap='jet', vmin=0, vmax=1.5)\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-19T12:09:32.770081200Z",
"start_time": "2023-07-19T12:09:27.890651400Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Guess width"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 217,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[[ 8. 25.]\n",
" [ 8. 26.]\n",
" [ 9. 26.]]\n",
"\n",
" [[ 7. 19.]\n",
" [ 7. 21.]\n",
" [ 8. 26.]]\n",
"\n",
" [[ 8. 20.]\n",
" [ 9. 18.]\n",
" [ 8. 20.]]]\n"
]
}
],
"source": [
"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",
"BEC_width_guess = guess_BEC_width(thresh, center)\n",
"\n",
"print(BEC_width_guess)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:09:37.533687900Z",
"start_time": "2023-07-19T12:09:37.510728500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 199,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9QAAAKTCAYAAAD4/kDkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpA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wEgMQmOiPJRwBOsf071Nu2bdOqVauG3VZfX6/S0lKtXbtWXV1doz6/sbFRgUAgdgkGg3aPCACOIB8BILHxZCT5CMApthbqhoYGdXZ2qrGxMXbb888/rxMnTujYsWNasmSJ7rnnnlFfY9OmTQqHw7FLKBSyc0QAcAT5CACJjTcjyUcATrGtUG/ZskW7d+/WK6+8oqlTp8ZuH/yE0OPxaMOGDerq6lJ/f3/C1/H5fPL7/cMuAJDJyEcASMyOjCQfATjFlkK9detW7dq1S6+++qqmTZsWu31gYEBnzpyJXW9tbdWsWbOUl5dnx2IBwPXIRwBIjIwEkOm8qTy4rq5ObW1t6u3t1Z133qnc3Fy98cYbeuyxxzR//nytWLFC0pVPCQ8dOqRoNKqVK1cqGo1qypQpmjFjhvbs2TMh/xAAcBL5CACJkZEAspXHGGOcHmI0kUhEgUBAUr2kHKfHAZBxLkjarHA4nHWHAJKPAMYvOzOSfAQwfsnlo+1n+QYAAAAAYDKgUAMAAAAAYAGFGgAAAAAACyjUAAAAAABYQKEGAAAAAMACCjUAAAAAABZQqAEAAAAAsIBCDQAAAACABRRqAAAAAAAsoFADAAAAAGABhRoAAAAAAAso1AAAAAA
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# %matplotlib notebook\n",
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"\n",
"for i in range(0,nr_plots):\n",
" for j in range(0,nr_plots):\n",
" # ax[i][j].pcolormesh(blurred[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" ax[i][j].pcolormesh(thresh[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(cropOD[i][j], cmap='hot', vmin=0, vmax=1, alpha=1)\n",
" ax[i][j].plot(center[i,j,0],center[i,j,1], marker='x', markersize=12)\n",
"plt.show()\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:02:40.167162700Z",
"start_time": "2023-07-19T12:02:38.840555800Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Mask array"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 200,
"outputs": [
{
"data": {
"text/plain": "(3, 3, 200, 150)"
},
"execution_count": 200,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"masked = np.where(thresh==0, cropOD, np.nan)\n",
"np.shape(masked)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:02:42.006475600Z",
"start_time": "2023-07-19T12:02:41.962010400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 279,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1100x1100 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA4cAAAN2CAYAAABKI/wqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9e5xcRZ0+jj8903PP5AaEOzQkgAhouIOABoEP4k8QWFQWcI0rFxVF0C+KoIvoguKuwUVcRVFxBUW84IIuKOwyCoqCQhQQlQhNAgRCSEKSnmvP9O+PU0+fp3uedPckk8BM6nm95lU9derUqVP1rnfVqfdT78qUSqUSIiIiIiIiIiIiIiIiIjZrNL3cBYiIiIiIiIiIiIiIiIh4+RE/DiMiIiIiIiIiIiIiIiLix2FERERERERERERERERE/DiMiIiIiIiIiIiIiIiIQPw4jIiIiIiIiIiIiIiIiED8OIyIiIiIiIiIiIiIiIhA/DiMiIiIiIiIiIiIiIiIAJB9uQtQDyMjI3j22WfR3d2NTCbzchcnIiJiI6FUKmHNmjXYbrvt0NQ0cdetos6KiJj8mCz6Cog6KyJic8BYdNYr/uPw2WefxY477vhyFyMiImITYcmSJdhhhx1e7mKsN6LOiojYfDDR9RUQdVZExOaERnTWK/7jsLu7O/y6EsBKuXJACFdI3BMh3E7inq2R+17ye9cQ9khcewg7J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SotfWnXhvW0m2NerCs17+pext1RtcoHA1Q689RUh1qjaNKJWc+bj6oz+V1ncexLd8lcXpsEe/RPkLqutJBqV+d3qk
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=(11,11))\n",
"\n",
"cut_factor = 1\n",
"\n",
"for i in range(0,nr_plots):\n",
" for j in range(0,nr_plots):\n",
" #print(np.nanmax(masked[i,j]))\n",
" # ax[i][j].pcolormesh(blurred[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(masked[i][j], cmap='jet', vmin=0, vmax=0.5, alpha=1)\n",
" ax[i][j].pcolormesh(cropOD[i][j], cmap='jet', vmin=0, vmax=2.5, alpha=1)\n",
" #ax[i][j].pcolormesh(thresh[i][j], cmap='jet', vmin=0, vmax=1.5, alpha=1)\n",
" #ax[i][j].pcolormesh(cropOD[i][j], cmap='hot', vmin=0, vmax=1, alpha=1)\n",
" ax[i][j].plot(center[i,j,0],center[i,j,1], marker='x', markersize=12)\n",
" alpha=1\n",
" ax[i][j].hlines(center[i,j,1] - cut_factor * BEC_width_guess[i,j,1]/2, 0, 150, color='r',alpha=alpha,linestyles='dotted')\n",
" ax[i][j].hlines(center[i,j,1] + cut_factor * BEC_width_guess[i,j,1]/2, 0, 150, color='r',alpha=alpha,linestyles='dotted')\n",
"\n",
" ax[i][j].vlines(center[i,j,0] - cut_factor * BEC_width_guess[i,j,0]/2, 0, 200, color='r',alpha=alpha,linestyles='dotted')\n",
" ax[i][j].vlines(center[i,j,0] + cut_factor * BEC_width_guess[i,j,0]/2, 0, 200, color='r',alpha=alpha,linestyles='dotted')\n",
"\n",
" ax[i][j].set_xlim(25,125)\n",
" ax[i][j].set_ylim(45,145)\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T13:06:22.111658300Z",
"start_time": "2023-07-19T13:06:19.953844600Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Cut out region of interest for thermal fitting guess"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 243,
"outputs": [],
"source": [
"shape = np.shape(masked)\n",
"\n",
"X_guess = np.zeros((shape[0], shape[1], shape[3]))\n",
"Y_guess = np.zeros((shape[0], shape[1], shape[2]))\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" X_guess[i,j] = np.sum(masked[i,j,round(center[i,j,1] - cut_factor * BEC_width_guess[i,j,1]/2) : round(center[i,j,1] + cut_factor * BEC_width_guess[i,j,1]/2) , :], 0) / len(masked[i,j,round(center[i,j,1] - cut_factor * BEC_width_guess[i,j,1]/2) : round(center[i,j,1] + cut_factor * BEC_width_guess[i,j,1]/2),0])\n",
"\n",
" Y_guess[i,j] = np.sum(masked[i,j, :, round(center[i,j,0] - cut_factor * BEC_width_guess[i,j,0]/2) : round(center[i,j,0] + cut_factor * BEC_width_guess[i,j,0]/2)], 1) / len(masked[i,j,0,round(center[i,j,0] - cut_factor * BEC_width_guess[i,j,0]/2) : round(center[i,j,0] + cut_factor * BEC_width_guess[i,j,0]/2)])\n",
"\n",
"\n",
"#print(X_guess)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:17:04.400265300Z",
"start_time": "2023-07-19T12:17:04.364847Z"
}
}
},
{
"cell_type": "code",
"execution_count": 244,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+EAAAKPCAYAAAACMMt4AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOydd3hUZfbHPzOZZNILKaQTWmhSpYu9N1Cxi5pVBHV11/Xnrotl1d1VdNd1dV1dcVFcxC6oqNgRBaVLr6EmQEIC6T0zc39/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rrpJqqrq5s9psFg4LTTTuOJJ55gw4YNBAUF8dFHH7X3FAVBENqE2EdBaD01DbWEOgoOJ7zUv+PoQnRnG9l5lkmEToujJjyog9aEA4REq211iT9H0Sl5+OGHKS0t5V//+hfh4eEsWbKE2267jc8+++yE7+vfvz+LFi3i8ssvx2Aw8Oijj2Kzuaee3XnnnaSlpfHII49QW1vLyJEjeeCBB3jppZcaHW/16tV89913XHDBBSQkJLB69WoKCwsZNGiQR89XEAShpYh9FITWU9UweNNRCI5WW3HCPUZ3tpESCRe8jltakc3WQZ1wiYS3hWXLlvH888/z5ptvEhkZidFo5M0332T58uX85z8n7rn+3HPPERMTw8SJE7n88su58MILGTVqlOP1+fPns2TJEt58801MJhNhYWEsWLCA//73v3zxxReNjhcZGcmPP/7IJZdcQmZmJo888gj/+Mc/uPjiiz1+3oIgCCdD7KMgtA1HBqVEwrs03d1
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" ax[i,j].plot(X_guess[i,j], label = 'x_axis')\n",
" ax[i,j].plot(Y_guess[i,j], label = 'y_axis')\n",
" ax[i,j].legend(fontsize=10)\n",
"plt.show()\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:17:06.852598Z",
"start_time": "2023-07-19T12:17:05.052365900Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Fitting 1D gaussian"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 245,
"outputs": [],
"source": [
"#[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], 2, 3))\n",
"\n",
"p0 = np.ones((shape[0], shape[1], 2, 3))\n",
"\n",
"p0[:, :, :, 0] = center\n",
"p0[:, :, :, 1] = BEC_width_guess / 2.355\n",
"p0[:, :, :, 2] = 0.1\n",
"\n",
"\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" popt[i,j, 0], pcov = curve_fit(gaussian, x, X_guess[i,j] , p0[i, j, 0], nan_policy='omit')\n",
" popt[i,j, 1], pcov = curve_fit(gaussian, y, Y_guess[i,j] , p0[i, j, 1], nan_policy='omit')"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:17:08.014466200Z",
"start_time": "2023-07-19T12:17:07.958106900Z"
}
}
},
{
"cell_type": "code",
"execution_count": 246,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9gAAAKQCAYAAABkVtLEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3hUxfrA8e/ZzW5675AECJDQAwiIgKh0uRQpdriigqCi99pQRP2pVwW9YhdFxILYkKIICAIKUgTpnZCEdFJJb5st5/fHQpBLKIEtSXg/z7OPye45M++JYXLmzMw7iqqqKkIIIYQQQgghhLgiGmcHIIQQQgghhBBCNAbSwRZCCCGEEEIIIWxAOthCCCGEEEIIIYQNSAdbCCGEEEIIIYSwAelgCyGEEEIIIYQQNiAdbCGEEEIIIYQQwgakgy2EEEIIIYQQQtiAdLCFEEIIIYQQQggbcHF2AHVhsVg4ceIE3t7eKIri7HCEEA2QqqqUlpbSpEkTNJrG9YxR2kghxJWQ9lEIIWpXl/axQXWwT5w4QWRkpLPDEEI0Aunp6URERNi0zEcffZTly5eTmprKnj176Ny58znHbNiwgZtvvpnY2Nia9/7880/c3d0BmD9/PrNmzcJisdCvXz/mzJmDTqe7pPqljRRC2II92kdnk/ZRCGELl9I+NqgOtre3N2C9MB8fHydHI4RoiEpKSoiMjKxpT2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6QGInrVbL2rVr+eWXX2jXrh3vv/8+sbGxJCcn1/l6hKhvSlavIf3BhyheudLZodQLDamNlPZRCMe55M6
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" ax[i,j].plot(x, X_guess[i,j], label = 'x_axis')\n",
" ax[i,j].plot(x, gaussian(x, *popt[i,j,0]), linestyle='dotted')\n",
"\n",
" ax[i,j].plot(y, Y_guess[i,j], label = 'y_axis')\n",
" ax[i,j].plot(y, gaussian(y, *popt[i,j,1]), linestyle='dotted')\n",
" ax[i,j].legend(fontsize=10)\n",
" ax[i,j].set_facecolor('#FFFFFF')\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:17:10.027028300Z",
"start_time": "2023-07-19T12:17:08.582932400Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Try with not masked array\n"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 209,
"outputs": [],
"source": [
"shape = np.shape(masked)\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(masked[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(masked[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)])"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:03:10.212862800Z",
"start_time": "2023-07-19T12:03:10.178939400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 265,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9EAAAKPCAYAAABqw0lAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3xV5f3A8c+5I8nN3pCQMANBZET2dqHgqLu4V8VRa1GrrfXXOlqt2krRClqwKFZwIypFRRFBQIYywibMBEJC9s7d9/z+OPfeJJCEjHuz+L5fr7zuOuO5RJ+c7/k+z/dRVFVVEUIIIYQQQgghxBnp2rsBQgghhBBCCCFEZyFBtBBCCCGEEEII0UQSRAshhBBCCCGEEE0kQbQQQgghhBBCCNFEEkQLIYQQQgghhBBNJEG0EEIIIYQQQgjRRBJECyGEEEIIIYQQTWRo7wacyuVykZOTQ1hYGIqitHdzhBCdkKqqVFRUkJiYiE7Xte4VSh8phGgN6R+FEKJ+zekfO1wQnZOTQ3Jycns3QwjRBRw/fpykpKT2boZPSR8phPAF6R+FEKJ+TekfO1wQHRYWBmiNDw8Pb+fWCCE6o/LycpKTk739SVcifaQQojWkfxRCiPo1p3/scEG0Z/hNeHi4dIBCiFbpisP5pI8UQviC9I9CCFG/pvSPXWsyjBBCCCGEEEII4UcSRAshhBBCCCGEEE3UrOHcFouFm266ib1792IymYiPj+ff//43KSkpp227fPlyHn/8cZxOJ0OGDOGdd96RoTWiXTidTux2e3s3Q/iB0WhEr9e3dzOE6LSkf+y69Ho9BoOhSw7bFqItSP/YtbX2GrLZc6Lvu+8+LrvsMhRFYe7cucyYMYM1a9bU2aayspJ77rmHH374gYEDB/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mzGZTEyaNIl77rmH8ePH8+677zJgwIDT9h87diyvvPIKjz32GJMnT2batGkNnsszByYlJYWgoCBuuOEGQBvaU1xcTGlpKZGRkbz//vssWrQIi8WCxWIhNjb2jOfas2cPV111FZ9//jnDhg0D4IsvvmDHjh3eugoAxcXFmM1mVq1axR133EFAQAAAv/rVr3jrrbea8k8sRIdiKTECEDfcwsmNQdiys1FdLko//5y8F1/Csj+DxBdfwJaZCYASEIBqs2HPbbssjfSP0j8K4Xe1h3KDd060qqqUvP8+gf37EzJ6dDs07Mykj5Q+sj4ynFu0C3tuLtQaguLy85zojsLhcLB7926io6M5ceJEo9vabDauu+46Zs2axe7du1m7di0AVqvVu8327duJi4trcGm4cePGkZ6ezpgxY1i6dCmjRo3C6ax/bcagoCDvc71e732tKAqKouBwOFi/fj2vvfYaX331Fbt372b27NlYLJYznisxMZFu3brx/fffe8+hqip33nkn6enp3p/c3FxMJtNpbZO1GkVnpJorsVZoF14h0WWgKOBw4Cwuxnb4MKBV5HZVV1O5Svt/I2TiRODsG84N0j9K/yi6tFL3/4dhCdpjhdbHWffvJ++558l54o/t1LDOQ/rIjtVHShAt2sWplWedFWdHEP3HP/6R1NRU1q1bx+OPP86hQ4ca3NZisWCz2ejZsycAc+bMqfP53LlzKSkpYceOHcyfP58ff/zxtGMcPXqU0NBQpk+fzpw5czhw4ACVlZUtbn9JSQlhYWHExMRgs9mYP39+k84VFRXFypUr+fzzz71FCK+66ioWL17MsWNagTmXy8WWLVsAmDJlCosXL8Zut2Oz2Vi4cGGL2yxEe7HtTweXgmJwYQx1oo+JBsCRn++tCWE/mUvp0s9wlpZiTE4m6ibtbr4j5+ybLyj9o/SPoguzlGmP3c7
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"\n",
"for i in range(0, shape[0]):\n",
" for j in range(0, shape[1]):\n",
" ax[i,j].plot(x, X_guess[i,j], label = 'x_axis masked',zorder=5)\n",
" ax[i,j].plot(x, X_guess_og[i,j], label = 'x_axis original')\n",
"# ax[i,j].legend(fontsize=10)\n",
"# plt.show()\n",
"#\n",
"# fig, ax = plt.subplots(nr_plots,nr_plots,figsize=fsize)\n",
"#\n",
"# for i in range(0, shape[0]):\n",
"# for j in range(0, shape[1]):\n",
" ax[i,j].plot(y, Y_guess[i,j], label = 'y_axis masked',zorder=5)\n",
" ax[i,j].plot(y, Y_guess_og[i,j], label = 'y_axis original')\n",
" ax[i,j].legend(fontsize=8)\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T12:52:13.040993700Z",
"start_time": "2023-07-19T12:52:11.105524Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"## Bimodal 1d Fit"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 293,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"fitting time: 189.01324272155762 ms\n"
]
}
],
"source": [
"#[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] # 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')\n",
" #popt[i,j, 1], pcov = curve_fit(density_1d, y, Y_guess_og[i,j] , p0[i, j, 1], nan_policy='omit')"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:22:21.518302700Z",
"start_time": "2023-07-19T14:22:21.265419Z"
}
}
},
{
"cell_type": "code",
"execution_count": 294,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1200x800 with 9 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA9EAAAKPCAYAAABqw0lAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3zU9f3A8df39iW5XPaAJAQIGwSCKC5cdStatdZdVBCr1rbW2vKztmpbsXW0WgeoqHXUhdriqHuBVgQRRJARIHvPu6xb3+/vj28SQBLIuORG3s/H4x5yd9/73vvO483n/f0sRdM0DSGEEEIIIYQQQhyUIdQBCCGEEEIIIYQQkUKKaCGEEEIIIYQQopekiBZCCCGEEEIIIXpJimghhBBCCCGEEKKXpIgWQgghhBBCCCF6SYpoIYQQQgghhBCil6SIFkIIIYQQQggheskU6gC+T1VVysvLcTgcKIoS6nCEEBFI0zTcbjcjRozAYIiua4WSI4UQAyH5UQghuteX/Bh2RXR5eTnZ2dmhDkMIEQVKSkrIysoKdRhBJTlSCBEMkh+FEKJ7vcmPYVdEOxwOQA8+Pj4+xNEIISKRy+UiOzu7K59EE8mRQoiBkPwohBDd60t+DLsiunP4TXx8vCRAIcSARONwPsmRQohgkPwohBDd601+jK7JMEIIIYQQQgghxCCSIloIIYQQQgghhOglKaKFEEIIIYQQQohekiJaCCGEEEIIIYToJSmiRcQKqBovri1mR5U71KEIIURYavcFePKz3RTXtYY6FDEM3HDDDeTm5qIoChs2bOj2mCeff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hi4uL98mfubm5FBf
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(nr_plots,nr_plots,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()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:22:25.505279900Z",
"start_time": "2023-07-19T14:22:21.896071700Z"
}
}
},
{
"cell_type": "code",
"execution_count": 295,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[75.69178082 75.69178082 1.28576093 0.5510404 8. 24. ]\n",
"[75.41570333 77.33388115 2.56706786 0.32435386 9.02534473 21.78913789]\n",
"\n",
"[77.85648148 77.85648148 1.26012635 0.54005415 8. 24. ]\n",
"[77.87651631 81.11230043 2.46976259 0.33019881 9.77967464 21.30093181]\n",
"\n",
"[74.20467836 74.20467836 1.24055688 0.53166723 9. 27. ]\n",
"[73.89357632 76.27664646 2.4312179 0.27440553 9.98643754 20.45775545]\n",
"\n",
"[77.33333333 77.33333333 1.34319384 0.5756545 7. 21. ]\n",
"[77.11393592 81.40236184 2.88921236 0.26104054 8.62447632 18.73504104]\n",
"\n",
"[74.9516129 74.9516129 1.37694159 0.59011782 7. 21. ]\n",
"[74.59729659 78.58410424 2.78343705 0.22861603 9.03257479 18.55393163]\n",
"\n",
"[78.32758621 78.32758621 1.11153483 0.47637207 8. 24. ]\n",
"[78.50292483 82.40258606 2.35517079 0.20782915 9.17053985 15.99073945]\n",
"\n",
"[76.02054795 76.02054795 0.47105793 0.20188197 8. 24. ]\n",
"[75.51767384 76.75506578 0.87440112 0.14660177 8.96571527 5.96931421]\n",
"\n",
"[76.22058824 76.22058824 0.47981987 0.20563709 9. 27. ]\n",
"[76.17323785 76.98707429 0.61643944 0.23667638 9.4043337 5.34970959]\n",
"\n",
"[75.00787402 75.00787402 0.43698764 0.18728042 8. 24. ]\n",
"[74.88995354 73.93092826 0.90810872 0.09114657 9.42569183 7.98461584]\n",
"\n"
]
}
],
"source": [
"for i in range(0,3):\n",
" for j in range(0,3):\n",
" print(p0[i,j])\n",
" print(popt[i,j])\n",
" print(\"\")"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-19T14:22:25.522303500Z",
"start_time": "2023-07-19T14:22:25.510339Z"
}
}
},
{
"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
}