analyseScript/Joschka/Fitting_Data_Britta.ipynb

3186 lines
7.7 MiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"source": [
"# Import supporting package"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 1,
"outputs": [],
"source": [
2023-07-20 20:34:19 +02:00
"import lmfit\n",
"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",
"#test\n",
"plt.rcParams['font.size'] = 18\n",
"\n",
"from scipy.ndimage import gaussian_filter\n",
"import matplotlib as mpl\n",
"from scipy.interpolate import CubicSpline\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"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 14,
"outputs": [],
"source": [
"# get center of thresholded image\n",
2023-07-27 17:16:08 +02:00
"def calc_thresh(data):\n",
" shape = np.shape(data)\n",
" thresh = np.zeros(shape)\n",
" sigma = 0.4\n",
"\n",
" if len(shape) == 4:\n",
" blurred = gaussian_filter(data, sigma=sigma)\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.3,0,1)\n",
"\n",
" elif len(shape) == 3:\n",
" blurred = gaussian_filter(data, sigma=sigma)\n",
" for i in range(0,shape[0]):\n",
" thresh[i] = np.where(blurred[i] < np.max(blurred[i])*0.3,0,1)\n",
2023-07-27 17:16:08 +02:00
"\n",
" else:\n",
" print(\"Shape of data is wrong, output is empty\")\n",
"\n",
" return thresh\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",
2023-07-26 09:41:51 +02:00
"# 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 polylog_tab(pow, x):\n",
" order = 100\n",
" sum = 0\n",
" for k in range(1,order):\n",
" sum += x ** k /k **pow\n",
" return sum\n",
"\n",
"x_int = np.linspace(0, 1.00001, 100000)\n",
"\n",
"poly_tab = polylog_tab(2,x_int)\n",
"\n",
"\n",
"\n",
"polylog_int = CubicSpline(x_int, poly_tab)\n",
"\n",
2023-07-20 20:34:19 +02:00
"def thermal(x, x0, amp, sigma):\n",
" res = np.exp(-0.5 * (x-x0)**2 / sigma**2)\n",
" return amp/1.643 * polylog_int(res)\n",
"\n",
"def Thomas_Fermi_1d(x, x0, amp, sigma):\n",
" res = (1- ((x-x0)/sigma)**2)\n",
" res = np.where(res > 0, res, 0)\n",
" res = res**(3/2)\n",
" return amp * res\n",
"\n",
2023-07-20 20:34:19 +02:00
"def density_1d(x, x0_bec, x0_th, amp_bec, amp_th, sigma_bec, sigma_th):\n",
2023-07-26 09:41:51 +02:00
" return thermal(x, x0_th, amp_th, sigma_th) + Thomas_Fermi_1d(x, x0_bec, amp_bec, sigma_bec)\n",
"\n",
"\n",
"def polylog(pow, x):\n",
" order = 15\n",
" sum = 0\n",
" for k in range(1,order):\n",
" sum += x ** k /k **pow\n",
" return sum\n",
"\n",
"\n",
"def ThomasFermi_2d(x, y=0.0, centerx=0.0, centery=0.0, amplitude=1.0, sigmax=1.0, sigmay=1.0):\n",
"\n",
" res = (1- ((x-centerx)/(sigmax))**2 - ((y-centery)/(sigmay))**2)\n",
" res = np.where(res > 0, res, 0)\n",
" res = res**(3/2)\n",
" return amplitude * res\n",
2023-07-26 09:41:51 +02:00
" # return amplitude * 5 / 2 / np.pi / max(tiny, sigmax * sigmay) * np.where(res > 0, res, 0)\n",
"\n",
"\n",
" # return amplitude / 2 / np.pi / 1.20206 / max(tiny, sigmax * sigmay) * polylog(2, np.exp( -((x-centerx)**2/(2 * (sigmax)**2))-((y-centery)**2/( 2 * (sigmay)**2)) ))\n",
"# Set up table for polylog\n",
"\n",
"\n",
"def polylog2_2d(x, y=0.0, centerx=0.0, centery=0.0, amplitude=1.0, sigmax=1.0, sigmay=1.0):\n",
" ## Approximation of the polylog function with 2D gaussian as argument. -> discribes the thermal part of the cloud\n",
" return amplitude/1.643 * polylog_int(np.exp( -((x-centerx)**2/(2 * sigmax**2))-((y-centery)**2/( 2 * sigmay**2)) ))\n",
"\n",
2023-07-26 09:41:51 +02:00
"\n",
"\n",
"def density_profile_BEC_2d(x, y=0.0, amp_bec=1.0, amp_th=1.0, x0_bec=0.0, y0_bec=0.0, x0_th=0.0, y0_th=0.0,\n",
" sigmax_bec=1.0, sigmay_bec=1.0, sigma_th=1.0):\n",
2023-07-26 09:41:51 +02:00
" return ThomasFermi_2d(x=x, y=y, centerx=x0_bec, centery=y0_bec,\n",
" amplitude=amp_bec, sigmax=sigmax_bec, sigmay=sigmay_bec\n",
" ) + polylog2_2d(x=x, y=y, centerx=x0_th, centery=y0_th,\n",
" amplitude=amp_th, sigmax=sigma_th,sigmay=sigma_th)\n",
"\n",
"def cond_frac(results):\n",
" bval = results.best_values\n",
" tf_fit = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=bval['sigmax_bec'], sigmay=bval['sigmay_bec'])\n",
" N_bec = np.sum(tf_fit)\n",
" fit = fit = density_profile_BEC_2d(X,Y, **bval)\n",
" N_ges = np.sum(fit)\n",
" return N_bec/N_ges\n",
"\n",
"def print_bval(res_s):\n",
" keys = res_s.best_values.keys()\n",
" bval = res_s.best_values\n",
" init = res_s.init_params\n",
"\n",
" for item in keys:\n",
" print(f'{item}: {bval[item]:.3f}, (init = {init[item].value:.3f}), bounds = [{init[item].min:.2f} : {init[item].max :.2f}] ')\n",
" print('')\n",
"\n",
"def print_bval_bulk(res_):\n",
" shape = np.shape(res_)\n",
" if len(shape) == 2:\n",
" for i in range(shape[0]):\n",
" for j in range(shape[1]):\n",
" print(f'image: {i}, {j}')\n",
" print_bval(res_[i][j])\n",
"\n",
" if len(shape) == 1:\n",
" for i in range(shape[0]):\n",
" print(f'image: {i}')\n",
" print_bval(res_[i])\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:20:49.853382Z",
"start_time": "2023-08-01T15:20:49.405949500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 3,
2023-07-26 09:41:51 +02:00
"outputs": [],
"source": [
"# load Brittas data\n",
2023-07-26 09:41:51 +02:00
"\n",
"data = np.zeros((2,11, 1200, 1920))\n",
"data[0] = np.load('Data_Britta/OD_ft_flatfield.npy')\n",
"data[1] = np.load('Data_Britta/OD_ft_manual.npy')\n",
2023-07-26 09:41:51 +02:00
"\n",
"shape = np.shape(data)"
2023-07-26 09:41:51 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:15:37.267480300Z",
"start_time": "2023-08-01T15:15:36.671379300Z"
2023-07-26 09:41:51 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 4,
2023-07-26 09:41:51 +02:00
"outputs": [],
"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",
2023-07-26 09:41:51 +02:00
"\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])-4:round(center[i,j,1])+5, :])/9\n",
" BEC_width_guess[i, j, 1] = np.sum(thresh[i, j, :, round(center[i,j,0])-4:round(center[i,j,0])+5])/9\n",
"\n",
" return BEC_width_guess"
2023-07-26 09:41:51 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:15:37.268477600Z",
"start_time": "2023-08-01T15:15:37.267480300Z"
2023-07-26 09:41:51 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 53,
2023-07-26 09:41:51 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(9, 250)\n"
2023-07-26 09:41:51 +02:00
]
}
],
"source": [
"print(np.shape(thresh[i, j, round(center[i,j,1])-4:round(center[i,j,1])+5, :]))"
2023-07-26 09:41:51 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T10:07:45.908882100Z",
"start_time": "2023-08-01T10:07:45.795191900Z"
2023-07-26 09:41:51 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 8,
2023-07-26 09:41:51 +02:00
"outputs": [],
2023-07-27 17:16:08 +02:00
"source": [
"cut_width = 250\n",
"thresh = calc_thresh(data)\n",
"center = calc_cen_bulk(thresh)\n",
"\n",
"shape = np.shape(data)\n",
"cropOD = np.zeros((shape[0], shape[1], cut_width, cut_width))\n",
"\n",
"for i in range(0,shape[0]):\n",
" for j in range(0, shape[1]):\n",
" cropOD[i,j] = data[i,j, round(center[i,j,1]-cut_width/2):round(center[i,j,1]+cut_width/2), round(center[i,j,0]-cut_width/2):round(center[i,j,0]+cut_width/2)]\n",
"\n",
"thresh = calc_thresh(cropOD)\n",
"center = calc_cen_bulk(thresh)\n",
"# print(center)\n",
"BEC_width_guess = guess_BEC_width(thresh, center)\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:16:07.587125100Z",
"start_time": "2023-08-01T15:16:03.874883800Z"
}
}
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1081. 481.]\n",
"0.32106129452561555\n",
"-0.03579800587577903\n"
]
},
{
"ename": "type",
"evalue": "could not broadcast input array from shape (244,250) into shape (250,250)",
"output_type": "error",
"traceback": [
"\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[1;31mValueError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[1;32mIn[6], line 17\u001B[0m\n\u001B[0;32m 15\u001B[0m \u001B[38;5;28mprint\u001B[39m(np\u001B[38;5;241m.\u001B[39mmax(data[i,j]))\n\u001B[0;32m 16\u001B[0m \u001B[38;5;28mprint\u001B[39m(data[i,j, \u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m0\u001B[39m]), \u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m1\u001B[39m]) ])\n\u001B[1;32m---> 17\u001B[0m \u001B[43mcropOD\u001B[49m\u001B[43m[\u001B[49m\u001B[43mi\u001B[49m\u001B[43m,\u001B[49m\u001B[43mj\u001B[49m\u001B[43m]\u001B[49m \u001B[38;5;241m=\u001B[39m data[i,j, \u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m0\u001B[39m]\u001B[38;5;241m-\u001B[39mcut_width\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m2\u001B[39m):\u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m0\u001B[39m]\u001B[38;5;241m+\u001B[39mcut_width\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m2\u001B[39m), \u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m1\u001B[39m]\u001B[38;5;241m-\u001B[39mcut_width\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m2\u001B[39m):\u001B[38;5;28mround\u001B[39m(center[i,j,\u001B[38;5;241m1\u001B[39m]\u001B[38;5;241m+\u001B[39mcut_width\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m2\u001B[39m)]\n\u001B[0;32m 19\u001B[0m thresh \u001B[38;5;241m=\u001B[39m calc_thresh(cropOD)\n\u001B[0;32m 20\u001B[0m center \u001B[38;5;241m=\u001B[39m calc_cen_bulk(thresh)\n",
"\u001B[1;31mValueError\u001B[0m: could not broadcast input array from shape (244,250) into shape (250,250)"
]
}
],
"source": [
2023-07-27 17:16:08 +02:00
"\n",
"cut_width = 250\n",
"thresh = calc_thresh(data)\n",
"center = calc_cen_bulk(thresh)\n",
"\n",
"shape = np.shape(data)\n",
"cropOD = np.zeros((shape[0], shape[1], cut_width, cut_width))\n",
"blurred = gaussian_filter(data, sigma=0.4)\n",
2023-07-27 17:16:08 +02:00
"\n",
"for i in range(0,shape[0]):\n",
" for j in range(0, shape[1]):\n",
" amax = np.argmax(blurred[i,j])\n",
"\n",
" center[i,j] = np.unravel_index(amax, (shape[2], shape[3]))\n",
" print(center[i,j])\n",
" print(np.max(data[i,j]))\n",
" print(data[i,j, round(center[i,j,0]), round(center[i,j,1]) ])\n",
" cropOD[i,j] = data[i,j, round(center[i,j,0]-cut_width/2):round(center[i,j,0]+cut_width/2), round(center[i,j,1]-cut_width/2):round(center[i,j,1]+cut_width/2)]\n",
2023-07-27 17:16:08 +02:00
"\n",
"thresh = calc_thresh(cropOD)\n",
"center = calc_cen_bulk(thresh)\n",
"# print(center)\n",
"BEC_width_guess = guess_BEC_width(thresh, center)"
2023-07-27 17:16:08 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:15:49.603304400Z",
"start_time": "2023-08-01T15:15:45.139480Z"
}
}
},
{
"cell_type": "code",
"execution_count": 66,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[24. 22.]\n"
]
}
],
"source": [
"print(BEC_width_guess[1,7])\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T10:12:50.194861600Z",
"start_time": "2023-08-01T10:12:50.080033Z"
}
}
},
{
"cell_type": "code",
"execution_count": 9,
"outputs": [
{
"data": {
2023-07-27 17:16:08 +02:00
"text/plain": "<Figure size 2000x500 with 22 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAABkAAAAGsCAYAAACFLWvQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOz9fVzWVbb/jz9FFElAFBRUUExUVHQwNfE2LCrvMiscrbSxssnKzBwbraysrGxy1MrM0sxKUydLJ620KBlvMVEZRUHFREEFQwUEEUX5/fFaF7v5fOZxzpzO6Od7zu9ajwcP4Lre773XXvd77b3XrlFVVVWFF7zgBS94wQte8IIXvOAFL3jBC17wghe84AUveMELXvDC/yLw+X+NgBe84AUveMELXvCCF7zgBS94wQte8IIXvOAFL3jBC17wwr8bvAsgXvCCF7zgBS94wQte8IIXvOAFL3jBC17wghe84AUveOF/HXgXQLzgBS94wQte8IIXvOAFL3jBC17wghe84AUveMELXvDC/zrwLoB4wQte8IIXvOAFL3jBC17wghe84AUveMELXvCCF7zghf914F0A8YIXvOAFL3jBC17wghe84AUveMELXvCCF7zgBS94wQv/68C7AOIFL3jBC17wghe84AUveMELXvCCF7zgBS94wQte8IIX/teBdwHEC17wghe84AUveMELXvCCF7zgBS94wQte8IIXvOAFL/yvA+8CiBe84AUveMELXvCCF7zgBS94wQte8IIXvOAFL3jBC174XwfeBRAveMELXvCCF7zgBS94wQte8IIXvOAFL3jBC17wghe88L8O/ksLIOfPn2fIkCG0bt2a3/zmN9x8881kZ2cDkJCQQIsWLYiLiyMuLo5Zs2ZVv3fy5En69etHq1atiI2NZcOGDf/eUXjh//PglR0v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P/cLgX6AfcDzxtNLsG6A+hMbkUfh8JqcanVjb2AGC/8bueZIK7gCnAdOAQcALJz8sl8EkQHIeuYzaw/cs+sA/oDfwI3AYsR3anwNp+pAqm1SDsgxwK5kRBB/uuGEisgu01hNM9wHFoPfjv/Hy5IWe2NhEurYE84ALQCCgzXGqaXF1C9vZaZMv+6ge3V8AbfhAPrAFuBjoBc4GmQCm0eC2Tw6+0lU4chbBnc6hHMQfu+w2EGj6rjC6X7P3PodefvuMgrSh4MUqf1UW6lGJ/X2t/9wI6QFDHAkoGhMEfDe8lRpeuQEPjUW+kxzcDs2bAubVw2xJ4/yrITkvzWZ2A+cAwYCfwDLAaqAW8b+Nvh+ThQSQz55DMHDV+9AVWAHuQDEwGvgceAGbZ+8VAY6R/rwEzkM04YHz8Btn6jkbPkcfg6abS/QnAYOPhIODJCjjgJ3oXAv5AOfAY8AZONmsjv9Me8LO+lljfNwGP2vfLgeeQjOXr3VrXlnBxSpCT2T1IrlKAhxG/J9l7Hj4+YG2dNzwD7Pn1hue9iNfjRb9aX5Rw8e0gvXM7UGq4vm602G74gfAos7872VhmGy1rzICMtXDvEph+FWTn/lxoGCTe1ATaGK0vIPtyCfHwR6RTBUhWfkK2vg3Sg/PARJwNKkDy42vPNkKxyiokIyusvXuBIPu7EvHGD9hldP/RaFWM7OJaqv07KShu6gu8dwyeaypb4WvPbgQygXeBa81OLTcC9EJ6cR7p/gpkLycCQ5F/KUO2pRnwKfI1zYEFwOmL8Eot+MjGg425teHeBehv4/W1Z4qNNjvtOc//R1EsVg/42MZ2HNnMm40PbZAON0J6NRPJ7RxgLPAi8MwMOL8WWiyBH6+S7GQESbZ7o5hho+FcjHj1itH2Opx9qAkEI97uKoc/+ov3u+1dP6QLvYGLyM4cw+niHqSDzaydmsj/HEU8G2h/bwLOIv2rQDHo9ovQupbirNuBNKTb7yO
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": "<Figure size 2000x500 with 22 Axes>",
"image/png": "iVBORw0KG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cuBSR6gomRW3lLWjRv3MAAAAAAAAAADhItgDSxXJN12P9WKqiokObBZCqfjZZR92yi1owtw0AAAAAAAAAQJVkCiBN7hZw/SgslzZ853EpglgLJU2XzS8TqvARsg0AAAAAAAAAACySKYCEuFvA5WObfIolluKG67qqHqsqVDQp9jQtgFDwAAAAAAAAAADEIpkCyKqmd3NYCyC+d26UrcenyNCkuOFSePGd5rLOEHfbID4cTwAAAAAAAACp8SqAvP3227rlllu0fft2XX311brxxht1+PBhSdKxY8d000036YorrtBVV12lp59+em25qmm+JgfYXe7o8G3Xd1rT9qoKJfltDcVlnXXz1rX9/uXekfSwfl77JP2fkv5c0n+VJL3++uudZAd2/RZAzmRH+j9EduCH7MCK7MCK7MCK7MCqKDvH16b+xm/8BtlBCbKDJnjdghXZQfe87wDZs2ePXnzxRf3zP/+zbr75Zv32b/+2JGlhYUHXXnutDh06pP379+u3fuu39M4779ROa8rnY63Kfi57zGV533X7Lr86T9M7M6zzhRz4/i29qDd0t6T/VdKVkh4/s459+3rJDlLyUUn/m8gO/JEdWJEdWJEdWJEdWOWz89drU3bt2kV2UIHsoAlet2BFdtAtrwLIeeedp49//OOampqSJF177bV6+eWXJUnf+MY39MUvflHSmRfKSy65RE899VTttLxTp07p5MmTZ32Vcf24paZ3NVS157PuUAUG610ZTdXt7+rp5+j/1j5JUz/9eYukFUnSt771rc6zg5S
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-07-27 17:16:08 +02:00
"fig, ax = plt.subplots(shape[0],shape[1], figsize=(20,5))\n",
"\n",
2023-07-27 17:16:08 +02:00
"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')\n",
" #ax[i,j].plot(center[i,j,0], center[i,j,1], markersize=15,marker='x')\n",
2023-07-27 17:16:08 +02:00
"plt.show()\n",
"\n",
2023-07-27 17:16:08 +02:00
"fig, ax = plt.subplots(shape[0],shape[1], figsize=(20,5))\n",
"\n",
"for i in range(0,shape[0]):\n",
" for j in range(0,shape[1]):\n",
" ax[i,j].pcolormesh(thresh[i,j], cmap='jet')\n",
"plt.show()\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:16:18.076087600Z",
"start_time": "2023-08-01T15:16:11.378249600Z"
}
}
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[[58. 44.]\n",
" [36. 29.]\n",
" [35. 31.]\n",
" [34. 30.]\n",
" [32. 29.]\n",
" [35. 31.]\n",
" [35. 30.]\n",
" [35. 31.]\n",
" [35. 31.]\n",
" [35. 28.]\n",
" [39. 33.]]\n",
"\n",
" [[27. 27.]\n",
" [29. 29.]\n",
" [34. 17.]\n",
" [24. 25.]\n",
" [32. 31.]\n",
" [34. 24.]\n",
" [32. 27.]\n",
" [23. 23.]\n",
" [30. 22.]\n",
" [31. 26.]\n",
" [31. 27.]]]\n"
]
}
],
"source": [
"print(BEC_width_guess)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:47:24.382090900Z",
"start_time": "2023-08-01T13:47:24.263490300Z"
}
}
},
{
"cell_type": "code",
"execution_count": 36,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 0, 0\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 3567\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.02337656\n",
" reduced chi-square = 9.5806e-05\n",
" Akaike info crit = -2307.37055\n",
" Bayesian info crit = -2286.24179\n",
" R-squared = 0.90568814\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 153.441480 (init = 124.0604)\n",
" x0_th: 124.776093 (init = 124.0604)\n",
" amp_bec: 0.00432072 (init = 0.07733014)\n",
" amp_th: 0.09064429 (init = 0.03314149)\n",
" deltax: 33.1535731 (init = 174)\n",
" sigma_bec: 33.4779285 (init = 47.54098)\n",
" sigma_th: 38.3316017 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 1\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 5187\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.03635169\n",
" reduced chi-square = 1.4898e-04\n",
" Akaike info crit = -2196.99384\n",
" Bayesian info crit = -2175.86508\n",
" R-squared = 0.97313579\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.297500 (init = 123.2258)\n",
" x0_th: 124.762485 (init = 123.2258)\n",
" amp_bec: 0.11703212 (init = 0.2043726)\n",
" amp_th: 0.16304627 (init = 0.08758826)\n",
" deltax: 34.4497537 (init = 108)\n",
" sigma_bec: 15.6081798 (init = 29.5082)\n",
" sigma_th: 27.7093420 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 2\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 5761\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.03801295\n",
" reduced chi-square = 1.5579e-04\n",
" Akaike info crit = -2185.82230\n",
" Bayesian info crit = -2164.69353\n",
" R-squared = 0.98428608\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.044918 (init = 124.1987)\n",
" x0_th: 125.036027 (init = 124.1987)\n",
" amp_bec: 0.21041411 (init = 0.2749891)\n",
" amp_th: 0.16877035 (init = 0.1178525)\n",
" deltax: 29.3582083 (init = 105)\n",
" sigma_bec: 18.1900164 (init = 28.68852)\n",
" sigma_th: 26.7036423 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 3\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 7264\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.03910902\n",
" reduced chi-square = 1.6028e-04\n",
" Akaike info crit = -2178.71578\n",
" Bayesian info crit = -2157.58701\n",
" R-squared = 0.98976751\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.937119 (init = 124.2885)\n",
" x0_th: 125.005157 (init = 124.2885)\n",
" amp_bec: 0.26835003 (init = 0.348317)\n",
" amp_th: 0.20693134 (init = 0.1492787)\n",
" deltax: 17.5801548 (init = 102)\n",
" sigma_bec: 19.5988377 (init = 27.86885)\n",
" sigma_th: 21.4929856 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 4\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 7777\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.06306629\n",
" reduced chi-square = 2.5847e-04\n",
" Akaike info crit = -2059.25745\n",
" Bayesian info crit = -2038.12868\n",
" R-squared = 0.98860374\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 115.616389 (init = 124.8436)\n",
" x0_th: 126.137165 (init = 124.8436)\n",
" amp_bec: 0.07905547 (init = 0.4125246)\n",
" amp_th: 0.58134074 (init = 0.1767962)\n",
" deltax: 14.0284362 (init = 96)\n",
" sigma_bec: 9.68587168 (init = 26.22951)\n",
" sigma_th: 13.3882008 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 5\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 5811\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.03483722\n",
" reduced chi-square = 1.4278e-04\n",
" Akaike info crit = -2207.63249\n",
" Bayesian info crit = -2186.50372\n",
" R-squared = 0.99458794\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.026522 (init = 124.4716)\n",
" x0_th: 125.174821 (init = 124.4716)\n",
" amp_bec: 0.36935323 (init = 0.4431705)\n",
" amp_th: 0.24363800 (init = 0.1899302)\n",
" deltax: 6.66148730 (init = 105)\n",
" sigma_bec: 21.7020486 (init = 28.68852)\n",
" sigma_th: 17.1663451 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 6\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 7956\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.04184668\n",
" reduced chi-square = 1.7150e-04\n",
" Akaike info crit = -2161.80093\n",
" Bayesian info crit = -2140.67217\n",
" R-squared = 0.99485713\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.897553 (init = 124.226)\n",
" x0_th: 125.376350 (init = 124.226)\n",
" amp_bec: 0.46053971 (init = 0.4840948)\n",
" amp_th: 0.22040635 (init = 0.2074692)\n",
" deltax: 3.11293969 (init = 105)\n",
" sigma_bec: 22.9411327 (init = 28.68852)\n",
" sigma_th: 16.1112986 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 7\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 7452\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.02845081\n",
" reduced chi-square = 1.1660e-04\n",
" Akaike info crit = -2258.25987\n",
" Bayesian info crit = -2237.13111\n",
" R-squared = 0.99692969\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.032801 (init = 124.3744)\n",
" x0_th: 124.841135 (init = 124.3744)\n",
" amp_bec: 0.56271619 (init = 0.5310693)\n",
" amp_th: 0.16185082 (init = 0.2276011)\n",
" deltax: 0.00000000 (init = 105)\n",
" sigma_bec: 23.2491118 (init = 28.68852)\n",
" sigma_th: 14.6934387 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 8\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 3499\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.04803040\n",
" reduced chi-square = 1.9685e-04\n",
" Akaike info crit = -2127.34550\n",
" Bayesian info crit = -2106.21673\n",
" R-squared = 0.99523669\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.187040 (init = 124.4929)\n",
" x0_th: 103.882350 (init = 124.4929)\n",
" amp_bec: 0.73222993 (init = 0.5422824)\n",
" amp_th: 0.01624567 (init = 0.2324067)\n",
" deltax: 0.12250819 (init = 105)\n",
" sigma_bec: 23.6013336 (init = 28.68852)\n",
" sigma_th: 14.9795021 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 9\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 7693\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.05382463\n",
" reduced chi-square = 2.2059e-04\n",
" Akaike info crit = -2098.87128\n",
" Bayesian info crit = -2077.74251\n",
" R-squared = 0.99533610\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.117746 (init = 124.4059)\n",
" x0_th: 124.544314 (init = 124.4059)\n",
" amp_bec: 0.57923202 (init = 0.581434)\n",
" amp_th: 0.23327823 (init = 0.249186)\n",
" deltax: 0.00000000 (init = 105)\n",
" sigma_bec: 23.1733612 (init = 28.68852)\n",
" sigma_th: 14.6455643 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 0, 10\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 10166\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.05277411\n",
" reduced chi-square = 2.1629e-04\n",
" Akaike info crit = -2103.79887\n",
" Bayesian info crit = -2082.67011\n",
" R-squared = 0.99394216\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 133.724792 (init = 124.6719)\n",
" x0_th: 118.917613 (init = 124.6719)\n",
" amp_bec: 0.42527821 (init = 0.4817168)\n",
" amp_th: 0.61356960 (init = 0.2064501)\n",
" deltax: 0.00000000 (init = 117)\n",
" sigma_bec: 15.5658200 (init = 31.96721)\n",
" sigma_th: 9.83759826 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 0\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 2238\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.33913708\n",
" reduced chi-square = 0.00138991\n",
" Akaike info crit = -1638.70295\n",
" Bayesian info crit = -1617.57418\n",
" R-squared = 0.35479840\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 109.225323 (init = 122.4314)\n",
" x0_th: 127.195567 (init = 122.4314)\n",
" amp_bec: 0.01684626 (init = 0.115638)\n",
" amp_th: 0.07190229 (init = 0.04955914)\n",
" deltax: 44.3174542 (init = 81)\n",
" sigma_bec: 38.9759514 (init = 22.13115)\n",
" sigma_th: 47.5892426 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 1\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 4578\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.27270940\n",
" reduced chi-square = 0.00111766\n",
" Akaike info crit = -1693.20236\n",
" Bayesian info crit = -1672.07360\n",
" R-squared = 0.83115399\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 125.650627 (init = 123.7637)\n",
" x0_th: 125.603005 (init = 123.7637)\n",
" amp_bec: 0.14297581 (init = 0.2335334)\n",
" amp_th: 0.14659021 (init = 0.1000857)\n",
" deltax: 43.7665291 (init = 87)\n",
" sigma_bec: 14.7954170 (init = 23.77049)\n",
" sigma_th: 32.0217656 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 2\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 6309\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.47729229\n",
" reduced chi-square = 0.00195612\n",
" Akaike info crit = -1553.27178\n",
" Bayesian info crit = -1532.14301\n",
" R-squared = 0.87474842\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 89.8231472 (init = 123.6648)\n",
" x0_th: 125.374090 (init = 123.6648)\n",
" amp_bec: 0.09613615 (init = 0.3626067)\n",
" amp_th: 0.48481876 (init = 0.1554029)\n",
" deltax: 20.4998269 (init = 102)\n",
" sigma_bec: 4.89952002 (init = 27.86885)\n",
" sigma_th: 13.7154070 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 3\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 5464\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.34785756\n",
" reduced chi-square = 0.00142565\n",
" Akaike info crit = -1632.35577\n",
" Bayesian info crit = -1611.22701\n",
" R-squared = 0.92340765\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.278073 (init = 123.0047)\n",
" x0_th: 126.131819 (init = 123.0047)\n",
" amp_bec: 0.29775761 (init = 0.3912519)\n",
" amp_th: 0.20374123 (init = 0.1676794)\n",
" deltax: 18.7921671 (init = 72)\n",
" sigma_bec: 20.1430739 (init = 19.67213)\n",
" sigma_th: 22.4647652 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 4\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 4523\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.30733891\n",
" reduced chi-square = 0.00125959\n",
" Akaike info crit = -1663.31628\n",
" Bayesian info crit = -1642.18751\n",
" R-squared = 0.94464764\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.969451 (init = 121.5974)\n",
" x0_th: 126.703300 (init = 121.5974)\n",
" amp_bec: 0.44330500 (init = 0.3992703)\n",
" amp_th: 0.10684316 (init = 0.1711158)\n",
" deltax: 26.0476983 (init = 96)\n",
" sigma_bec: 21.9421230 (init = 26.22951)\n",
" sigma_th: 27.3601294 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 5\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 6343\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.36323407\n",
" reduced chi-square = 0.00148866\n",
" Akaike info crit = -1621.54219\n",
" Bayesian info crit = -1600.41342\n",
" R-squared = 0.95552477\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 123.945322 (init = 125.6102)\n",
" x0_th: 127.165697 (init = 125.6102)\n",
" amp_bec: 0.38581784 (init = 0.4918795)\n",
" amp_th: 0.28603710 (init = 0.2108055)\n",
" deltax: 4.89169118 (init = 102)\n",
" sigma_bec: 22.4910822 (init = 27.86885)\n",
" sigma_th: 16.7482600 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 6\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 5942\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.32298403\n",
" reduced chi-square = 0.00132371\n",
" Akaike info crit = -1650.90333\n",
" Bayesian info crit = -1629.77456\n",
" R-squared = 0.96675892\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 123.954692 (init = 123)\n",
" x0_th: 127.162708 (init = 123)\n",
" amp_bec: 0.46356390 (init = 0.5517363)\n",
" amp_th: 0.28052674 (init = 0.2364584)\n",
" deltax: 0.00000000 (init = 96)\n",
" sigma_bec: 23.3349116 (init = 26.22951)\n",
" sigma_th: 14.7476641 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 7\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 4170\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.36801150\n",
" reduced chi-square = 0.00150824\n",
" Akaike info crit = -1618.27550\n",
" Bayesian info crit = -1597.14673\n",
" R-squared = 0.97141166\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.437977 (init = 124.8898)\n",
" x0_th: 129.277304 (init = 124.8898)\n",
" amp_bec: 0.67483443 (init = 0.618981)\n",
" amp_th: 0.17462262 (init = 0.2652776)\n",
" deltax: 0.00000000 (init = 69)\n",
" sigma_bec: 23.2066942 (init = 18.85246)\n",
" sigma_th: 14.6666308 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 8\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 6185\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.53609694\n",
" reduced chi-square = 0.00219712\n",
" Akaike info crit = -1524.22530\n",
" Bayesian info crit = -1503.09653\n",
" R-squared = 0.96187022\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 135.571193 (init = 124.2619)\n",
" x0_th: 124.773959 (init = 124.2619)\n",
" amp_bec: 0.21252338 (init = 0.648623)\n",
" amp_th: 0.95601004 (init = 0.2779813)\n",
" deltax: 22.4402001 (init = 90)\n",
" sigma_bec: 1.61326322 (init = 24.59016)\n",
" sigma_th: 12.6436060 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 9\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 2897\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.36752607\n",
" reduced chi-square = 0.00150625\n",
" Akaike info crit = -1618.60549\n",
" Bayesian info crit = -1597.47672\n",
" R-squared = 0.97165517\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 124.670819 (init = 124.2739)\n",
" x0_th: 152.268084 (init = 124.2739)\n",
" amp_bec: 0.81785867 (init = 0.6808652)\n",
" amp_th: 0.02689453 (init = 0.2917994)\n",
" deltax: 14.9118820 (init = 93)\n",
" sigma_bec: 23.4840073 (init = 25.40984)\n",
" sigma_th: 22.5662475 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"image 1, 10\n",
"[[Fit Statistics]]\n",
" # fitting method = differential_evolution\n",
" # function evals = 9555\n",
" # data points = 250\n",
" # variables = 6\n",
" chi-square = 0.43920688\n",
" reduced chi-square = 0.00180003\n",
" Akaike info crit = -1574.06141\n",
" Bayesian info crit = -1552.93264\n",
" R-squared = 0.96007591\n",
"## Warning: uncertainties could not be estimated:\n",
" this fitting method does not natively calculate uncertainties\n",
" and numdifftools is not installed for lmfit to do this. Use\n",
" `pip install numdifftools` for lmfit to estimate uncertainties\n",
" with this fitting method.\n",
"[[Variables]]\n",
" x0_bec: 116.033383 (init = 125.2517)\n",
" x0_th: 131.505534 (init = 125.2517)\n",
" amp_bec: 0.47031236 (init = 0.5626007)\n",
" amp_th: 0.66708963 (init = 0.2411146)\n",
" deltax: 2.7715e-05 (init = 93)\n",
" sigma_bec: 16.0906185 (init = 25.40984)\n",
" sigma_th: 10.1692852 == '0.632*sigma_bec + 0.518*deltax'\n",
"\n",
"\n",
"total time: 39506.48522377014 ms\n"
]
}
],
"source": [
2023-07-20 20:34:19 +02:00
"# from opencv import moments\n",
"start = time.time()\n",
"\n",
"shape = np.shape(cropOD)\n",
"thresh = calc_thresh(cropOD)\n",
2023-07-20 20:34:19 +02:00
"center = calc_cen_bulk(thresh)\n",
"# print(center)\n",
2023-07-20 20:34:19 +02:00
"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",
2023-07-27 17:16:08 +02:00
"x = np.linspace(0,shape[3],shape[3])\n",
"y = np.linspace(0,shape[2], shape[2])\n",
2023-07-20 20:34:19 +02:00
"\n",
"\n",
"max_val = np.zeros((shape[0], shape[1]))\n",
2023-07-20 20:34:19 +02:00
"\n",
"for i in range(0, shape[0]):\n",
" max_val[i] = np.ndarray.max(X_guess_og[i], axis=1)\n",
2023-07-20 20:34:19 +02:00
"\n",
"# Fitting x without math constr\n",
"fitmodel = lmfit.Model(density_1d,independent_vars=['x'])\n",
"\n",
"result_x = []\n",
"\n",
"for i in range(0, shape[0]):\n",
" temp_res = []\n",
" for j in range(0, shape[1]):\n",
" print(f'image {i}, {j}')\n",
2023-07-26 09:41:51 +02:00
" t1 = time.time()\n",
2023-07-20 20:34:19 +02:00
" params = lmfit.Parameters()\n",
" params.add_many(\n",
" ('x0_bec', center[i,j,0], True,0, 200),\n",
" ('x0_th',center[i,j,0], True,0, 200),\n",
" ('amp_bec', 0.7 * max_val[i,j], True, 0, 1.3 * np.max(X_guess_og[i,j])),\n",
" ('amp_th', 0.3 * max_val[i,j], True, 0, 1.3 * np.max(X_guess_og[i,j])),\n",
" ('deltax', 3*BEC_width_guess[i,j,0], True, 0,cut_width),\n",
" # ('sigma_bec',BEC_width_guess[i,j,0]/1.22, True, 0, 50)\n",
2023-07-27 17:16:08 +02:00
" ('sigma_bec',BEC_width_guess[i,j,0]/1.22, True, 0, 50)\n",
2023-07-26 09:41:51 +02:00
" )\n",
2023-07-27 17:16:08 +02:00
" params.add('sigma_th', 3*BEC_width_guess[i,j,0], min=0, expr=f'0.632*sigma_bec + 0.518*deltax')\n",
" # params.pretty_print()\n",
2023-07-26 09:41:51 +02:00
"\n",
" # params.add('sigma_th', 3*BEC_width_guess[i,j,0], True, min=0,max=150)\n",
2023-07-26 09:41:51 +02:00
" t2 = time.time()\n",
" res = fitmodel.fit(X_guess_og[i,j], x=x, params=params)\n",
" t3 = time.time()\n",
" temp_res.append(res)\n",
" t4 = time.time()\n",
2023-07-27 17:16:08 +02:00
" # print(t2 - t1)\n",
" # print(t3 - t2)\n",
" # print(t4 - t3)\n",
" # print(\"\")\n",
"\n",
" lmfit.report_fit(res)\n",
" print()\n",
"\n",
" print()\n",
2023-07-26 09:41:51 +02:00
" result_x.append(temp_res)\n",
"stop = time.time()\n",
"\n",
"print(f'total time: {(stop-start)*1e3} ms')"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-02T16:09:49.075495200Z",
"start_time": "2023-08-02T16:09:09.547382400Z"
2023-07-26 09:41:51 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 26,
2023-07-26 09:41:51 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.11047163542693593\n"
2023-07-26 09:41:51 +02:00
]
}
],
"source": [
"print(np.max(X_guess_og[0][0]))"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-02T15:35:15.416425700Z",
"start_time": "2023-08-02T15:35:15.372503500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 8,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image: 0, 0\n",
"x0_bec: 142.004, (init = 124.060), bounds = [0.00 : 200.00] \n",
"x0_th: 124.284, (init = 124.060), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.007, (init = 0.077), bounds = [0.00 : 0.14] \n",
"amp_th: 0.088, (init = 0.033), bounds = [0.00 : 0.14] \n",
"sigma_bec: 46.836, (init = 47.541), bounds = [0.00 : 50.00] \n",
"sigma_th: 38.731, (init = 120.178), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 1\n",
"x0_bec: 125.256, (init = 123.226), bounds = [0.00 : 200.00] \n",
"x0_th: 124.785, (init = 123.226), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.122, (init = 0.204), bounds = [0.00 : 0.38] \n",
"amp_th: 0.164, (init = 0.088), bounds = [0.00 : 0.38] \n",
"sigma_bec: 15.416, (init = 29.508), bounds = [0.00 : 50.00] \n",
"sigma_th: 27.656, (init = 74.593), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 2\n",
"x0_bec: 125.039, (init = 124.199), bounds = [0.00 : 200.00] \n",
"x0_th: 125.046, (init = 124.199), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.214, (init = 0.275), bounds = [0.00 : 0.51] \n",
"amp_th: 0.170, (init = 0.118), bounds = [0.00 : 0.51] \n",
"sigma_bec: 18.047, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 26.639, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 3\n",
"x0_bec: 124.926, (init = 124.288), bounds = [0.00 : 200.00] \n",
"x0_th: 125.027, (init = 124.288), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.273, (init = 0.348), bounds = [0.00 : 0.65] \n",
"amp_th: 0.207, (init = 0.149), bounds = [0.00 : 0.65] \n",
"sigma_bec: 19.490, (init = 27.869), bounds = [0.00 : 50.00] \n",
"sigma_th: 21.472, (init = 70.449), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 4\n",
"x0_bec: 125.124, (init = 124.844), bounds = [0.00 : 200.00] \n",
"x0_th: 125.193, (init = 124.844), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.371, (init = 0.413), bounds = [0.00 : 0.77] \n",
"amp_th: 0.199, (init = 0.177), bounds = [0.00 : 0.77] \n",
"sigma_bec: 20.901, (init = 26.230), bounds = [0.00 : 50.00] \n",
"sigma_th: 20.335, (init = 66.305), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 5\n",
"x0_bec: 125.059, (init = 124.472), bounds = [0.00 : 200.00] \n",
"x0_th: 125.087, (init = 124.472), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.362, (init = 0.443), bounds = [0.00 : 0.82] \n",
"amp_th: 0.257, (init = 0.190), bounds = [0.00 : 0.82] \n",
"sigma_bec: 21.613, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 16.823, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 6\n",
"x0_bec: 124.891, (init = 124.226), bounds = [0.00 : 200.00] \n",
"x0_th: 125.353, (init = 124.226), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.446, (init = 0.484), bounds = [0.00 : 0.90] \n",
"amp_th: 0.241, (init = 0.207), bounds = [0.00 : 0.90] \n",
"sigma_bec: 22.882, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 15.696, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 7\n",
"x0_bec: 125.045, (init = 124.374), bounds = [0.00 : 200.00] \n",
"x0_th: 124.786, (init = 124.374), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.561, (init = 0.531), bounds = [0.00 : 0.99] \n",
"amp_th: 0.167, (init = 0.228), bounds = [0.00 : 0.99] \n",
"sigma_bec: 23.194, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.658, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 8\n",
"x0_bec: 125.082, (init = 124.493), bounds = [0.00 : 200.00] \n",
"x0_th: 124.756, (init = 124.493), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.593, (init = 0.542), bounds = [0.00 : 1.01] \n",
"amp_th: 0.162, (init = 0.232), bounds = [0.00 : 1.01] \n",
"sigma_bec: 23.255, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.697, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 9\n",
"x0_bec: 125.148, (init = 124.406), bounds = [0.00 : 200.00] \n",
"x0_th: 124.448, (init = 124.406), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.578, (init = 0.581), bounds = [0.00 : 1.08] \n",
"amp_th: 0.239, (init = 0.249), bounds = [0.00 : 1.08] \n",
"sigma_bec: 23.096, (init = 28.689), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.596, (init = 72.521), bounds = [0.00 : inf] \n",
"\n",
"image: 0, 10\n",
"x0_bec: 125.177, (init = 124.672), bounds = [0.00 : 200.00] \n",
"x0_th: 33.642, (init = 124.672), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.667, (init = 0.482), bounds = [0.00 : 0.89] \n",
"amp_th: 0.001, (init = 0.206), bounds = [0.00 : 0.89] \n",
"sigma_bec: 25.278, (init = 31.967), bounds = [0.00 : 50.00] \n",
"sigma_th: 49.148, (init = 80.809), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 0\n",
"x0_bec: 115.300, (init = 122.431), bounds = [0.00 : 200.00] \n",
"x0_th: 124.861, (init = 122.431), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.017, (init = 0.116), bounds = [0.00 : 0.21] \n",
"amp_th: 0.079, (init = 0.050), bounds = [0.00 : 0.21] \n",
"sigma_bec: 15.995, (init = 22.131), bounds = [0.00 : 50.00] \n",
"sigma_th: 46.606, (init = 55.945), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 1\n",
"x0_bec: 125.641, (init = 123.764), bounds = [0.00 : 200.00] \n",
"x0_th: 125.645, (init = 123.764), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.147, (init = 0.234), bounds = [0.00 : 0.43] \n",
"amp_th: 0.147, (init = 0.100), bounds = [0.00 : 0.43] \n",
"sigma_bec: 14.760, (init = 23.770), bounds = [0.00 : 50.00] \n",
"sigma_th: 31.996, (init = 60.089), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 2\n",
"x0_bec: 125.476, (init = 123.665), bounds = [0.00 : 200.00] \n",
"x0_th: 121.336, (init = 123.665), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.349, (init = 0.363), bounds = [0.00 : 0.67] \n",
"amp_th: 0.115, (init = 0.155), bounds = [0.00 : 0.67] \n",
"sigma_bec: 19.502, (init = 27.869), bounds = [0.00 : 50.00] \n",
"sigma_th: 31.308, (init = 70.449), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 3\n",
"x0_bec: 124.301, (init = 123.005), bounds = [0.00 : 200.00] \n",
"x0_th: 126.112, (init = 123.005), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.301, (init = 0.391), bounds = [0.00 : 0.73] \n",
"amp_th: 0.205, (init = 0.168), bounds = [0.00 : 0.73] \n",
"sigma_bec: 20.053, (init = 19.672), bounds = [0.00 : 50.00] \n",
"sigma_th: 22.374, (init = 49.729), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 4\n",
"x0_bec: 124.986, (init = 121.597), bounds = [0.00 : 200.00] \n",
"x0_th: 126.549, (init = 121.597), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.443, (init = 0.399), bounds = [0.00 : 0.74] \n",
"amp_th: 0.109, (init = 0.171), bounds = [0.00 : 0.74] \n",
"sigma_bec: 21.878, (init = 26.230), bounds = [0.00 : 50.00] \n",
"sigma_th: 27.009, (init = 66.305), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 5\n",
"x0_bec: 123.630, (init = 125.610), bounds = [0.00 : 200.00] \n",
"x0_th: 127.392, (init = 125.610), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.368, (init = 0.492), bounds = [0.00 : 0.91] \n",
"amp_th: 0.313, (init = 0.211), bounds = [0.00 : 0.91] \n",
"sigma_bec: 22.582, (init = 27.869), bounds = [0.00 : 50.00] \n",
"sigma_th: 16.015, (init = 70.449), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 6\n",
"x0_bec: 123.995, (init = 123.000), bounds = [0.00 : 200.00] \n",
"x0_th: 126.963, (init = 123.000), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.454, (init = 0.552), bounds = [0.00 : 1.02] \n",
"amp_th: 0.295, (init = 0.236), bounds = [0.00 : 1.02] \n",
"sigma_bec: 23.228, (init = 26.230), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.680, (init = 66.305), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 7\n",
"x0_bec: 124.486, (init = 124.890), bounds = [0.00 : 200.00] \n",
"x0_th: 129.053, (init = 124.890), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.675, (init = 0.619), bounds = [0.00 : 1.15] \n",
"amp_th: 0.176, (init = 0.265), bounds = [0.00 : 1.15] \n",
"sigma_bec: 23.196, (init = 18.852), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.660, (init = 47.657), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 8\n",
"x0_bec: 125.882, (init = 124.262), bounds = [0.00 : 200.00] \n",
"x0_th: 122.209, (init = 124.262), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.660, (init = 0.649), bounds = [0.00 : 1.20] \n",
"amp_th: 0.231, (init = 0.278), bounds = [0.00 : 1.20] \n",
"sigma_bec: 22.940, (init = 24.590), bounds = [0.00 : 50.00] \n",
"sigma_th: 14.498, (init = 62.161), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 9\n",
"x0_bec: 124.657, (init = 124.274), bounds = [0.00 : 200.00] \n",
"x0_th: 151.041, (init = 124.274), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.817, (init = 0.681), bounds = [0.00 : 1.26] \n",
"amp_th: 0.028, (init = 0.292), bounds = [0.00 : 1.26] \n",
"sigma_bec: 23.461, (init = 25.410), bounds = [0.00 : 50.00] \n",
"sigma_th: 22.517, (init = 64.233), bounds = [0.00 : inf] \n",
"\n",
"image: 1, 10\n",
"x0_bec: 124.870, (init = 125.252), bounds = [0.00 : 200.00] \n",
"x0_th: 167.237, (init = 125.252), bounds = [0.00 : 200.00] \n",
"amp_bec: 0.729, (init = 0.563), bounds = [0.00 : 1.04] \n",
"amp_th: 0.007, (init = 0.241), bounds = [0.00 : 1.04] \n",
"sigma_bec: 26.148, (init = 25.410), bounds = [0.00 : 50.00] \n",
"sigma_th: 16.526, (init = 64.233), bounds = [0.00 : inf] \n",
"\n"
]
}
],
"source": [
"print_bval_bulk(result_x)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:47:36.165187200Z",
"start_time": "2023-08-01T13:47:36.030016100Z"
}
}
},
{
"cell_type": "code",
"execution_count": 37,
"outputs": [
{
"data": {
"text/plain": "<Figure size 1000x500 with 22 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA04AAAGpCAYAAAC6fmaSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOy9e5gcZZk2fr917O45TybJTI6TBBISCDlogIW4ArprVAz7wae4KmtQA/iJ64o/D4h8K8oK+7mIrO4uQRB0ERADIouKCBFIOCUBEsiBJJNkkpnJnDPn7q7z74+33urq00x3z/T0oeq+rrky01VdXV156633fp77uR9iWZYFHz58+PDhw4cPHz58+PCRFlyhT8CHDx8+fPjw4cOHDx8+ih0+cfLhw4cPHz58+PDhw4ePCeATJx8+fPjw4cOHDx8+fPiYAD5x8uHDhw8fPnz48OHDh48J4BMnHz58+PDhw4cPHz58+JgAPnHy4cOHDx8+fPjw4cOHjwngEycfPnz48OHDhw8fPnz4mAA+cfLhw4cPHz58+PDhw4ePCSAU+gTyAdM0cerUKVRVVYEQUujTySssy8LIyAjmzJkDjpuYB3vp2gD+9RkP/rUZH/71SQ//2owP//qMj2yuj39txod/fcaHl66Pf23GR7bXZ7wDlR3a2tosAJ76aWtr86+Nf338a+NfH//aFNGPf30mf338a+NfH//6+NemENcnHcoy41RVVQUAaGtrQ3V1dYHPJjscPXoU119/Pfr7+1FdXY3/+q//wvLly+P22blzJ2688UYAgKIoOHz4MCRJyuj4pXxtcsHw8DDmz5/vfO+J4KXr41+b8eFfn/Twr8348K/P+Mjm+pTytbnsssvw93//9/j0pz+NJ598Ej/+8Y/xwgsvxO3z9NNP40c/+hH+9Kc/QRRFfP/738e//du/+WMnDfx7Kz38azM+sr0+6VCWxImlHKurq0tuMHzta1/DF7/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C8/N3KXHjY3ud3zf+ZAde+PolOR0nE1LpRnNzM06ePImampqcPm+68EOXhJHPsb+AO6uyadOmtFmVzs5OzJ49GxzHOf0/zj333JTHlGUZsizndD5ThahmTslxMh07V199Na6++moAsaBEMcOydLyv6V9BLA7ARwt9Oj5KCaePYrf8Rew1l8AwLy702RQtRN5/sCeixyV9PXN2ZQHPpDhBLBM1GMUQ/GuTCIGPrXGO9Y5i8czSu0b+jDCFIJhcUy0voHUSevFyhWHEYnY8l/sYykTm+fjjj2PlypVYtWoVPvjBDwKAYyhRjFD0yWdxyxmLhZewp3YQb9WdxomOA4U+naKFHxVPRs2R36KSRHERvx9GeGDiN3gUwiTm5HLFcERzfteN3O+uTFpomKaJG2+8EStWrMC5556Lyy67LOfPmy58vON2vCFfj/dxb0+JEqmcEBRjbsd/3NdVwDPJHT5xmkJMshmxDw/i7fZBPLO/E2eQdshQJ0WcMtHT33DDDdi/fz/27t2L119/HcDku2jnE4bLcCWs6uPs6U3MEk85v3f25W6+Uq44jxzEjcJjkA1fbpUIEokZinDDHQU8k+KG4GeckjAcdROn3FUBmbTQeOqpp/Dyyy9j7969ePvttyfsc1VoqJqBDyjbIBATXxZ+i75R35jGjffUa7hF+G+sIUcwq6qwipZc4c8IUwiuiBeghcZC0oULOBoRV/WpkV+VAzb+9GV8ln8Wz8nfwB3izyZFnMoR7nvqe//jZ1QSUcnHMgVDI7k7QmYS+QWAd955BxdffDHWrVsHIH3/uGKAZVl4TP4+/lF4EhdHit/oY7rBj7Q7v5NwatdRH4DI+3NyIvpHVed3LUc
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAi8AAAGZCAYAAABBr9GxAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpA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v9+a1u+eLGeUxX2ZfcxEoMZTUxTyqUFYbQQ8SIIwgGnqcNK1m2oDuP15DsvlngpDVj9X5xhI2f+yqSKIAsnlwNw/2s77N8XOC9ZsVIV9gP76rzkXl/cF0EYPUS8CIJwwGlyhY2KOy8TywOA1aTuPx5Yw4eue5aerAuja+DzaCydM8F6rmMidWNb1OWKqLBRRbafzD5VG2XMot8LgnBgEfEiCMIBp9kZNrKdFysUE81WG02qsEqhO6NJbn9hG682dfHG9i4Agj4PmqaxZHaNvc+ygBdNs5yatr7ctOlc2Mjv+nlvcDkvkrQrCKOGiBdBEA4ovfEUHRFLXNRXh+yEXbD6v/TZzoslXjbt6bOdFTUKoMqTgFSM42dW288/enoVUyqsCiRn6Eg5L5XhkXBejKLfC4JwYPGO9gEIgnBo0ZzNd6ku8VMW9LlyWtKGSTTpbkKnIkKLtK0c99rtPBN4iWlmG/wUSv2l3FF2OLf3HsfsqZ/AMEx2dMXY2hbh+BnVQC7JtzLrvOxLh920I1QkzosgjB4iXgRBOKA4810Al/OSLuK81NLFz3w3cbL3Vdb1+tkW1ujM+JmdShFO9nECL3CC/wXSGx7hj5VX8AwTaWwbeefFMExXbo0k7ArC6CHiRRCEA4oz3wXyxEvGIJrMiZdT9De5tPR6/lzl45uhaWS
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
2023-07-27 17:16:08 +02:00
"fsize= (10,5)\n",
2023-07-20 20:34:19 +02:00
"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",
" bval = result_x[i][j].best_values\n",
" ax[i,j].plot(x, X_guess_og[i,j])\n",
2023-07-27 17:16:08 +02:00
" ax[i,j].plot(x, density_1d(x, **result_x[i][j].best_values))\n",
2023-07-20 20:34:19 +02:00
" ax[i,j].plot(x, thermal(x, bval['x0_th'], bval['amp_th'], bval['sigma_th']))\n",
"\n",
2023-07-20 20:34:19 +02:00
"\n",
"plt.show()\n",
"\n",
"bval = result_x[0][0].best_values\n",
"plt.plot(x, X_guess_og[0,0])\n",
"plt.plot(x, density_1d(x, **result_x[0][0].best_values))\n",
"plt.plot(x, thermal(x, bval['x0_th'], bval['amp_th'], bval['sigma_th']))\n",
"plt.show()\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-02T16:09:57.213069400Z",
"start_time": "2023-08-02T16:09:54.252121900Z"
}
}
},
{
2023-07-27 17:16:08 +02:00
"cell_type": "markdown",
"source": [
2023-07-27 17:16:08 +02:00
"## 2D Fit without mathematical constraint"
2023-07-20 20:34:19 +02:00
],
"metadata": {
2023-07-27 17:16:08 +02:00
"collapsed": false
2023-07-20 20:34:19 +02:00
}
},
{
"cell_type": "code",
"execution_count": 166,
"outputs": [
{
"data": {
"text/plain": "0.4358651483519299"
},
"execution_count": 166,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.max(gaussian_filter(cropOD[1][1], sigma=1))\n",
"S = np.max(gaussian_filter(data, sigma=1))/(bval_1d['amp_bec'] + bval_1d['amp_th'])\n",
"print(S)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:14:57.791180400Z",
"start_time": "2023-08-01T13:14:57.674401100Z"
}
}
},
{
"cell_type": "code",
"execution_count": 19,
2023-07-20 20:34:19 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
2023-07-27 17:16:08 +02:00
"image 0,0\n",
"{'x0_bec': 142.00445054598697, 'x0_th': 124.28433053144651, 'amp_bec': 0.007373864322594913, 'amp_th': 0.0875248828973439, 'sigma_bec': 46.835962030049785, 'sigma_th': 38.73088055278765}\n",
"Image seems to be purely thermal (guessed from 1d fit amplitude)\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0 0 0.402 None False None None\n",
"amp_th 0.1352 0 0.402 None True None None\n",
"sigma_th 38.73 0 250 None True None None\n",
"sigmax_bec 1 -inf inf None False None None\n",
"sigmay_bec 1 -inf inf None False None None\n",
"x0_bec 1 -inf inf None False None None\n",
"x0_th 124.1 114.1 134.1 None True None None\n",
"y0_bec 1 -inf inf None False None None\n",
"y0_th 124.3 114.3 134.3 None True None None\n",
"time 1st fit: 0.242 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 0,1\n",
"{'x0_bec': 125.25577180118816, 'x0_th': 124.78468527561685, 'amp_bec': 0.12152950655479954, 'amp_th': 0.1637417913764779, 'sigma_bec': 15.415704344918188, 'sigma_th': 27.655652447556896}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.1698 0 0.7187 None True None None\n",
"amp_th 0.2287 0 0.7187 None True None None\n",
"sigma_th 27.66 0 250 None True None None\n",
"sigmax_bec 15.42 0 59.02 None True None None\n",
"sigmay_bec 23.77 0 47.54 None True None None\n",
"x0_bec 123.2 113.2 133.2 None True None None\n",
"x0_th 123.2 113.2 133.2 None True None None\n",
"y0_bec 126.1 116.1 136.1 None True None None\n",
"y0_th 126.1 116.1 136.1 None True None None\n",
"time 1st fit: 0.493 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 0,2\n",
"{'x0_bec': 125.03930894042861, 'x0_th': 125.04635162070355, 'amp_bec': 0.2144277721612532, 'amp_th': 0.1696419781395752, 'sigma_bec': 18.04728438783922, 'sigma_th': 26.6394342289486}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.3083 0 0.8679 None True None None\n",
"amp_th 0.2439 0 0.8679 None True None None\n",
"sigma_th 26.64 0 250 None True None None\n",
"sigmax_bec 18.05 0 57.38 None True None None\n",
"sigmay_bec 25.41 0 50.82 None True None None\n",
"x0_bec 124.2 114.2 134.2 None True None None\n",
"x0_th 124.2 114.2 134.2 None True None None\n",
"y0_bec 125.1 115.1 135.1 None True None None\n",
"y0_th 125.1 115.1 135.1 None True None None\n",
"time 1st fit: 0.371 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 0,3\n",
"{'x0_bec': 124.92625233577346, 'x0_th': 125.02682757068777, 'amp_bec': 0.27265942749051736, 'amp_th': 0.20738200828334746, 'sigma_bec': 19.489535904921766, 'sigma_th': 21.471525793182366}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.3762 0 1.067 None True None None\n",
"amp_th 0.2861 0 1.067 None True None None\n",
"sigma_th 21.47 0 250 None True None None\n",
"sigmax_bec 19.49 0 55.74 None True None None\n",
"sigmay_bec 24.59 0 49.18 None True None None\n",
"x0_bec 124.3 114.3 134.3 None True None None\n",
"x0_th 124.3 114.3 134.3 None True None None\n",
"y0_bec 125.4 115.4 135.4 None True None None\n",
"y0_th 125.4 115.4 135.4 None True None None\n",
"time 1st fit: 0.313 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 0,4\n",
"{'x0_bec': 125.12441109737169, 'x0_th': 125.19345014170287, 'amp_bec': 0.3714727519389241, 'amp_th': 0.19908084523127406, 'sigma_bec': 20.901397005132623, 'sigma_th': 20.33510418067732}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.4801 0 1.238 None True None None\n",
"amp_th 0.2573 0 1.238 None True None None\n",
"sigma_th 20.34 0 250 None True None None\n",
"sigmax_bec 20.9 0 52.46 None True None None\n",
"sigmay_bec 23.77 0 47.54 None True None None\n",
"x0_bec 124.8 114.8 134.8 None True None None\n",
"x0_th 124.8 114.8 134.8 None True None None\n",
"y0_bec 125.6 115.6 135.6 None True None None\n",
"y0_th 125.6 115.6 135.6 None True None None\n",
"time 1st fit: 0.292 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,5\n",
"{'x0_bec': 125.05880935383358, 'x0_th': 125.08710237316461, 'amp_bec': 0.3619755295023772, 'amp_th': 0.25678414606161054, 'sigma_bec': 21.61282768969963, 'sigma_th': 16.823200155520258}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.5038 0 1.258 None True None None\n",
"amp_th 0.3574 0 1.258 None True None None\n",
"sigma_th 16.82 0 250 None True None None\n",
"sigmax_bec 21.61 0 57.38 None True None None\n",
"sigmay_bec 25.41 0 50.82 None True None None\n",
"x0_bec 124.5 114.5 134.5 None True None None\n",
"x0_th 124.5 114.5 134.5 None True None None\n",
"y0_bec 125.6 115.6 135.6 None True None None\n",
"y0_th 125.6 115.6 135.6 None True None None\n",
"time 1st fit: 0.335 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,6\n",
"{'x0_bec': 124.8909916649399, 'x0_th': 125.35264471205264, 'amp_bec': 0.44592093863560234, 'amp_th': 0.24131310850250906, 'sigma_bec': 22.881675505502773, 'sigma_th': 15.696093137012516}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.5892 0 1.431 None True None None\n",
"amp_th 0.3189 0 1.431 None True None None\n",
"sigma_th 15.7 0 250 None True None None\n",
"sigmax_bec 22.88 0 57.38 None True None None\n",
"sigmay_bec 24.59 0 49.18 None True None None\n",
"x0_bec 124.2 114.2 134.2 None True None None\n",
"x0_th 124.2 114.2 134.2 None True None None\n",
"y0_bec 125.5 115.5 135.5 None True None None\n",
"y0_th 125.5 115.5 135.5 None True None None\n",
"time 1st fit: 0.294 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,7\n",
"{'x0_bec': 125.04469492751748, 'x0_th': 124.7857884621788, 'amp_bec': 0.5608043784706194, 'amp_th': 0.16682391910241443, 'sigma_bec': 23.193603880722023, 'sigma_th': 14.658357655151772}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.7446 0 1.465 None True None None\n",
"amp_th 0.2215 0 1.465 None True None None\n",
"sigma_th 14.66 0 250 None True None None\n",
"sigmax_bec 23.19 0 57.38 None True None None\n",
"sigmay_bec 25.41 0 50.82 None True None None\n",
"x0_bec 124.4 114.4 134.4 None True None None\n",
"x0_th 124.4 114.4 134.4 None True None None\n",
"y0_bec 125.4 115.4 135.4 None True None None\n",
"y0_th 125.4 115.4 135.4 None True None None\n",
"time 1st fit: 0.246 s\n",
2023-07-27 17:16:08 +02:00
"No thermal part detected, performing fit without thermal function\n",
"time pure bec fit: 0.116 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,8\n",
"{'x0_bec': 125.08153671213292, 'x0_th': 124.7558768216271, 'amp_bec': 0.5927708914537864, 'amp_th': 0.16249800996749553, 'sigma_bec': 23.254998019081764, 'sigma_th': 14.697158756687998}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.84 0 1.622 None True None None\n",
"amp_th 0.2303 0 1.622 None True None None\n",
"sigma_th 14.7 0 250 None True None None\n",
"sigmax_bec 23.25 0 57.38 None True None None\n",
"sigmay_bec 25.41 0 50.82 None True None None\n",
"x0_bec 124.5 114.5 134.5 None True None None\n",
"x0_th 124.5 114.5 134.5 None True None None\n",
"y0_bec 125.5 115.5 135.5 None True None None\n",
"y0_th 125.5 115.5 135.5 None True None None\n",
"time 1st fit: 0.273 s\n",
2023-07-27 17:16:08 +02:00
"No thermal part detected, performing fit without thermal function\n",
"time pure bec fit: 0.132 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,9\n",
"{'x0_bec': 125.14832036671892, 'x0_th': 124.44756415270118, 'amp_bec': 0.5775981297541561, 'amp_th': 0.23938122478229795, 'sigma_bec': 23.095694571065323, 'sigma_th': 14.596478970725943}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.7835 0 1.651 None True None None\n",
"amp_th 0.3247 0 1.651 None True None None\n",
"sigma_th 14.6 0 250 None True None None\n",
"sigmax_bec 23.1 0 57.38 None True None None\n",
"sigmay_bec 22.95 0 45.9 None True None None\n",
"x0_bec 124.4 114.4 134.4 None True None None\n",
"x0_th 124.4 114.4 134.4 None True None None\n",
"y0_bec 125.5 115.5 135.5 None True None None\n",
"y0_th 125.5 115.5 135.5 None True None None\n",
"time 1st fit: 0.349 s\n",
2023-07-27 17:16:08 +02:00
"No thermal part detected, performing fit without thermal function\n",
"time pure bec fit: 0.127 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0,10\n",
"{'x0_bec': 125.17723569835653, 'x0_th': 33.64171959660166, 'amp_bec': 0.6670196979301563, 'amp_th': 0.001172093233604589, 'sigma_bec': 25.278067756513355, 'sigma_th': 49.148384211550834}\n",
"Image seems to be pure BEC (guessed from 1d fit amplitude)\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.896 0 1.4 None True None None\n",
"amp_th 0 -inf inf None False None None\n",
"sigma_th 49.15 0 50 None False None None\n",
"sigmax_bec 25.28 0 63.93 None True None None\n",
"sigmay_bec 27.05 0 63.93 None True None None\n",
"x0_bec 124.7 114.7 134.7 None True None None\n",
"x0_th 1 -inf inf None False None None\n",
"y0_bec 125.5 115.5 135.5 None True None None\n",
"y0_th 1 -inf inf None False None None\n",
"time 1st fit: 0.171 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1,0\n",
"{'x0_bec': 115.2999768678062, 'x0_th': 124.8610881345612, 'amp_bec': 0.017319670376729462, 'amp_th': 0.07888591648540823, 'sigma_bec': 15.994939453828422, 'sigma_th': 46.60622154086924}\n",
"Image seems to be purely thermal (guessed from 1d fit amplitude)\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0 0 1.225 None False None None\n",
"amp_th 0.209 0 1.225 None True None None\n",
"sigma_th 46.61 0 250 None True None None\n",
"sigmax_bec 1 -inf inf None False None None\n",
"sigmay_bec 1 -inf inf None False None None\n",
"x0_bec 1 -inf inf None False None None\n",
"x0_th 122.4 112.4 132.4 None True None None\n",
"y0_bec 1 -inf inf None False None None\n",
"y0_th 127.4 117.4 137.4 None True None None\n",
"time 1st fit: 0.207 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 1,1\n",
"{'x0_bec': 125.64091007896643, 'x0_th': 125.64514313918502, 'amp_bec': 0.14742375240111238, 'amp_th': 0.14686523357432518, 'sigma_bec': 14.7603215515683, 'sigma_th': 31.99614649538574}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.2183 0 1.255 None True None None\n",
"amp_th 0.2175 0 1.255 None True None None\n",
"sigma_th 32 0 250 None True None None\n",
"sigmax_bec 14.76 0 47.54 None True None None\n",
"sigmay_bec 23.77 0 47.54 None True None None\n",
"x0_bec 123.8 113.8 133.8 None True None None\n",
"x0_th 123.8 113.8 133.8 None True None None\n",
"y0_bec 126.1 116.1 136.1 None True None None\n",
"y0_th 126.1 116.1 136.1 None True None None\n",
"time 1st fit: 0.752 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 1,2\n",
"{'x0_bec': 125.47573499952959, 'x0_th': 121.3360031869806, 'amp_bec': 0.3488782243097099, 'amp_th': 0.11461950154784539, 'sigma_bec': 19.50209844607982, 'sigma_th': 31.308229448246607}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.4859 0 1.481 None True None None\n",
"amp_th 0.1596 0 1.481 None True None None\n",
"sigma_th 31.31 0 250 None True None None\n",
"sigmax_bec 19.5 0 55.74 None True None None\n",
"sigmay_bec 13.93 0 27.87 None True None None\n",
"x0_bec 123.7 113.7 133.7 None True None None\n",
"x0_th 123.7 113.7 133.7 None True None None\n",
"y0_bec 129 119 139 None True None None\n",
"y0_th 129 119 139 None True None None\n",
"time 1st fit: 0.463 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 1,3\n",
"{'x0_bec': 124.30117026347911, 'x0_th': 126.11199574611234, 'amp_bec': 0.30069680977837876, 'amp_th': 0.20541314543839723, 'sigma_bec': 20.05319776888755, 'sigma_th': 22.374354426220144}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.4567 0 1.973 None True None None\n",
"amp_th 0.312 0 1.973 None True None None\n",
"sigma_th 22.37 0 250 None True None None\n",
"sigmax_bec 20.05 0 39.34 None True None None\n",
"sigmay_bec 20.49 0 40.98 None True None None\n",
"x0_bec 123 113 133 None True None None\n",
"x0_th 123 113 133 None True None None\n",
"y0_bec 127.8 117.8 137.8 None True None None\n",
"y0_th 127.8 117.8 137.8 None True None None\n",
"time 1st fit: 0.499 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"image 1,4\n",
"{'x0_bec': 124.9862517955858, 'x0_th': 126.54880752038085, 'amp_bec': 0.44349528057747933, 'amp_th': 0.10946111445269097, 'sigma_bec': 21.87846319656666, 'sigma_th': 27.00891763857539}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.6429 0 1.761 None True None None\n",
"amp_th 0.1587 0 1.761 None True None None\n",
"sigma_th 27.01 0 250 None True None None\n",
"sigmax_bec 21.88 0 52.46 None True None None\n",
"sigmay_bec 25.41 0 50.82 None True None None\n",
"x0_bec 121.6 111.6 131.6 None True None None\n",
"x0_th 121.6 111.6 131.6 None True None None\n",
"y0_bec 125.8 115.8 135.8 None True None None\n",
"y0_th 125.8 115.8 135.8 None True None None\n",
"time 1st fit: 0.514 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1,5\n",
"{'x0_bec': 123.62961045437524, 'x0_th': 127.39212821302428, 'amp_bec': 0.36843957335640354, 'amp_th': 0.3129914230267123, 'sigma_bec': 22.581842629500287, 'sigma_th': 16.01451287267635}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.4673 0 1.731 None True None None\n",
"amp_th 0.3969 0 1.731 None True None None\n",
"sigma_th 16.01 0 250 None True None None\n",
"sigmax_bec 22.58 0 55.74 None True None None\n",
"sigmay_bec 19.67 0 39.34 None True None None\n",
"x0_bec 125.6 115.6 135.6 None True None None\n",
"x0_th 125.6 115.6 135.6 None True None None\n",
"y0_bec 129.1 119.1 139.1 None True None None\n",
"y0_th 129.1 119.1 139.1 None True None None\n",
"time 1st fit: 0.429 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1,6\n",
"{'x0_bec': 123.99541994176477, 'x0_th': 126.96289225537845, 'amp_bec': 0.45407626835677517, 'amp_th': 0.2954323696551742, 'sigma_bec': 23.228122284311485, 'sigma_th': 14.680173311781266}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.5913 0 2.092 None True None None\n",
"amp_th 0.3847 0 2.092 None True None None\n",
"sigma_th 14.68 0 250 None True None None\n",
"sigmax_bec 23.23 0 52.46 None True None None\n",
"sigmay_bec 22.13 0 44.26 None True None None\n",
"x0_bec 123 113 133 None True None None\n",
"x0_th 123 113 133 None True None None\n",
"y0_bec 124.9 114.9 134.9 None True None None\n",
"y0_th 124.9 114.9 134.9 None True None None\n",
"time 1st fit: 0.444 s\n",
"\n",
"image 1,7\n",
"{'x0_bec': 124.48568621006982, 'x0_th': 129.05342476497512, 'amp_bec': 0.675384310916434, 'amp_th': 0.1756796886879987, 'sigma_bec': 23.19598463923248, 'sigma_th': 14.659862294155865}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.9392 0 2.832 None True None None\n",
"amp_th 0.2443 0 2.832 None True None None\n",
"sigma_th 14.66 0 250 None True None None\n",
"sigmax_bec 23.2 0 37.7 None True None None\n",
"sigmay_bec 18.85 0 37.7 None True None None\n",
"x0_bec 124.9 114.9 134.9 None True None None\n",
"x0_th 124.9 114.9 134.9 None True None None\n",
"y0_bec 125.4 115.4 135.4 None True None None\n",
"y0_th 125.4 115.4 135.4 None True None None\n",
"time 1st fit: 0.643 s\n",
2023-07-27 17:16:08 +02:00
"No thermal part detected, performing fit without thermal function\n",
"time pure bec fit: 0.341 s\n",
"\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1,8\n",
"{'x0_bec': 125.88235659033784, 'x0_th': 122.20851997777476, 'amp_bec': 0.6599688637476858, 'amp_th': 0.23095084283480255, 'sigma_bec': 22.94039969781213, 'sigma_th': 14.498332644737234}\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 0.8676 0 2.488 None True None None\n",
"amp_th 0.3036 0 2.488 None True None None\n",
"sigma_th 14.5 0 250 None True None None\n",
"sigmax_bec 22.94 0 49.18 None True None None\n",
"sigmay_bec 18.03 0 36.07 None True None None\n",
"x0_bec 124.3 114.3 134.3 None True None None\n",
"x0_th 124.3 114.3 134.3 None True None None\n",
"y0_bec 125.8 115.8 135.8 None True None None\n",
"y0_th 125.8 115.8 135.8 None True None None\n",
"time 1st fit: 0.408 s\n",
2023-07-27 17:16:08 +02:00
"No thermal part detected, performing fit without thermal function\n",
"time pure bec fit: 0.301 s\n",
"\n",
"\n",
"image 1,9\n",
"{'x0_bec': 124.65703878309688, 'x0_th': 151.0411000719266, 'amp_bec': 0.8167723325112359, 'amp_th': 0.028188745783018408, 'sigma_bec': 23.461295260810388, 'sigma_th': 22.516913844745105}\n",
"Image seems to be pure BEC (guessed from 1d fit amplitude)\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 1.175 0 2.53 None True None None\n",
"amp_th 0 -inf inf None False None None\n",
"sigma_th 22.52 0 50 None False None None\n",
"sigmax_bec 23.46 0 50.82 None True None None\n",
"sigmay_bec 21.31 0 50.82 None True None None\n",
"x0_bec 124.3 114.3 134.3 None True None None\n",
"x0_th 1 -inf inf None False None None\n",
"y0_bec 125.5 115.5 135.5 None True None None\n",
"y0_th 1 -inf inf None False None None\n",
"time 1st fit: 0.147 s\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1,10\n",
"{'x0_bec': 124.86950626446966, 'x0_th': 167.2366912201061, 'amp_bec': 0.7288161256417663, 'amp_th': 0.007497160034535551, 'sigma_bec': 26.14829032722183, 'sigma_th': 16.525719532048736}\n",
"Image seems to be pure BEC (guessed from 1d fit amplitude)\n",
"Name Value Min Max Stderr Vary Expr Brute_Step\n",
"amp_bec 1.087 0 2.192 None True None None\n",
"amp_th 0 -inf inf None False None None\n",
"sigma_th 16.53 0 50 None False None None\n",
"sigmax_bec 26.15 0 50.82 None True None None\n",
"sigmay_bec 22.13 0 50.82 None True None None\n",
"x0_bec 125.3 115.3 135.3 None True None None\n",
"x0_th 1 -inf inf None False None None\n",
"y0_bec 126.4 116.4 136.4 None True None None\n",
"y0_th 1 -inf inf None False None None\n",
"time 1st fit: 0.116 s\n",
"fitting time = 0.413 +- 0.207\n",
"max fitting time = 0.988s\n",
"[0.24640846 0.49725819 0.37406635 0.31478739 0.29485202 0.33671474\n",
" 0.29728603 0.36642241 0.40815687 0.48236537 0.17365742 0.20959353\n",
" 0.75546026 0.46600842 0.50232697 0.51688814 0.4309833 0.44705105\n",
" 0.98757935 0.71261954 0.14972115 0.11826086]\n"
2023-07-26 09:41:51 +02:00
]
}
],
"source": [
"\n",
2023-07-26 09:41:51 +02:00
"result = []\n",
"result_1 = []\n",
2023-07-26 09:41:51 +02:00
"times = []\n",
2023-07-27 17:16:08 +02:00
"x = np.linspace(0,shape[3],cut_width)\n",
"y = np.linspace(0,shape[2], cut_width)\n",
"\n",
"X,Y = np.meshgrid(x, y)\n",
"X_1d = X.flatten()\n",
"Y_1d = Y.flatten()\n",
"\n",
2023-07-26 09:41:51 +02:00
"for i in range(0,shape[0]):\n",
" temp_res_arr = []\n",
" temp_res_arr_1 = []\n",
2023-07-26 09:41:51 +02:00
" for j in range(0,shape[1]):\n",
" print()\n",
2023-07-27 17:16:08 +02:00
" print(f'image {i},{j}')\n",
2023-07-26 09:41:51 +02:00
" data = cropOD[i,j]\n",
" fitModel = lmfit.Model(density_profile_BEC_2d, independent_vars=['x','y'])\n",
" #fitModel.set_param_hint('deltax', value=5)\n",
"\n",
2023-07-27 17:16:08 +02:00
" bval_1d = result_x[i][j].best_values\n",
" print(bval_1d)\n",
2023-07-26 09:41:51 +02:00
"\n",
" S = np.max(gaussian_filter(data, sigma=1))/(bval_1d['amp_bec'] + bval_1d['amp_th'])\n",
2023-07-26 09:41:51 +02:00
" params = lmfit.Parameters()\n",
" #print(bval['sigma_th'])\n",
" do_fit_2 = True\n",
" if bval_1d['amp_th']/bval_1d['amp_bec'] > 4:\n",
" print('Image seems to be purely thermal (guessed from 1d fit amplitude)')\n",
" do_fit_2 = False\n",
" params.add_many(\n",
" ('amp_bec', 0, False, 0, 1.3 * np.max(data)),\n",
" ('amp_th',S * bval_1d['amp_th'], True, 0, 1.3 * np.max(data)),\n",
" ('x0_bec',1, False),\n",
" ('y0_bec',1, False),\n",
" ('x0_th',center[i,j,0], True, center[i,j,0] -10, center[i,j,0] + 10),\n",
" ('y0_th',center[i,j,1], True, center[i,j,1] -10, center[i,j,1] + 10),\n",
" ('sigmax_bec', 1, False),\n",
" ('sigmay_bec', 1, False),\n",
" ('sigma_th',bval_1d['sigma_th'], True, 0, cut_width)\n",
" )\n",
"\n",
" elif bval_1d['amp_bec']/bval_1d['amp_th'] > 10:\n",
" print('Image seems to be pure BEC (guessed from 1d fit amplitude)')\n",
" do_fit_2 = False\n",
" params.add_many(\n",
" ('amp_bec', S * bval_1d['amp_bec'], True, 0, 1.3 * np.max(data)),\n",
" ('amp_th',0, False),\n",
" ('x0_bec',center[i,j,0], True, center[i,j,0] -10, center[i,j,0] + 10),\n",
" ('y0_bec',center[i,j,1], True, center[i,j,1] - 10, center[i,j,1] + 10),\n",
" ('x0_th', 1, False),\n",
" ('y0_th', 1, False),\n",
" ('sigmax_bec',bval_1d['sigma_bec'], True, 0, 2/1.22 * BEC_width_guess[i,j,0]),\n",
" ('sigmay_bec',BEC_width_guess[i,j,1]/1.22, True, 0, 2/1.22 * BEC_width_guess[i,j,0]),\n",
" ('sigma_th',bval_1d['sigma_th'], False, 0, 50)\n",
" )\n",
"\n",
2023-07-26 09:41:51 +02:00
"\n",
"\n",
" else:\n",
" params.add_many(\n",
" ('amp_bec', S * bval_1d['amp_bec'], True, 0, 1.3 * np.max(data)),\n",
" ('amp_th',S * bval_1d['amp_th'], True, 0, 1.3 * np.max(data)),\n",
" ('x0_bec',center[i,j,0], True, center[i,j,0] -10, center[i,j,0] + 10),\n",
" ('y0_bec',center[i,j,1], True, center[i,j,1] -10, center[i,j,1] + 10),\n",
" ('x0_th',center[i,j,0], True, center[i,j,0] -10, center[i,j,0] + 10),\n",
" ('y0_th',center[i,j,1], True, center[i,j,1] -10, center[i,j,1] + 10),\n",
" ('sigmax_bec',bval_1d['sigma_bec'], True, 0, 2/1.22 * BEC_width_guess[i,j,0]),\n",
" ('sigmay_bec',BEC_width_guess[i,j,1]/1.22, True, 0, 2/1.22 * BEC_width_guess[i,j,1]),\n",
" ('sigma_th',bval_1d['sigma_th'], True, 0, cut_width)\n",
" )\n",
"\n",
"\n",
" params.pretty_print()\n",
2023-07-26 09:41:51 +02:00
"\n",
" data1d = data.flatten()\n",
" start = time.time()\n",
" res = fitModel.fit(data1d, x=X_1d, y=Y_1d, params=params)\n",
" stop = time.time()\n",
" temp_res_arr_1.append(res)\n",
2023-07-27 17:16:08 +02:00
"\n",
"\n",
" # Check if there is an thermal part\n",
" bval = res.best_values\n",
" sigma_cut = max(bval['sigmay_bec'], bval['sigmax_bec'])\n",
2023-07-27 17:16:08 +02:00
" tf_fit = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=bval['sigmax_bec'], sigmay=bval['sigmay_bec'])\n",
" tf_fit_2 = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=1.5 * sigma_cut, sigmay=1.5*sigma_cut)\n",
2023-07-27 17:16:08 +02:00
"\n",
"\n",
" mask = np.where(tf_fit > 0, np.nan, data)\n",
" #mask[i,j] = gaussian_filter(mask[i,j], sigma = 0.4)\n",
" mask = np.where(tf_fit_2 > 0, mask, np.nan)\n",
"\n",
" check_value = np.nansum(mask)\n",
2023-07-27 17:16:08 +02:00
"\n",
" print(f'time 1st fit: {stop-start :.3f} s')\n",
2023-07-26 09:41:51 +02:00
"\n",
" # if (check_value < 45) or ((check_value > 10000) and (bval['sigma_th'] < min(bval['sigmax_bec'], bval['sigmay_bec']))):\n",
" #check_value = 200\n",
" if check_value < 45 and do_fit_2:\n",
2023-07-27 17:16:08 +02:00
" print('No thermal part detected, performing fit without thermal function')\n",
" # if check_value > 200:\n",
" # print('Sigma Thermal smaller than BEC, but still strong part around masked region --> BEC guessed wrong')\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" params = lmfit.Parameters()\n",
" #print(bval['sigma_th'])\n",
" params.add_many(\n",
" ('amp_bec', S * bval_1d['amp_bec'], True, 0, 1.3 * np.max(data)),\n",
" ('amp_th',0, False),\n",
" ('x0_bec',center[i,j,0], True, center[i,j,0] -10, center[i,j,0] + 10),\n",
" ('y0_bec',center[i,j,1], True, center[i,j,1] - 10, center[i,j,1] + 10),\n",
" ('x0_th', 1, False),\n",
" ('y0_th', 1, False),\n",
" ('sigmax_bec',bval_1d['sigma_bec'], True, 0, 2/1.22 * BEC_width_guess[i,j,0]),\n",
" ('sigmay_bec',BEC_width_guess[i,j,1]/1.22, True, 0, 2/1.22 * BEC_width_guess[i,j,0]),\n",
" ('sigma_th',bval_1d['sigma_th'], False, 0, 50)\n",
2023-07-27 17:16:08 +02:00
" )\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" start2 = time.time()\n",
" res = fitModel.fit(data1d, x=X_1d, y=Y_1d, params=params)\n",
" stop2 = time.time()\n",
2023-07-26 09:41:51 +02:00
"\n",
" print(f'time pure bec fit: {stop2-start2 :.3f} s')\n",
2023-07-27 17:16:08 +02:00
" print('')\n",
" stop2 = time.time()\n",
2023-07-26 09:41:51 +02:00
"\n",
"\n",
"\n",
2023-07-27 17:16:08 +02:00
" times.append(stop2-start)\n",
2023-07-26 09:41:51 +02:00
" temp_res_arr.append(res)\n",
" result_1.append(temp_res_arr_1)\n",
2023-07-26 09:41:51 +02:00
" result.append(temp_res_arr)\n",
"times = np.array(times)\n",
"print(f\"fitting time = {np.mean(times):.3f} +- {np.std(times, ddof=1):.3f}\")\n",
"print(f\"max fitting time = {np.max(times) :.3f}s\")\n",
2023-07-27 17:16:08 +02:00
"print(times)\n",
"\n"
2023-07-20 20:34:19 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-02T14:56:03.655488900Z",
"start_time": "2023-08-02T14:55:54.444880200Z"
2023-07-20 20:34:19 +02:00
}
}
},
{
"cell_type": "markdown",
"source": [
2023-07-27 17:16:08 +02:00
"## Plotting"
2023-07-20 20:34:19 +02:00
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 15,
2023-07-20 20:34:19 +02:00
"outputs": [
{
2023-07-26 09:41:51 +02:00
"data": {
2023-07-27 17:16:08 +02:00
"text/plain": "<Figure size 1400x8800 with 110 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAABN4AABsCCAYAAADim9lVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3wUxfvA8c/QEmqoofcmvaogKFV6kd5EgiAIgoLwVYNl90CqCqgoiiJNqiAISlG6IKJUEfhB6J1QQy+B+f0xe5sLJCGEhCLP2xcvL3ezs7N7t7e3z848o7TWGiGEEEIIIYQQQgghRLxK9KAbIIQQQgghhBBCCCHEf5EE3oQQQgghhBBCCCGESAASeBNCCCGEEEIIIYQQIgFI4E0IIYQQQgghhBBCiAQggTchhBBCCCGEEEIIIRKABN6EEEIIIYQQQgghhEgAEngTQgghhBBCCCGEECIBSOBNCCGEEEIIIYQQQogEIIE3IYQQQgghhBBCCCESgATehBBCiDhSSqGUomrVqg+6KUKIR5Rt2+53yfLlyx90c4S4jZzrhHhw5Pj7b0jyoBsgxKNKKRXl88mSJSNNmjQEBASQO3duypYty9NPP039+vVJnjz5fW3j+PHj2bdvH2B+2AshbhfdsRydN954g5EjR8aq7Jw5c9i0aRMAvXr1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f3b/g4OAol69SpUqslrcsK9JyVatWjdVyHTp00FevXr2r7RbiYRXXY9l32SpVqkR6vkOHDrE+loS4W3L+efjOP5ZlRbttd7PssmXL3Of37t0bq30C6L1798br9jwuFixYoDNnznzH/RsUFHTbstF9/0clurJxPV5iY9myZVopdce6M2XKpH///fc4td/XsWPHdMWKFWNcV9KkSfXgwYNjbLPvNi9YsECnTZs22vqef/55feXKlWjru3btmm7RokW0yydOnFh//PHHety4ce5z48aNu9OujdKFCxd0oUKF3Hp+/vnnKMtt2LBBJ0uWTAM6Y8aM+siRI3Fa33+BHH9y/MXH8Xfjxg2dN29eDeh06dLpy5cvx1j+8uXLOl26dBrQuXLl0jdu3LjrdcaF5HgT4j5r27Ytw4YNA+CPP/7g+vXrJE2aNFKZy5cvkz59ep5//nnKlClD9uzZSZo0KYcPH2bDhg3MmDGD69evM3jwYAIDA+nVq1ek5T/88ENOnjzJe++9x9atW4Gok8Y/8cQTt603VapU1KhRg3LlypEnTx78/f05evQoW7duZfLkyVy8eJEJEyaQNm1aRo4cGX87Roj/kNdff50XXniBzz77jGXLlgHw9ddfExgYGKlcrly5HkTzxGNKzj+PlsDAQGbPnk1oaChdu3YFoFq1alHe0b/1u0Xc2YwZM2jbti03btwAoGTJkjRr1owCBQqglOLgwYP88ccfLFq0KMF6JMX1eImNK1euoLWmWLFiVKtWjSJFipAhQwauXLnCwYMHmTNnDuvXr+fEiRM0aNCATZs2kSdPnjhtx/nz53nuuefYuXMnAFmzZuXll1+mWLFiXLp0id9++40ffviB69evExwczM2bN+nXr1+MdW7atImPPvoIrTVdu3alYsWK+Pn5sW7dOr766isuXrzIb7/9xsCBA+nfv3+UdXTp0oUffvgBAH9/f4KCgqhYsSKJEydm3bp1jB07lr59+9K8efM4bbevlClTMmXKFCpWrMj169d5+eWX+eeff8icObNb5tKlS7Rp04Zr164BMG7cOLJmzXrP634UyfEnx198HX+JEiXilVdeoV+/fpw5c4ZZs2bRrl27aMvPnDmTM2fOANCpUycSJbpPg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O3fuHJMnT2b+/Pls2bKFkydPcvHixQRfrxAPg6hye/i
2023-07-26 09:41:51 +02:00
},
"metadata": {},
"output_type": "display_data"
2023-07-20 20:34:19 +02:00
}
],
"source": [
"fig, axs = plt.subplots(shape[0] * shape[1], 5, figsize=(14, 4 * shape[0] * shape[1]),dpi = 100)\n",
2023-07-27 17:16:08 +02:00
"\n",
"ii = 0\n",
2023-07-26 09:41:51 +02:00
"for i in range(0,shape[0]):\n",
"\n",
2023-07-26 09:41:51 +02:00
" for j in range(0,shape[1]):\n",
" axs[ii,0].set_title(f'image {i}, {j}, cond. frac = {cond_frac(result[i][j]) :.2f}')\n",
" lmfit.fit_report(result[i][j])\n",
2023-07-26 09:41:51 +02:00
" bval = result[i][j].best_values\n",
" fit = density_profile_BEC_2d(X,Y, **bval)\n",
" vmax = np.max(fit)\n",
"\n",
"\n",
2023-07-27 17:16:08 +02:00
"\n",
" ax = axs[ii,0]\n",
" ax.pcolormesh(X, Y, cropOD[i,j], vmin=0, vmax=vmax, cmap='jet', shading='auto')\n",
2023-07-26 09:41:51 +02:00
" #plt.colorbar(art, ax=ax, label='z')\n",
2023-07-27 17:16:08 +02:00
"\n",
2023-07-26 09:41:51 +02:00
"\n",
" # Plot gaussian 2d Fit + legend including Width parameters\n",
2023-07-27 17:16:08 +02:00
" ax = axs[ii,1]\n",
2023-07-20 20:34:19 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" ax.pcolormesh(X, Y, fit, vmin=0, vmax=vmax, cmap='jet', shading='auto')\n",
2023-07-26 09:41:51 +02:00
" #plt.colorbar(art, ax=ax, label='z')\n",
2023-07-20 20:34:19 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" ax = axs[ii,2]\n",
"\n",
" ax.pcolormesh(X, Y, fit-cropOD[i,j], vmin=0, vmax=0.2, cmap='jet', shading='auto')\n",
2023-07-20 20:34:19 +02:00
"\n",
"\n",
2023-07-27 17:16:08 +02:00
" ax = axs[ii,3]\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" ax.plot(x, cropOD[i,j, round(center[i,j,1]), :])\n",
2023-07-26 09:41:51 +02:00
" ax.plot(x, fit[round(center[i,j,1]), :])\n",
" ax.plot(x, thermal(x, bval['x0_th'], bval['amp_th'], bval['sigma_th']))\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" ax = axs[ii,4]\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
" ax.plot(y, cropOD[i,j, :, round(center[i,j,0])])\n",
2023-07-26 09:41:51 +02:00
" ax.plot(y, fit[:, round(center[i,j,0])])\n",
" ax.plot(x, thermal(y, bval['y0_th'], bval['amp_th'], bval['sigma_th']))\n",
2023-07-26 09:41:51 +02:00
"\n",
"\n",
2023-07-27 17:16:08 +02:00
" ii += 1\n",
"\n",
"axs[0,0].set_title(f'Data \\n \\n image {i}, {j}, cond. frac = {cond_frac(result[0][0]) :.2f}')\n",
"axs[0,1].set_title('Fit \\n \\n')\n",
"axs[0,2].set_title('Data - Fit \\n \\n')\n",
"axs[0,3].set_title('cut along x \\n \\n')\n",
"axs[0,4].set_title('cut along y \\n \\n')\n",
"\n",
"\n",
2023-07-26 09:41:51 +02:00
"\n",
2023-07-27 17:16:08 +02:00
"plt.show()"
2023-07-20 20:34:19 +02:00
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T15:21:11.108359900Z",
"start_time": "2023-08-01T15:20:54.022000300Z"
2023-07-20 20:34:19 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 327,
2023-07-26 09:41:51 +02:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 0, 0\n",
"FWHM_x BEC: 32.75, FWHM_x thermal: 74.38\n",
"FWHM_y BEC: 25.59\n",
"Ratio fwhm_th/fwhm_bec: 2.91\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 1\n",
"FWHM_x BEC: 20.62, FWHM_x thermal: 54.05\n",
"FWHM_y BEC: 18.09\n",
"Ratio fwhm_th/fwhm_bec: 2.99\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 2\n",
"FWHM_x BEC: 23.84, FWHM_x thermal: 49.32\n",
"FWHM_y BEC: 20.18\n",
"Ratio fwhm_th/fwhm_bec: 2.44\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 3\n",
"FWHM_x BEC: 25.95, FWHM_x thermal: 41.75\n",
"FWHM_y BEC: 22.19\n",
"Ratio fwhm_th/fwhm_bec: 1.88\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 4\n",
"FWHM_x BEC: 27.86, FWHM_x thermal: 37.63\n",
"FWHM_y BEC: 23.50\n",
"Ratio fwhm_th/fwhm_bec: 1.60\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 5\n",
"FWHM_x BEC: 28.81, FWHM_x thermal: 34.44\n",
"FWHM_y BEC: 24.27\n",
"Ratio fwhm_th/fwhm_bec: 1.42\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 6\n",
"FWHM_x BEC: 30.15, FWHM_x thermal: 29.43\n",
"FWHM_y BEC: 25.28\n",
"Ratio fwhm_th/fwhm_bec: 1.16\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 7\n",
"FWHM_x BEC: 30.70, FWHM_x thermal: 25.68\n",
"FWHM_y BEC: 26.31\n",
"Ratio fwhm_th/fwhm_bec: 0.98\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 0, 8\n",
"FWHM_x BEC: 32.13, FWHM_x thermal: 19.48\n",
"FWHM_y BEC: 27.06\n",
"Ratio fwhm_th/fwhm_bec: 0.72\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 0, 9\n",
"FWHM_x BEC: 32.91, FWHM_x thermal: 17.25\n",
"FWHM_y BEC: 27.48\n",
"Ratio fwhm_th/fwhm_bec: 0.63\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 0, 10\n",
"FWHM_x BEC: 33.10, FWHM_x thermal: 1.21\n",
"FWHM_y BEC: 28.28\n",
"Ratio fwhm_th/fwhm_bec: 0.04\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 0\n",
"FWHM_x BEC: 29.53, FWHM_x thermal: 79.98\n",
"FWHM_y BEC: 3.75\n",
"Ratio fwhm_th/fwhm_bec: 21.31\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 1\n",
"FWHM_x BEC: 19.91, FWHM_x thermal: 56.26\n",
"FWHM_y BEC: 18.48\n",
"Ratio fwhm_th/fwhm_bec: 3.04\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 2\n",
"FWHM_x BEC: 23.70, FWHM_x thermal: 48.49\n",
"FWHM_y BEC: 19.98\n",
"Ratio fwhm_th/fwhm_bec: 2.43\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 3\n",
"FWHM_x BEC: 26.07, FWHM_x thermal: 42.63\n",
"FWHM_y BEC: 21.63\n",
"Ratio fwhm_th/fwhm_bec: 1.97\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 4\n",
"FWHM_x BEC: 27.87, FWHM_x thermal: 36.96\n",
"FWHM_y BEC: 23.97\n",
"Ratio fwhm_th/fwhm_bec: 1.54\n",
2023-07-26 09:41:51 +02:00
"\n",
"image 1, 5\n",
"FWHM_x BEC: 29.86, FWHM_x thermal: 33.99\n",
"FWHM_y BEC: 24.15\n",
"Ratio fwhm_th/fwhm_bec: 1.41\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1, 6\n",
"FWHM_x BEC: 30.65, FWHM_x thermal: 35.69\n",
"FWHM_y BEC: 25.63\n",
"Ratio fwhm_th/fwhm_bec: 1.39\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1, 7\n",
"FWHM_x BEC: 16.17, FWHM_x thermal: 20.71\n",
"FWHM_y BEC: 25.97\n",
"Ratio fwhm_th/fwhm_bec: 1.28\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1, 8\n",
"FWHM_x BEC: 31.36, FWHM_x thermal: 18.54\n",
"FWHM_y BEC: 28.22\n",
"Ratio fwhm_th/fwhm_bec: 0.66\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1, 9\n",
"FWHM_x BEC: 31.84, FWHM_x thermal: 16.81\n",
"FWHM_y BEC: 27.11\n",
"Ratio fwhm_th/fwhm_bec: 0.62\n",
2023-07-27 17:16:08 +02:00
"\n",
"image 1, 10\n",
"FWHM_x BEC: 33.73, FWHM_x thermal: 0.04\n",
"FWHM_y BEC: 27.85\n",
"Ratio fwhm_th/fwhm_bec: 0.00\n",
2023-07-26 09:41:51 +02:00
"\n"
]
}
],
"source": [
"for i in range(0,shape[0]):\n",
" for j in range(0,shape[1]):\n",
" sx = result[i][j].best_values['sigmax_bec']\n",
" sy = result[i][j].best_values['sigmay_bec']\n",
" s_th = result[i][j].best_values['sigma_th']\n",
"\n",
" print(f'image {i}, {j}')\n",
" print(f'FWHM_x BEC: { sx*1.22:.2f}, FWHM_x thermal: { s_th*1.93:.2f}')\n",
" print(f'FWHM_y BEC: { sy*1.22:.2f}')\n",
" print(f'Ratio fwhm_th/fwhm_bec: { 1/min(sx,sy)/1.22 * s_th *1.93 :.2f}')\n",
2023-07-26 09:41:51 +02:00
" print('')"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-31T14:30:32.405769500Z",
"start_time": "2023-07-31T14:30:32.206822Z"
2023-07-26 09:41:51 +02:00
}
}
},
{
"cell_type": "markdown",
2023-07-20 20:34:19 +02:00
"source": [],
2023-07-26 09:41:51 +02:00
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 188,
2023-07-26 09:41:51 +02:00
"outputs": [
2023-07-27 17:16:08 +02:00
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 0, 0\n"
]
},
{
"ename": "type",
"evalue": "'numpy.ndarray' object is not callable",
"output_type": "error",
"traceback": [
"\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[1;31mTypeError\u001B[0m Traceback (most recent call last)",
"Cell \u001B[1;32mIn[188], line 12\u001B[0m\n\u001B[0;32m 10\u001B[0m arr \u001B[38;5;241m=\u001B[39m []\n\u001B[0;32m 11\u001B[0m bval \u001B[38;5;241m=\u001B[39m result[i][j]\u001B[38;5;241m.\u001B[39mbest_values\n\u001B[1;32m---> 12\u001B[0m sigma_cut \u001B[38;5;241m=\u001B[39m \u001B[43mmax_val\u001B[49m\u001B[43m(\u001B[49m\u001B[43mbval\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43msigmay_bec\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mbval\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[38;5;124;43msigmax_bec\u001B[39;49m\u001B[38;5;124;43m'\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m\n\u001B[0;32m 13\u001B[0m tf_fit \u001B[38;5;241m=\u001B[39m ThomasFermi_2d(X,Y,centerx\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mx0_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], centery\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124my0_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], amplitude\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mamp_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], sigmax\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124msigmax_bec\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m1.22\u001B[39m, sigmay\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124msigmay_bec\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m1.22\u001B[39m)\n\u001B[0;32m 14\u001B[0m tf_fit_2 \u001B[38;5;241m=\u001B[39m ThomasFermi_2d(X,Y,centerx\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mx0_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], centery\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124my0_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], amplitude\u001B[38;5;241m=\u001B[39mbval[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mamp_bec\u001B[39m\u001B[38;5;124m'\u001B[39m], sigmax\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m1.5\u001B[39m \u001B[38;5;241m*\u001B[39m sigma_cut\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m1.22\u001B[39m, sigmay\u001B[38;5;241m=\u001B[39m\u001B[38;5;241m1.5\u001B[39m\u001B[38;5;241m*\u001B[39m sigma_cut\u001B[38;5;241m/\u001B[39m\u001B[38;5;241m1.22\u001B[39m)\n",
"\u001B[1;31mTypeError\u001B[0m: 'numpy.ndarray' object is not callable"
2023-07-27 17:16:08 +02:00
]
},
2023-07-26 09:41:51 +02:00
{
"data": {
"text/plain": "<Figure size 1000x1000 with 22 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAzkAAAMtCAYAAAC8Vb+UAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA900lEQVR4nO3cfWydZf0/8E9hyRIjK4lxW9l6NlnXOHCge8BloFjAOCOIuvhE8HHMaQQNENAZzHwgYIJGTYxBDSwh868xZcQQYwRDINHE6ci0ZFqrpEcZm2TuFI0bW3r9/vj+1jja+9rOWR9Or75eyf1H22tXr/vdz1benPbuSCmlAAAAKMQ5030AAACAiaTkAAAARVFyAACAoig5AABAUZQcAACgKEoOAABQFCUHAAAoipIDAAAURckBAACK0lTJ+dznPhdLly6Njo6OeOaZZyrXPfDAA7F8+fJYtmxZbN68OY4fP36255wR5FNNNnnyqSabPPnkyaeabPLkU002efJpE6kJTz75ZKrX62nJkiVp7969467561//mrq6utKBAwfSyMhIuu6669L3vve9Zj7NjCWfarLJk0812eTJJ08+1WSTJ59qssmTT3uY00wheutb33raNQ8//HC8+93vjoULF0ZExKc//em455574rOf/ey4648dOxbHjh0bfXtkZCQOHz4cr3nNa6Kjo6OZ4027N77xjRERkVKKf//73zE8PDxmzY4dO2LDhg3xqle9Kl566aX4yEc+Evfdd1985jOfiXPOGfvCWin5tJLNRz/60fjWt74V119/fVxwwQXyMTtmZxxmJ08+1WSTJ59qssmTz8RKKcVLL71U+f089weblmumN998c7rnnntG3+7v70/d3d2Ve23bti1FxKy/6vW6fOQjG/nIpo0u+chGPrKRT/tcVdlU6UgppWjS0qVL45FHHhltqv/rlltuiQsuuCC2bt0aERHPPvtsbNiwIYaGhsbd65XNtNFoRK1Wi3q9HvPmzWv2aG1h5cqV8eMf/zguueSSMR+74447YuHChXH77bdHRMSePXvi6quvjiNHjkRnZ+eY9aXl00w2+/fvj/e+973x/PPPyyfMjtnJMzt58qkmmzz5VJNNnnwmxvDwcHR3d1dmU6WpH1c7E7VaLQYHB0fffu6556JWq1Wunzt3bsydO3fM++fNmzdjv2gdHR3x6le/etzz9/T0xODg4OjHDh8+PPpnxlNaPs1k8+KLL0atVovnn39ePmF2zE6e2cmTTzXZ5Mmnmmzy5DOxmv2xvAl/hPTGjRvj0UcfjRdeeCFSSnH//ffHhz70oYn+NDPWK/N58MEHp/tIbWO82dm4ceN0H6ttmJ1qZifP7OTJp5ps8uRTTTZ58pl8TZWcLVu2xOLFi+Pvf/97vOMd74ienp6IiLjpppvi0UcfjYiICy+8ML761a/G5ZdfHj09PfHa1742tmzZMvEnb0Ot5POa17xmOo88ZVqdnU984hPTeewpY3aqmZ08s5Mnn2qyyZNPNdnkyac9tPQ7OZNpeHg4Ojs7o9FozIqX35q9X/lM7PqZTDZ58qkmmzz5VJNNnnyqySZPPtVavdcJ/3E1AACA6aTkAAAARVFyAACAoig5AABAUZQcAACgKEoOAABQFCUHAAAoipIDAAAURckBAACKouQAAABFUXIAAICiKDkAAEBRlBwAAKAoSg4AAFAUJQcAACiKkgMAABRFyQEAAIqi5AAAAEVRcgAAgKIoOQAAQFGUHAAAoChKDgAAUBQlBwAAKIqSAwAAFEXJAQAAiqLkAAAARVFyAACAoig5AABAUZQcAACgKEoOAABQFCUHAAAoipIDAAAURckBAACKouQAAABFUXIAAICiKDkAAEBRlBwAAKAoSg4AAFAUJQcAACiKkgMAABRFyQEAAIqi5AAAAEVRcgAAgKIoOQAAQFGUHAAAoChKDgAAUBQlBwAAKIqSAwAAFEXJAQAAiqLkAAAARVFyAACAoig5AABAUZQcAACgKEoOAABQFCUHAAAoipIDAAAURckBAACKouQAAABFUXIAAICiKDkAAEBRlBwAAKAoTZecgYGBWL9+ffT29sbatWujv79/zJqRkZG47bbb4qKLLopLLrkk+vr64i9/+cuEHLidtZLNtddeOw0nnR7yqSabPPlUk02efPKazWf9+vURETE4ODjVR51yZifP7FQzO20iNamvry9t3749pZTSzp0705o1a8as+elPf5ouu+yy9PLLL6eUUvr617+e3v/+95/R/o1GI0VEajQazR5t2rWSzV133dXU/conb6bmI5s8+VSTTZ588prN5+S9vuc97zmj/WdTNimZnVcyO2ZnIrR6r029knPo0KHYs2dP3HjjjRERsXHjxqjX62Nepeno6Ihjx47F0aNHI6UUw8PDsXjx4nH3PHbsWAwPD59yzURnk02OfMrPRzZ58qkmmzz55LWaT0TEokWLxt1ztmdjdsyO2WkfTZWcer0eXV1dMWfOnIj4vy9QrVaLoaGhU9Zdd9118ba3vS0WLlwYXV1d8fjjj8fXvva1cfe89957o7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MAABRFyQEAAIqi5AAAAEVRcgAAgKIoOQAAQFGUHAAAoChKDgAAUBQlBwAAKIqSAwAAFEXJAQAAiqLkAAAARVFyAACAojRdcgYGBmL9+vXR29sba9eujf7+/nHX/eEPf4i3ve1tsWLFilixYkX85Cc/OevDtrtWslm7du0Un3L6yKeabPLkk9dsPiezefTRR6fymNPC7OSZnWpmJ8/sVDM7bSI1qa+vL23fvj2llNLOnTvTmjVrxqz5z3/+k173utelp556KqWU0okTJ9KhQ4fOaP9Go5EiIjUajWaPNu1ayebw4cNN3a988mZqPrLJk09es/mcvNfBwcEz2n82ZZOS2Xkls2N2xmN2qpmdidXqvTZVcg4ePJjOO++8dPz48ZRSSiMjI2nBggVpYGDglHU/+tG
2023-07-26 09:41:51 +02:00
},
"metadata": {},
2023-07-27 17:16:08 +02:00
"output_type": "display_data"
2023-07-26 09:41:51 +02:00
}
],
"source": [
2023-07-27 17:16:08 +02:00
"mask = np.zeros(shape)\n",
"mask2 = np.zeros(shape)\n",
"mask3 = []\n",
"fig, ax = plt.subplots(shape[0],shape[1], figsize=(10,10))\n",
"\n",
2023-07-26 09:41:51 +02:00
"for i in range(0, shape[0]):\n",
2023-07-27 17:16:08 +02:00
" temp_arr = []\n",
" for j in range(0, shape[1]):\n",
" print(f'image {i}, {j}')\n",
2023-07-27 17:16:08 +02:00
" arr = []\n",
" bval = result[i][j].best_values\n",
" sigma_cut = max_val(bval['sigmay_bec'], bval['sigmax_bec'])\n",
2023-07-27 17:16:08 +02:00
" tf_fit = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=bval['sigmax_bec'], sigmay=bval['sigmay_bec'])\n",
" tf_fit_2 = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=1.5 * sigma_cut, sigmay=1.5* sigma_cut)\n",
2023-07-27 17:16:08 +02:00
"\n",
"\n",
" mask[i,j] = np.where(tf_fit > 0, np.nan, cropOD[i,j])\n",
" #mask[i,j] = gaussian_filter(mask[i,j], sigma = 0.4)\n",
" #mask[i,j] = np.where(tf_fit_2 > 0, mask[i,j], np.nan)\n",
" mask2[i,j] = np.where(tf_fit_2 > 0, mask[i,j], np.nan)\n",
2023-07-27 17:16:08 +02:00
" # print(f'max = {np.nanmax(mask[i,j])}, {np.nanmax(mask[i,j]) / np.nanmin(mask[i,j])}')\n",
"\n",
"\n",
"\n",
" check_value = np.nanmean(mask2[i,j]) / (bval[\"amp_bec\"] + bval[\"amp_th\"])\n",
"\n",
" print(f'check val, {np.nansum(mask2[i,j])}')\n",
"\n",
" ax[i,j].pcolormesh(mask2[i,j], cmap='jet',vmin=0,vmax=0.5)\n",
"\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:28:57.973001500Z",
"start_time": "2023-08-01T13:28:54.940256400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 14,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image: 0, 0\n",
"amp_bec: 0.000, (init = 0.000), bounds = [0.00 : 0.40] \n",
"amp_th: 0.103, (init = 0.135), bounds = [0.00 : 0.40] \n",
"x0_bec: 114.060, (init = 114.060), bounds = [114.06 : 134.06] \n",
"y0_bec: 114.291, (init = 114.291), bounds = [114.29 : 134.29] \n",
"x0_th: 125.454, (init = 124.060), bounds = [114.06 : 134.06] \n",
"y0_th: 125.676, (init = 124.291), bounds = [114.29 : 134.29] \n",
"sigmax_bec: 1.000, (init = 1.000), bounds = [0.00 : 95.08] \n",
"sigmay_bec: 1.000, (init = 1.000), bounds = [0.00 : 72.13] \n",
"sigma_th: 37.876, (init = 38.731), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 1\n",
"amp_bec: 0.217, (init = 0.170), bounds = [0.00 : 0.72] \n",
"amp_th: 0.169, (init = 0.229), bounds = [0.00 : 0.72] \n",
"x0_bec: 125.205, (init = 123.226), bounds = [113.23 : 133.23] \n",
"y0_bec: 126.138, (init = 126.090), bounds = [116.09 : 136.09] \n",
"x0_th: 124.613, (init = 123.226), bounds = [113.23 : 133.23] \n",
"y0_th: 126.036, (init = 126.090), bounds = [116.09 : 136.09] \n",
"sigmax_bec: 16.903, (init = 15.416), bounds = [0.00 : 59.02] \n",
"sigmay_bec: 14.835, (init = 23.770), bounds = [0.00 : 47.54] \n",
"sigma_th: 28.007, (init = 27.656), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 2\n",
"amp_bec: 0.351, (init = 0.308), bounds = [0.00 : 0.87] \n",
"amp_th: 0.186, (init = 0.244), bounds = [0.00 : 0.87] \n",
"x0_bec: 124.756, (init = 124.199), bounds = [114.20 : 134.20] \n",
"y0_bec: 125.997, (init = 125.119), bounds = [115.12 : 135.12] \n",
"x0_th: 125.359, (init = 124.199), bounds = [114.20 : 134.20] \n",
"y0_th: 125.902, (init = 125.119), bounds = [115.12 : 135.12] \n",
"sigmax_bec: 19.537, (init = 18.047), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 16.545, (init = 25.410), bounds = [0.00 : 50.82] \n",
"sigma_th: 25.553, (init = 26.639), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 3\n",
"amp_bec: 0.417, (init = 0.376), bounds = [0.00 : 1.07] \n",
"amp_th: 0.221, (init = 0.286), bounds = [0.00 : 1.07] \n",
"x0_bec: 124.875, (init = 124.288), bounds = [114.29 : 134.29] \n",
"y0_bec: 126.008, (init = 125.419), bounds = [115.42 : 135.42] \n",
"x0_th: 125.107, (init = 124.288), bounds = [114.29 : 134.29] \n",
"y0_th: 125.814, (init = 125.419), bounds = [115.42 : 135.42] \n",
"sigmax_bec: 21.269, (init = 19.490), bounds = [0.00 : 55.74] \n",
"sigmay_bec: 18.190, (init = 24.590), bounds = [0.00 : 49.18] \n",
"sigma_th: 21.630, (init = 21.472), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 4\n",
"amp_bec: 0.506, (init = 0.480), bounds = [0.00 : 1.24] \n",
"amp_th: 0.228, (init = 0.257), bounds = [0.00 : 1.24] \n",
"x0_bec: 125.172, (init = 124.844), bounds = [114.84 : 134.84] \n",
"y0_bec: 125.980, (init = 125.632), bounds = [115.63 : 135.63] \n",
"x0_th: 125.047, (init = 124.844), bounds = [114.84 : 134.84] \n",
"y0_th: 125.947, (init = 125.632), bounds = [115.63 : 135.63] \n",
"sigmax_bec: 22.839, (init = 20.901), bounds = [0.00 : 52.46] \n",
"sigmay_bec: 19.261, (init = 23.770), bounds = [0.00 : 47.54] \n",
"sigma_th: 19.498, (init = 20.335), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 5\n",
"amp_bec: 0.578, (init = 0.504), bounds = [0.00 : 1.26] \n",
"amp_th: 0.238, (init = 0.357), bounds = [0.00 : 1.26] \n",
"x0_bec: 124.950, (init = 124.472), bounds = [114.47 : 134.47] \n",
"y0_bec: 125.948, (init = 125.613), bounds = [115.61 : 135.61] \n",
"x0_th: 125.548, (init = 124.472), bounds = [114.47 : 134.47] \n",
"y0_th: 126.312, (init = 125.613), bounds = [115.61 : 135.61] \n",
"sigmax_bec: 23.612, (init = 21.613), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 19.890, (init = 25.410), bounds = [0.00 : 50.82] \n",
"sigma_th: 17.846, (init = 16.823), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 6\n",
"amp_bec: 0.624, (init = 0.589), bounds = [0.00 : 1.43] \n",
"amp_th: 0.273, (init = 0.319), bounds = [0.00 : 1.43] \n",
"x0_bec: 124.841, (init = 124.226), bounds = [114.23 : 134.23] \n",
"y0_bec: 126.087, (init = 125.493), bounds = [115.49 : 135.49] \n",
"x0_th: 125.518, (init = 124.226), bounds = [114.23 : 134.23] \n",
"y0_th: 125.328, (init = 125.493), bounds = [115.49 : 135.49] \n",
"sigmax_bec: 24.716, (init = 22.882), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 20.723, (init = 24.590), bounds = [0.00 : 49.18] \n",
"sigma_th: 15.245, (init = 15.696), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 7\n",
"amp_bec: 0.921, (init = 0.745), bounds = [0.00 : 1.47] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 1.47] \n",
"x0_bec: 124.991, (init = 124.374), bounds = [114.37 : 134.37] \n",
"y0_bec: 126.028, (init = 125.431), bounds = [115.43 : 135.43] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 25.377, (init = 23.194), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 22.347, (init = 25.410), bounds = [0.00 : 57.38] \n",
"sigma_th: 14.658, (init = 14.658), bounds = [0.00 : 50.00] \n",
"\n",
"image: 0, 8\n",
"amp_bec: 0.961, (init = 0.840), bounds = [0.00 : 1.62] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 1.62] \n",
"x0_bec: 125.003, (init = 124.493), bounds = [114.49 : 134.49] \n",
"y0_bec: 125.923, (init = 125.501), bounds = [115.50 : 135.50] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 25.550, (init = 23.255), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 22.058, (init = 25.410), bounds = [0.00 : 57.38] \n",
"sigma_th: 14.697, (init = 14.697), bounds = [0.00 : 50.00] \n",
"\n",
"image: 0, 9\n",
"amp_bec: 0.979, (init = 0.783), bounds = [0.00 : 1.65] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 1.65] \n",
"x0_bec: 124.977, (init = 124.406), bounds = [114.41 : 134.41] \n",
"y0_bec: 126.070, (init = 125.502), bounds = [115.50 : 135.50] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 25.456, (init = 23.096), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 21.924, (init = 22.951), bounds = [0.00 : 57.38] \n",
"sigma_th: 14.596, (init = 14.596), bounds = [0.00 : 50.00] \n",
"\n",
"image: 0, 10\n",
"amp_bec: 0.876, (init = 0.896), bounds = [0.00 : 1.40] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 1.40] \n",
"x0_bec: 125.124, (init = 124.672), bounds = [114.67 : 134.67] \n",
"y0_bec: 125.952, (init = 125.545), bounds = [115.54 : 135.54] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 27.134, (init = 25.278), bounds = [0.00 : 63.93] \n",
"sigmay_bec: 23.177, (init = 27.049), bounds = [0.00 : 63.93] \n",
"sigma_th: 49.148, (init = 49.148), bounds = [0.00 : 50.00] \n",
"\n",
"image: 1, 0\n",
"amp_bec: 0.000, (init = 0.000), bounds = [0.00 : 1.22] \n",
"amp_th: 0.094, (init = 0.209), bounds = [0.00 : 1.22] \n",
"x0_bec: 112.431, (init = 112.431), bounds = [112.43 : 132.43] \n",
"y0_bec: 117.409, (init = 117.409), bounds = [117.41 : 137.41] \n",
"x0_th: 123.481, (init = 122.431), bounds = [112.43 : 132.43] \n",
"y0_th: 125.563, (init = 127.409), bounds = [117.41 : 137.41] \n",
"sigmax_bec: 1.000, (init = 1.000), bounds = [0.00 : 44.26] \n",
"sigmay_bec: 1.000, (init = 1.000), bounds = [0.00 : 44.26] \n",
"sigma_th: 41.492, (init = 46.606), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 1\n",
"amp_bec: 0.222, (init = 0.218), bounds = [0.00 : 1.25] \n",
"amp_th: 0.167, (init = 0.218), bounds = [0.00 : 1.25] \n",
"x0_bec: 125.679, (init = 123.764), bounds = [113.76 : 133.76] \n",
"y0_bec: 126.265, (init = 126.074), bounds = [116.07 : 136.07] \n",
"x0_th: 125.736, (init = 123.764), bounds = [113.76 : 133.76] \n",
"y0_th: 126.341, (init = 126.074), bounds = [116.07 : 136.07] \n",
"sigmax_bec: 16.318, (init = 14.760), bounds = [0.00 : 47.54] \n",
"sigmay_bec: 15.153, (init = 23.770), bounds = [0.00 : 47.54] \n",
"sigma_th: 29.155, (init = 31.996), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 2\n",
"amp_bec: 0.350, (init = 0.486), bounds = [0.00 : 1.48] \n",
"amp_th: 0.186, (init = 0.160), bounds = [0.00 : 1.48] \n",
"x0_bec: 125.699, (init = 123.665), bounds = [113.66 : 133.66] \n",
"y0_bec: 125.724, (init = 129.025), bounds = [119.02 : 139.02] \n",
"x0_th: 123.987, (init = 123.665), bounds = [113.66 : 133.66] \n",
"y0_th: 125.451, (init = 129.025), bounds = [119.02 : 139.02] \n",
"sigmax_bec: 19.430, (init = 19.502), bounds = [0.00 : 55.74] \n",
"sigmay_bec: 16.378, (init = 13.934), bounds = [0.00 : 27.87] \n",
"sigma_th: 25.125, (init = 31.308), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 3\n",
"amp_bec: 0.406, (init = 0.457), bounds = [0.00 : 1.97] \n",
"amp_th: 0.221, (init = 0.312), bounds = [0.00 : 1.97] \n",
"x0_bec: 124.571, (init = 123.005), bounds = [113.00 : 133.00] \n",
"y0_bec: 125.526, (init = 127.835), bounds = [117.83 : 137.83] \n",
"x0_th: 125.097, (init = 123.005), bounds = [113.00 : 133.00] \n",
"y0_th: 125.680, (init = 127.835), bounds = [117.83 : 137.83] \n",
"sigmax_bec: 21.363, (init = 20.053), bounds = [0.00 : 39.34] \n",
"sigmay_bec: 17.720, (init = 20.492), bounds = [0.00 : 40.98] \n",
"sigma_th: 22.086, (init = 22.374), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 4\n",
"amp_bec: 0.530, (init = 0.643), bounds = [0.00 : 1.76] \n",
"amp_th: 0.222, (init = 0.159), bounds = [0.00 : 1.76] \n",
"x0_bec: 124.518, (init = 121.597), bounds = [111.60 : 131.60] \n",
"y0_bec: 126.389, (init = 125.829), bounds = [115.83 : 135.83] \n",
"x0_th: 127.371, (init = 121.597), bounds = [111.60 : 131.60] \n",
"y0_th: 126.405, (init = 125.829), bounds = [115.83 : 135.83] \n",
"sigmax_bec: 22.847, (init = 21.878), bounds = [0.00 : 52.46] \n",
"sigmay_bec: 19.646, (init = 25.410), bounds = [0.00 : 50.82] \n",
"sigma_th: 19.150, (init = 27.009), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 5\n",
"amp_bec: 0.584, (init = 0.467), bounds = [0.00 : 1.73] \n",
"amp_th: 0.230, (init = 0.397), bounds = [0.00 : 1.73] \n",
"x0_bec: 124.242, (init = 125.610), bounds = [115.61 : 135.61] \n",
"y0_bec: 126.095, (init = 129.130), bounds = [119.13 : 139.13] \n",
"x0_th: 127.539, (init = 125.610), bounds = [115.61 : 135.61] \n",
"y0_th: 126.423, (init = 129.130), bounds = [119.13 : 139.13] \n",
"sigmax_bec: 24.476, (init = 22.582), bounds = [0.00 : 55.74] \n",
"sigmay_bec: 19.799, (init = 19.672), bounds = [0.00 : 39.34] \n",
"sigma_th: 17.612, (init = 16.015), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 6\n",
"amp_bec: 0.749, (init = 0.591), bounds = [0.00 : 2.09] \n",
"amp_th: 0.137, (init = 0.385), bounds = [0.00 : 2.09] \n",
"x0_bec: 125.001, (init = 123.000), bounds = [113.00 : 133.00] \n",
"y0_bec: 126.174, (init = 124.917), bounds = [114.92 : 134.92] \n",
"x0_th: 125.603, (init = 123.000), bounds = [113.00 : 133.00] \n",
"y0_th: 123.634, (init = 124.917), bounds = [114.92 : 134.92] \n",
"sigmax_bec: 25.120, (init = 23.228), bounds = [0.00 : 52.46] \n",
"sigmay_bec: 21.012, (init = 22.131), bounds = [0.00 : 44.26] \n",
"sigma_th: 18.497, (init = 14.680), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 7\n",
"amp_bec: 0.942, (init = 0.939), bounds = [0.00 : 2.83] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 2.83] \n",
"x0_bec: 125.129, (init = 124.890), bounds = [114.89 : 134.89] \n",
"y0_bec: 126.026, (init = 125.362), bounds = [115.36 : 135.36] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 25.268, (init = 23.196), bounds = [0.00 : 37.70] \n",
"sigmay_bec: 22.227, (init = 18.852), bounds = [0.00 : 37.70] \n",
"sigma_th: 14.660, (init = 14.660), bounds = [0.00 : 50.00] \n",
"\n",
"image: 1, 8\n",
"amp_bec: 0.962, (init = 0.868), bounds = [0.00 : 2.49] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 2.49] \n",
"x0_bec: 124.986, (init = 124.262), bounds = [114.26 : 134.26] \n",
"y0_bec: 126.237, (init = 125.803), bounds = [115.80 : 135.80] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 24.950, (init = 22.940), bounds = [0.00 : 49.18] \n",
"sigmay_bec: 22.706, (init = 18.033), bounds = [0.00 : 49.18] \n",
"sigma_th: 14.498, (init = 14.498), bounds = [0.00 : 50.00] \n",
"\n",
"image: 1, 9\n",
"amp_bec: 1.004, (init = 1.175), bounds = [0.00 : 2.53] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 2.53] \n",
"x0_bec: 124.837, (init = 124.274), bounds = [114.27 : 134.27] \n",
"y0_bec: 126.150, (init = 125.475), bounds = [115.48 : 135.48] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 25.198, (init = 23.461), bounds = [0.00 : 50.82] \n",
"sigmay_bec: 21.781, (init = 21.311), bounds = [0.00 : 50.82] \n",
"sigma_th: 22.517, (init = 22.517), bounds = [0.00 : 50.00] \n",
"\n",
"image: 1, 10\n",
"amp_bec: 0.877, (init = 1.087), bounds = [0.00 : 2.19] \n",
"amp_th: 0.000, (init = 0.000), bounds = [0.00 : 2.19] \n",
"x0_bec: 124.955, (init = 125.252), bounds = [115.25 : 135.25] \n",
"y0_bec: 126.100, (init = 126.356), bounds = [116.36 : 136.36] \n",
"x0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"y0_th: 1.000, (init = 1.000), bounds = [0.00 : 150.00] \n",
"sigmax_bec: 27.646, (init = 26.148), bounds = [0.00 : 50.82] \n",
"sigmay_bec: 22.830, (init = 22.131), bounds = [0.00 : 50.82] \n",
"sigma_th: 16.526, (init = 16.526), bounds = [0.00 : 50.00] \n",
"\n"
]
}
],
"source": [
"print_bval_bulk(result)\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:54:57.594806500Z",
"start_time": "2023-08-01T13:54:57.466504700Z"
}
}
},
{
"cell_type": "code",
"execution_count": 148,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.40202012547790794\n",
"amp_bec: 0.01, (init = 0.01), bounds = [0.00 : 0.40] \n",
"amp_th: 0.10, (init = 0.24), bounds = [0.00 : 0.40] \n",
"x0_bec: 124.50, (init = 124.06), bounds = [114.06 : 134.06] \n",
"y0_bec: 115.07, (init = 124.29), bounds = [114.29 : 134.29] \n",
"x0_th: 125.46, (init = 124.06), bounds = [114.06 : 134.06] \n",
"y0_th: 125.96, (init = 124.29), bounds = [114.29 : 134.29] \n",
"sigmax_bec: 79.34, (init = 47.78), bounds = [0.00 : 95.99] \n",
"sigmay_bec: 3.97, (init = 48.09), bounds = [0.00 : 96.17] \n",
"sigma_th: 38.05, (init = 38.77), bounds = [0.00 : 250.00] \n"
]
}
],
"source": [
"res = result[0][0]\n",
"print(res.init_params['amp_bec'].max)\n",
"\n",
"\n",
"def print_bval(result):\n",
" keys = result.best_values.keys()\n",
" bval = result.best_values\n",
" init = result.init_params\n",
"\n",
" for item in keys:\n",
" print(f'{item}: {bval[item]:.2f}, (init = {init[item].value:.2f}), bounds = [{init[item].min:.2f} : {init[item].max :.2f}] ')\n",
"\n",
"print_bval(res)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T11:52:39.509257700Z",
"start_time": "2023-08-01T11:52:39.395834200Z"
}
}
},
{
"cell_type": "code",
"execution_count": 82,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 0, 0\n",
"sigmax = 26.809654363723393, sigmay = 20.984865705907357 \n",
"49.68707529159811\n",
"[47.99635701 48.08743169]\n",
"image 0, 1\n",
"sigmax = 16.902431605565432, sigmay = 14.827716571560885 \n",
"15.654987743234889\n",
"[28.50637523 25.50091075]\n",
"image 0, 2\n",
"sigmax = 19.537062472446536, sigmay = 16.54490141361424 \n",
"18.026074303206485\n",
"[27.32240437 23.67941712]\n",
"image 0, 3\n",
"sigmax = 21.26943188775151, sigmay = 18.18988358733591 \n",
"19.556767700963444\n",
"[27.23132969 23.86156648]\n",
"image 0, 4\n",
"sigmax = 22.839337165618247, sigmay = 19.260967695867635 \n",
"20.90144486963491\n",
"[27.77777778 23.86156648]\n",
"image 0, 5\n",
"sigmax = 23.611867762365737, sigmay = 19.890208925283233 \n",
"21.630994243513612\n",
"[28.77959927 24.49908925]\n",
"image 0, 6\n",
"sigmax = 24.715898892965207, sigmay = 20.72301092040907 \n",
"22.830805825494014\n",
"[28.50637523 24.7723133 ]\n",
"image 0, 7\n",
"sigmax = 25.37740108909912, sigmay = 22.34732657140245 \n",
"23.78148211266294\n",
"[28.68852459 25.31876138]\n",
"image 0, 8\n",
"sigmax = 25.54988097917328, sigmay = 22.05819714419466 \n",
"24.633548951333726\n",
"[28.1420765 24.68123862]\n",
"image 0, 9\n",
"sigmax = 25.455752389974258, sigmay = 21.92384918530349 \n",
"25.16924937651061\n",
"[28.23315118 24.04371585]\n",
"image 0, 10\n",
"sigmax = 27.13351753291331, sigmay = 23.17650478721828 \n",
"25.428970385518063\n",
"[29.96357013 26.04735883]\n",
"image 1, 0\n",
"sigmax = 32.130698329287455, sigmay = 21.301370060449216 \n",
"38.991763920546184\n",
"[25.68306011 21.03825137]\n",
"image 1, 1\n",
"sigmax = 16.311826068846873, sigmay = 15.161785017907176 \n",
"15.035048897926897\n",
"[25.50091075 24.40801457]\n",
"image 1, 2\n",
"sigmax = 19.429204152163635, sigmay = 16.38000535679499 \n",
"18.382290279191036\n",
"[21.58469945 20.21857923]\n",
"image 1, 3\n",
"sigmax = 21.366923260200572, sigmay = 17.727126413466063 \n",
"19.81456970617587\n",
"[18.9435337 17.03096539]\n",
"image 1, 4\n",
"sigmax = 22.846174800426063, sigmay = 19.64564917108202 \n",
"22.056975277842138\n",
"[26.6848816 21.76684882]\n",
"image 1, 5\n",
"sigmax = 24.47493848239252, sigmay = 19.79849230949584 \n",
"21.90523925207991\n",
"[26.04735883 22.04007286]\n",
"image 1, 6\n",
"sigmax = 25.120085496179822, sigmay = 21.01142726725265 \n",
"24.103158393287867\n",
"[24.49908925 22.22222222]\n",
"image 1, 7\n",
"sigmax = 25.268375215655595, sigmay = 22.22675806585392 \n",
"23.646253048054273\n",
"[19.67213115 18.03278689]\n",
"image 1, 8\n",
"sigmax = 24.949462122653742, sigmay = 22.706400518903973 \n",
"23.217749345311454\n",
"[23.49726776 20.94717668]\n",
"image 1, 9\n",
"sigmax = 25.19797063692771, sigmay = 21.781054343748057 \n",
"24.053321531664213\n",
"[23.3151184 20.30965392]\n",
"image 1, 10\n",
"sigmax = 27.644788514841196, sigmay = 22.830162756976627 \n",
"26.373230050836366\n",
"[25.13661202 20.856102 ]\n"
]
}
],
"source": [
"for i in range(0,shape[0]):\n",
" for j in range(0, shape[1]):\n",
" print(f'image {i}, {j}')\n",
" bval = result[i][j].best_values\n",
"\n",
" print(f\"sigmax = {bval['sigmax_bec']}, sigmay = {bval['sigmay_bec']} \")\n",
" print(result_x[i][j].best_values['sigma_bec'])\n",
" print(BEC_width_guess[i,j] /1.22)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T10:25:48.757434900Z",
"start_time": "2023-08-01T10:25:48.698502800Z"
}
}
},
{
"cell_type": "code",
"execution_count": 173,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image: 0, 0\n",
"amp_bec: 0.000, (init = 0.000), bounds = [0.00 : 0.40] \n",
"amp_th: 0.103, (init = 0.138), bounds = [0.00 : 0.40] \n",
"x0_bec: 114.060, (init = 114.060), bounds = [114.06 : 134.06] \n",
"y0_bec: 114.291, (init = 114.291), bounds = [114.29 : 134.29] \n",
"x0_th: 125.454, (init = 124.060), bounds = [114.06 : 134.06] \n",
"y0_th: 125.676, (init = 124.291), bounds = [114.29 : 134.29] \n",
"sigmax_bec: 1.000, (init = 1.000), bounds = [0.00 : 95.99] \n",
"sigmay_bec: 1.000, (init = 1.000), bounds = [0.00 : 96.17] \n",
"sigma_th: 37.876, (init = 38.769), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 1\n",
"amp_bec: 0.217, (init = 0.168), bounds = [0.00 : 0.72] \n",
"amp_th: 0.169, (init = 0.230), bounds = [0.00 : 0.72] \n",
"x0_bec: 125.205, (init = 123.226), bounds = [113.23 : 133.23] \n",
"y0_bec: 126.138, (init = 126.090), bounds = [116.09 : 136.09] \n",
"x0_th: 124.613, (init = 123.226), bounds = [113.23 : 133.23] \n",
"y0_th: 126.037, (init = 126.090), bounds = [116.09 : 136.09] \n",
"sigmax_bec: 16.902, (init = 15.655), bounds = [0.00 : 57.01] \n",
"sigmay_bec: 14.834, (init = 25.501), bounds = [0.00 : 51.00] \n",
"sigma_th: 28.006, (init = 28.067), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 2\n",
"amp_bec: 0.351, (init = 0.314), bounds = [0.00 : 0.87] \n",
"amp_th: 0.186, (init = 0.238), bounds = [0.00 : 0.87] \n",
"x0_bec: 124.756, (init = 124.199), bounds = [114.20 : 134.20] \n",
"y0_bec: 125.997, (init = 125.119), bounds = [115.12 : 135.12] \n",
"x0_th: 125.359, (init = 124.199), bounds = [114.20 : 134.20] \n",
"y0_th: 125.902, (init = 125.119), bounds = [115.12 : 135.12] \n",
"sigmax_bec: 19.537, (init = 18.026), bounds = [0.00 : 54.64] \n",
"sigmay_bec: 16.545, (init = 23.679), bounds = [0.00 : 47.36] \n",
"sigma_th: 25.553, (init = 26.395), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 3\n",
"amp_bec: 0.417, (init = 0.378), bounds = [0.00 : 1.07] \n",
"amp_th: 0.221, (init = 0.284), bounds = [0.00 : 1.07] \n",
"x0_bec: 124.875, (init = 124.288), bounds = [114.29 : 134.29] \n",
"y0_bec: 126.008, (init = 125.419), bounds = [115.42 : 135.42] \n",
"x0_th: 125.107, (init = 124.288), bounds = [114.29 : 134.29] \n",
"y0_th: 125.814, (init = 125.419), bounds = [115.42 : 135.42] \n",
"sigmax_bec: 21.269, (init = 19.557), bounds = [0.00 : 54.46] \n",
"sigmay_bec: 18.190, (init = 23.862), bounds = [0.00 : 47.72] \n",
"sigma_th: 21.630, (init = 21.469), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 4\n",
"amp_bec: 0.506, (init = 0.480), bounds = [0.00 : 1.24] \n",
"amp_th: 0.228, (init = 0.257), bounds = [0.00 : 1.24] \n",
"x0_bec: 125.172, (init = 124.844), bounds = [114.84 : 134.84] \n",
"y0_bec: 125.980, (init = 125.632), bounds = [115.63 : 135.63] \n",
"x0_th: 125.047, (init = 124.844), bounds = [114.84 : 134.84] \n",
"y0_th: 125.947, (init = 125.632), bounds = [115.63 : 135.63] \n",
"sigmax_bec: 22.839, (init = 20.901), bounds = [0.00 : 55.56] \n",
"sigmay_bec: 19.261, (init = 23.862), bounds = [0.00 : 47.72] \n",
"sigma_th: 19.498, (init = 20.335), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 5\n",
"amp_bec: 0.578, (init = 0.501), bounds = [0.00 : 1.26] \n",
"amp_th: 0.238, (init = 0.360), bounds = [0.00 : 1.26] \n",
"x0_bec: 124.950, (init = 124.472), bounds = [114.47 : 134.47] \n",
"y0_bec: 125.948, (init = 125.613), bounds = [115.61 : 135.61] \n",
"x0_th: 125.549, (init = 124.472), bounds = [114.47 : 134.47] \n",
"y0_th: 126.311, (init = 125.613), bounds = [115.61 : 135.61] \n",
"sigmax_bec: 23.612, (init = 21.631), bounds = [0.00 : 57.56] \n",
"sigmay_bec: 19.890, (init = 24.499), bounds = [0.00 : 49.00] \n",
"sigma_th: 17.844, (init = 16.789), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 6\n",
"amp_bec: 0.624, (init = 0.582), bounds = [0.00 : 1.43] \n",
"amp_th: 0.273, (init = 0.326), bounds = [0.00 : 1.43] \n",
"x0_bec: 124.841, (init = 124.226), bounds = [114.23 : 134.23] \n",
"y0_bec: 126.087, (init = 125.493), bounds = [115.49 : 135.49] \n",
"x0_th: 125.518, (init = 124.226), bounds = [114.23 : 134.23] \n",
"y0_th: 125.329, (init = 125.493), bounds = [115.49 : 135.49] \n",
"sigmax_bec: 24.716, (init = 22.831), bounds = [0.00 : 57.01] \n",
"sigmay_bec: 20.723, (init = 24.772), bounds = [0.00 : 49.54] \n",
"sigma_th: 15.245, (init = 15.560), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 7\n",
"amp_bec: 0.726, (init = 0.745), bounds = [0.00 : 1.47] \n",
"amp_th: 0.246, (init = 0.221), bounds = [0.00 : 1.47] \n",
"x0_bec: 124.976, (init = 124.374), bounds = [114.37 : 134.37] \n",
"y0_bec: 126.191, (init = 125.431), bounds = [115.43 : 135.43] \n",
"x0_th: 125.065, (init = 124.374), bounds = [114.37 : 134.37] \n",
"y0_th: 125.186, (init = 125.431), bounds = [115.43 : 135.43] \n",
"sigmax_bec: 25.165, (init = 23.194), bounds = [0.00 : 57.38] \n",
"sigmay_bec: 21.561, (init = 25.319), bounds = [0.00 : 50.64] \n",
"sigma_th: 13.309, (init = 14.658), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 8\n",
"amp_bec: 0.761, (init = 0.840), bounds = [0.00 : 1.62] \n",
"amp_th: 0.285, (init = 0.230), bounds = [0.00 : 1.62] \n",
"x0_bec: 124.933, (init = 124.493), bounds = [114.49 : 134.49] \n",
"y0_bec: 125.930, (init = 125.501), bounds = [115.50 : 135.50] \n",
"x0_th: 125.286, (init = 124.493), bounds = [114.49 : 134.49] \n",
"y0_th: 125.894, (init = 125.501), bounds = [115.50 : 135.50] \n",
"sigmax_bec: 26.333, (init = 23.255), bounds = [0.00 : 56.28] \n",
"sigmay_bec: 22.180, (init = 24.681), bounds = [0.00 : 49.36] \n",
"sigma_th: 10.090, (init = 14.697), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 9\n",
"amp_bec: 0.720, (init = 0.779), bounds = [0.00 : 1.65] \n",
"amp_th: 0.404, (init = 0.330), bounds = [0.00 : 1.65] \n",
"x0_bec: 125.067, (init = 124.406), bounds = [114.41 : 134.41] \n",
"y0_bec: 126.004, (init = 125.502), bounds = [115.50 : 135.50] \n",
"x0_th: 124.710, (init = 124.406), bounds = [114.41 : 134.41] \n",
"y0_th: 126.249, (init = 125.502), bounds = [115.50 : 135.50] \n",
"sigmax_bec: 26.971, (init = 23.021), bounds = [0.00 : 56.47] \n",
"sigmay_bec: 22.523, (init = 24.044), bounds = [0.00 : 48.09] \n",
"sigma_th: 8.937, (init = 14.549), bounds = [0.00 : 250.00] \n",
"\n",
"image: 0, 10\n",
"amp_bec: 0.876, (init = 0.893), bounds = [0.00 : 1.40] \n",
"amp_th: 0.296, (init = 0.004), bounds = [0.00 : 1.40] \n",
"x0_bec: 125.119, (init = 124.672), bounds = [114.67 : 134.67] \n",
"y0_bec: 125.956, (init = 125.545), bounds = [115.54 : 135.54] \n",
"x0_th: 134.433, (init = 124.672), bounds = [114.67 : 134.67] \n",
"y0_th: 116.927, (init = 125.545), bounds = [115.54 : 135.54] \n",
"sigmax_bec: 27.134, (init = 25.429), bounds = [0.00 : 59.93] \n",
"sigmay_bec: 23.176, (init = 26.047), bounds = [0.00 : 52.09] \n",
"sigma_th: 0.445, (init = 16.071), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 0\n",
"amp_bec: 0.000, (init = 0.000), bounds = [0.00 : 1.22] \n",
"amp_th: 0.094, (init = 0.215), bounds = [0.00 : 1.22] \n",
"x0_bec: 112.431, (init = 112.431), bounds = [112.43 : 132.43] \n",
"y0_bec: 117.409, (init = 117.409), bounds = [117.41 : 137.41] \n",
"x0_th: 123.480, (init = 122.431), bounds = [112.43 : 132.43] \n",
"y0_th: 125.563, (init = 127.409), bounds = [117.41 : 137.41] \n",
"sigmax_bec: 1.000, (init = 1.000), bounds = [0.00 : 51.37] \n",
"sigmay_bec: 1.000, (init = 1.000), bounds = [0.00 : 42.08] \n",
"sigma_th: 41.492, (init = 46.919), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 1\n",
"amp_bec: 0.222, (init = 0.221), bounds = [0.00 : 1.25] \n",
"amp_th: 0.167, (init = 0.215), bounds = [0.00 : 1.25] \n",
"x0_bec: 125.676, (init = 123.764), bounds = [113.76 : 133.76] \n",
"y0_bec: 126.273, (init = 126.074), bounds = [116.07 : 136.07] \n",
"x0_th: 125.738, (init = 123.764), bounds = [113.76 : 133.76] \n",
"y0_th: 126.340, (init = 126.074), bounds = [116.07 : 136.07] \n",
"sigmax_bec: 16.309, (init = 15.038), bounds = [0.00 : 51.00] \n",
"sigmay_bec: 15.156, (init = 24.408), bounds = [0.00 : 48.82] \n",
"sigma_th: 29.161, (init = 32.054), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 2\n",
"amp_bec: 0.350, (init = 0.383), bounds = [0.00 : 1.48] \n",
"amp_th: 0.186, (init = 0.262), bounds = [0.00 : 1.48] \n",
"x0_bec: 125.700, (init = 123.665), bounds = [113.66 : 133.66] \n",
"y0_bec: 125.723, (init = 129.025), bounds = [119.02 : 139.02] \n",
"x0_th: 123.986, (init = 123.665), bounds = [113.66 : 133.66] \n",
"y0_th: 125.452, (init = 129.025), bounds = [119.02 : 139.02] \n",
"sigmax_bec: 19.432, (init = 18.382), bounds = [0.00 : 43.17] \n",
"sigmay_bec: 16.380, (init = 20.219), bounds = [0.00 : 40.44] \n",
"sigma_th: 25.127, (init = 23.158), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 3\n",
"amp_bec: 0.406, (init = 0.458), bounds = [0.00 : 1.97] \n",
"amp_th: 0.221, (init = 0.311), bounds = [0.00 : 1.97] \n",
"x0_bec: 124.575, (init = 123.005), bounds = [113.00 : 133.00] \n",
"y0_bec: 125.522, (init = 127.835), bounds = [117.83 : 137.83] \n",
"x0_th: 125.093, (init = 123.005), bounds = [113.00 : 133.00] \n",
"y0_th: 125.685, (init = 127.835), bounds = [117.83 : 137.83] \n",
"sigmax_bec: 21.369, (init = 19.815), bounds = [0.00 : 37.89] \n",
"sigmay_bec: 17.727, (init = 17.031), bounds = [0.00 : 34.06] \n",
"sigma_th: 22.086, (init = 23.094), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 4\n",
"amp_bec: 0.530, (init = 0.664), bounds = [0.00 : 1.76] \n",
"amp_th: 0.222, (init = 0.138), bounds = [0.00 : 1.76] \n",
"x0_bec: 124.518, (init = 121.597), bounds = [111.60 : 131.60] \n",
"y0_bec: 126.389, (init = 125.829), bounds = [115.83 : 135.83] \n",
"x0_th: 127.372, (init = 121.597), bounds = [111.60 : 131.60] \n",
"y0_th: 126.405, (init = 125.829), bounds = [115.83 : 135.83] \n",
"sigmax_bec: 22.846, (init = 22.057), bounds = [0.00 : 53.37] \n",
"sigmay_bec: 19.648, (init = 21.767), bounds = [0.00 : 43.53] \n",
"sigma_th: 19.152, (init = 28.619), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 5\n",
"amp_bec: 0.584, (init = 0.517), bounds = [0.00 : 1.73] \n",
"amp_th: 0.230, (init = 0.347), bounds = [0.00 : 1.73] \n",
"x0_bec: 124.245, (init = 125.610), bounds = [115.61 : 135.61] \n",
"y0_bec: 126.094, (init = 129.130), bounds = [119.13 : 139.13] \n",
"x0_th: 127.537, (init = 125.610), bounds = [115.61 : 135.61] \n",
"y0_th: 126.430, (init = 129.130), bounds = [119.13 : 139.13] \n",
"sigmax_bec: 24.480, (init = 21.905), bounds = [0.00 : 52.09] \n",
"sigmay_bec: 19.802, (init = 22.040), bounds = [0.00 : 44.08] \n",
"sigma_th: 17.618, (init = 17.856), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 6\n",
"amp_bec: 0.749, (init = 0.591), bounds = [0.00 : 2.09] \n",
"amp_th: 0.137, (init = 0.385), bounds = [0.00 : 2.09] \n",
"x0_bec: 125.001, (init = 123.000), bounds = [113.00 : 133.00] \n",
"y0_bec: 126.174, (init = 124.917), bounds = [114.92 : 134.92] \n",
"x0_th: 125.603, (init = 123.000), bounds = [113.00 : 133.00] \n",
"y0_th: 123.634, (init = 124.917), bounds = [114.92 : 134.92] \n",
"sigmax_bec: 25.120, (init = 23.228), bounds = [0.00 : 49.00] \n",
"sigmay_bec: 21.012, (init = 22.222), bounds = [0.00 : 44.44] \n",
"sigma_th: 18.497, (init = 14.680), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 7\n",
"amp_bec: 0.756, (init = 0.936), bounds = [0.00 : 2.83] \n",
"amp_th: 0.270, (init = 0.247), bounds = [0.00 : 2.83] \n",
"x0_bec: 124.566, (init = 124.890), bounds = [114.89 : 134.89] \n",
"y0_bec: 126.524, (init = 125.362), bounds = [115.36 : 135.36] \n",
"x0_th: 127.625, (init = 124.890), bounds = [114.89 : 134.89] \n",
"y0_th: 123.574, (init = 125.362), bounds = [115.36 : 135.36] \n",
"sigmax_bec: 25.560, (init = 23.201), bounds = [0.00 : 39.34] \n",
"sigmay_bec: 21.976, (init = 18.033), bounds = [0.00 : 36.07] \n",
"sigma_th: 10.918, (init = 14.663), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 8\n",
"amp_bec: 0.752, (init = 0.836), bounds = [0.00 : 2.49] \n",
"amp_th: 0.313, (init = 0.336), bounds = [0.00 : 2.49] \n",
"x0_bec: 124.766, (init = 124.262), bounds = [114.26 : 134.26] \n",
"y0_bec: 126.339, (init = 125.803), bounds = [115.80 : 135.80] \n",
"x0_th: 125.826, (init = 124.262), bounds = [114.26 : 134.26] \n",
"y0_th: 125.887, (init = 125.803), bounds = [115.80 : 135.80] \n",
"sigmax_bec: 25.700, (init = 22.730), bounds = [0.00 : 46.99] \n",
"sigmay_bec: 23.133, (init = 20.947), bounds = [0.00 : 41.89] \n",
"sigma_th: 9.610, (init = 14.365), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 9\n",
"amp_bec: 0.822, (init = 0.886), bounds = [0.00 : 2.53] \n",
"amp_th: 0.291, (init = 0.330), bounds = [0.00 : 2.53] \n",
"x0_bec: 124.518, (init = 124.274), bounds = [114.27 : 134.27] \n",
"y0_bec: 126.183, (init = 125.475), bounds = [115.48 : 135.48] \n",
"x0_th: 126.405, (init = 124.274), bounds = [114.27 : 134.27] \n",
"y0_th: 125.945, (init = 125.475), bounds = [115.48 : 135.48] \n",
"sigmax_bec: 26.098, (init = 22.764), bounds = [0.00 : 46.63] \n",
"sigmay_bec: 22.223, (init = 20.310), bounds = [0.00 : 40.62] \n",
"sigma_th: 8.711, (init = 14.387), bounds = [0.00 : 250.00] \n",
"\n",
"image: 1, 10\n",
"amp_bec: 0.875, (init = 1.085), bounds = [0.00 : 2.19] \n",
"amp_th: 2.190, (init = 0.013), bounds = [0.00 : 2.19] \n",
"x0_bec: 124.948, (init = 125.252), bounds = [115.25 : 135.25] \n",
"y0_bec: 126.115, (init = 126.356), bounds = [116.36 : 136.36] \n",
"x0_th: 128.909, (init = 125.252), bounds = [115.25 : 135.25] \n",
"y0_th: 118.954, (init = 126.356), bounds = [116.36 : 136.36] \n",
"sigmax_bec: 27.665, (init = 26.371), bounds = [0.00 : 50.27] \n",
"sigmay_bec: 22.836, (init = 20.856), bounds = [0.00 : 41.71] \n",
"sigma_th: 0.365, (init = 16.667), bounds = [0.00 : 250.00] \n",
"\n"
]
}
],
"source": [
"print_bval_bulk(result_1)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:23:38.538388800Z",
"start_time": "2023-08-01T13:23:38.428939500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 37,
"outputs": [
{
"data": {
"text/plain": "111.52339962118164"
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"result_x[1][0].best_values['sigma_th']"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T09:35:39.865148600Z",
"start_time": "2023-08-01T09:35:39.777868400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 189,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 0, 0\n",
"check val, 0.0\n",
"image 0, 1\n",
"check val, 202.81899317348075\n",
"image 0, 2\n",
"check val, 171.66227694315586\n",
"image 0, 3\n",
"check val, 137.86010387483958\n",
"image 0, 4\n",
"check val, 112.63334115900692\n",
"image 0, 5\n",
"check val, 80.32146811618618\n",
"image 0, 6\n",
"check val, 47.14137119721544\n",
"image 0, 7\n",
"check val, 20.13939399629303\n",
"image 0, 8\n",
"check val, 7.729201970644159\n",
"image 0, 9\n",
"check val, -0.24707647603264393\n",
"image 0, 10\n",
"check val, -10.485648818860035\n",
"image 1, 0\n",
"check val, 0.0\n",
"image 1, 1\n",
"check val, 155.40174729200504\n",
"image 1, 2\n",
"check val, 267.84199180102325\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\ipykernel_36888\\2144014449.py:109: RuntimeWarning: invalid value encountered in power\n",
" res = np.where(res > 0, res**(3/2), 0)\n",
"C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\ipykernel_36888\\737382478.py:25: RuntimeWarning: Mean of empty slice\n",
" check_value = np.nanmean(mask2[i,j]) / (bval[\"amp_bec\"] + bval[\"amp_th\"])\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"image 1, 3\n",
"check val, 134.5222938744657\n",
"image 1, 4\n",
"check val, 90.07549048132266\n",
"image 1, 5\n",
"check val, 109.52459360079988\n",
"image 1, 6\n",
"check val, 63.76264252044428\n",
"image 1, 7\n",
"check val, 75.0924950611463\n",
"image 1, 8\n",
"check val, 29.827565402107858\n",
"image 1, 9\n",
"check val, -0.20590658874586376\n",
"image 1, 10\n",
"check val, 3.7193052125950476\n"
]
},
{
"data": {
"text/plain": "<Figure size 1000x1000 with 22 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0QAAAMtCAYAAAC/4rG8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADdtElEQVR4nOzde3xU1b3//9e2URoUKEhBLuEiAaSHawBvaIHT2EJ7UkUtVKkFK6fK19IW9UdFTs9mtwUsohybWvAUjlKLVspFTS22RsULpSIGC7VQiQUNFEEMJNSGS8r6/bH2TBLITDKTSeay388+0kxm9mzWfFyzZz57r/VZjjHGICIiIiIiEkBnJbsBIiIiIiIiyaKESEREREREAksJkYiIiIiIBJYSIhERERERCSwlRCIiIiIiElhKiEREREREJLCUEImIiIiISGApIRIRERERkcBSQiQiIiIiIoEVU0J07NgxrrnmGvr168eQIUO46qqrKC0tBWDMmDH07t2boUOHMnToUBYvXhx+3sGDBxk3bhx9+/Zl4MCBvPLKK4l9FSlAsYlO8YlMsYlO8YlO8YlMsYlO8YlMsYlO8YlMsUlTJgZVVVXm2WefNadOnTLGGFNYWGhGjx5tjDFm9OjRZt26dfU+7+abbzau6xpjjNm8ebPp1q2bOXHiRCz/dMpTbKJTfCJTbKJTfKJTfCJTbKJTfCJTbKJTfCJTbNJTVizJ0yc/+Um++MUvhv++9NJLWbRoUYPPW7VqVTg7HjlyJF27duXll18mPz//jG2PHz/O8ePHw3+fOnWK8vJyzj//fBzHiaW5Le6KK67g6NGjAAwcOJD77ruPyspK/vWvf/HPf/6TysrKM56zatUqtm7dSmVlJf369aNjx4689NJLfP7znz9j23SODSg+0TQ1Nv3796dz586sXr2aSZMmcdZZdS/+pnNsQH2nIYpPZIpNdIpPZIpNdIpPZIpN8zLGcPToUbp27XrG952m7DRuX/va18y3v/1tY4zNevv3728GDhxoJk6caN59911jjDGHDh0y55xzTp3nfeUrXzHLly+vd5+u6xog0D/33XefYqP4xP1TVlam2ET4Ud9RfBQbxUexSa0fxUexifenvu878XKMMYY4zJ8/n6KiIl544QVat25NWVkZOTk5GGN46KGH+NnPfsZf/vIXPvroI7p27Vonk504cSLjxo3jG9/4xhn7PT3rraiooEePHpSVldG2bdt4mtriFi1axHPPPcczzzxD69at2bt3L927d8cYw89//nOWLVvG5s2bKS8vp3///nz44YcAVFZWkpOTQ2FhId/61rfO2G8mxAYUn2jijQ3A5MmT+c1vfsORI0do165dnf1mQmxAfachik9kik10ik9kik10ik9kik3zCMWnvu87cYsni7rvvvvM8OHDzeHDhyNu06pVK3Po0CFjjDGtW7c2+/fvDz82cuRI8/zzzzfq36qoqDCAqaioiKepLa4psQm91qeeeqpR/1a6xcYYxSeapr6v8vLyGv160y02xqjvNETxiUyxiU7xiUyxiU7xiUyxaT7N8XpjHnj3wAMP8MQTT/D888/zqU99CoDq6moOHDgQ3mbNmjV07tyZ888/H4CvfOUrLF26FIA33niDffv2MXr06Fj/6ZTX1Ni8+eabgB17mokUn8gS8b7av39/i7e7pajvRKf4RKbYRKf4RKbYRKf4RKbYpJ+Yhszt3buXnJwcLrzwQtq0aQNAq1atePHFFxk9ejTHjx/nrLPOomPHjjzwwAMMGTIEgAMHDnDTTTexe/duzjnnHH76058yduzYRv2blZWVtGvXjoqKipS+DJiI2GRlZbFz585Gv9Z0iQ0oPtEk6n314x//mIKCgka93nSJDajvNETxiUyxiU7xiUyxiU7xiUyxaX7N8XrjnkPUUoL0HznW1xqk2IDi05BYXq9ik9jt053iE5liE53iE5liE53iE5liE11zvN4E1aoTERERERFJP0qIREREREQksJQQiYiIiIhIYCkhEhERERGRwFJCJCIiIiIigaWESEREREREAksJkYiIiIiIBJYSIhERERERCSwlRCIiIiIiElhKiEREREREJLCUEImIiIiISGApIRIRERERkcBSQiQiIiIiIoGlhEhERERERAJLCZGIiIiIiASWEiIREREREQksJUQiIiIiIhJYSohERERERCSwlBCJiIiIiEhgKSESEREREZHAUkIkIiIiIiKBpYRIREREREQCSwmRiIiIiIgElhIiEREREREJLCVEIiIiIiISWEqIREREREQksJQQiYiIiIhIYCkhEhERERGRwFJCJCIiIiIigaWESEREREREAksJkYiIiIiIBJYSIhERERERCSwlRCIiIiIiElhKiEREREREJLCUEImIiIiISGApIRIRERERkcBSQiQiIiIiIoGlhEhERERERAJLCZGIiIiIiASWEiIREREREQksJUQiIiIiIhJYSohERERERCSwlBCJiIiIiEhgKSESEREREZHAUkIkIiIiIiKBpYRIREREREQCSwmRiIiIiIgElhIiEREREREJLCVEIiIiIiISWEqIREREREQksJQQiYiIiIhIYCkhEhERERGRwFJCJCIiIiIigaWESEREREREAksJkYiIiIiIBJYSIhERERERCSwlRCIiIiIiElhKiEREREREJLCUEImIiIiISGApIRIRERERkcBSQiQiIiIiIoEVU0J07NgxrrnmGvr168eQIUO46qqrKC0tBeDgwYOMGzeOvn37MnDgQF555ZXw86I9likSEZtLL700Wc1vdopPZIl6X23cuDFZL6FZqe9Ep/hEpthEp/hEpthEp/hEptikKRODqqoq8+yzz5pTp04ZY4wpLCw0o0ePNsYYc/PNNxvXdY0xxmzevNl069bNnDhxosHHGlJRUWEAU1FREUtTW1wiYvPiiy8awBw6dKhR/2a6xMYYxSeaRL2vunbt2ujXmy6xMUZ9pyGKT2SKTXSKT2SKTXSKT2SKTfNrjtcbU0J0ujfeeMP07NnTGGPMueeea/bv3x9+bOTIkeb5559v8LHTHTt2zFRUVIR/ysrK0vI/cjyxCf0Hfuqpp+rdZ6bExhjFJ5p431d5eXkRX2+mxMYY9Z2GKD6RKTbRKT6RKTbRKT6RKTaJ1xwJUZPmED344INcffXVfPTRR5w8eZILLrgg/FivXr14//33oz5WnwULFtCuXbvwT05OTlOamDTxxgZg79699e4zU2IDik808camR48eEfeZKbEB9Z2GKD6RKTbRKT6RKTbRKT6RKTbpIe6EaP78+ZSWlrJgwYJEtofZs2dTUVER/ikrK0vo/luCYhOd4hOZYhOd4hOd4hOZYhOd4hOZYhOd4hOZYpM+suJ50qJFi1i7di3FxcW0bt2a1q1bk5WVxQcffBDObvfs2UOPHj04//zzIz5Wn1atWtGqVas4X07yNTU2AN27d6933+keG1B8omlqbCJddYX0jw2o7zRE8YlMsYlO8YlMsYlO8YlMsUkzsY6xu//++01eXp4pLy+vc/+UKVPOmOAdmigW7bGGpNNEsabGJtMn0Sk+kSXifdWlS5eMLKpgjPpOQxSfyBSb6BSfyBSb6BSfyBSb5pX0ogqhSVsXXnihGTJkiBkyZIi5+OKLjTHGfPDBB+aqq64yubm55jOf+Yx58cUXw8+L9lhD0uU/ciJic9FFF8X0WtMlNsYoPtEk6n1VVFSUkQmR+k50ik9kik10ik9kik10ik9kik3za47X6xhjTAIvOCVcZWUl7dq1o6KigrZt2ya7Oc0q1tcapNiA4tOQWF6vYpPY7dOd4hOZYhOd4hOZYhOd4hOZYhNdc7zeJlWZExERERERSWdKiEREREREJLCUEImIiIiISGApIRIRERERkcBSQiQiIiIiIoGlhEhERERERAJLCZGIiIiIiASWEiIREREREQksJUQiIiIiIhJYSohERERERCSwlBCJiIiIiEhgKSESEREREZHAUkIkIiIiIiKBpYRIREREREQCSwmRiIiIiIgElhIiEREREREJLCVEIiIiIiISWEqIREREREQ
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mask = np.zeros(shape)\n",
"mask2 = np.zeros(shape)\n",
"mask3 = []\n",
"fig, ax = plt.subplots(shape[0],shape[1], figsize=(10,10))\n",
"\n",
"for i in range(0, shape[0]):\n",
" temp_arr = []\n",
" for j in range(0, shape[1]):\n",
" print(f'image {i}, {j}')\n",
" arr = []\n",
" bval = result[i][j].best_values\n",
" sigma_cut = max(BEC_width_guess[i,j,0], BEC_width_guess[i,j,1])\n",
" tf_fit = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=BEC_width_guess[i,j,0]/1.22, sigmay=BEC_width_guess[i,j,1]/1.22)\n",
" tf_fit_2 = ThomasFermi_2d(X,Y,centerx=bval['x0_bec'], centery=bval['y0_bec'], amplitude=bval['amp_bec'], sigmax=1.5 * sigma_cut/1.22, sigmay=1.5* sigma_cut/1.22)\n",
"\n",
"\n",
" mask[i,j] = np.where(tf_fit > 0, np.nan, cropOD[i,j])\n",
" #mask[i,j] = gaussian_filter(mask[i,j], sigma = 0.4)\n",
" #mask[i,j] = np.where(tf_fit_2 > 0, mask[i,j], np.nan)\n",
" mask2[i,j] = np.where(tf_fit_2 > 0, mask[i,j], np.nan)\n",
" # print(f'max = {np.nanmax(mask[i,j])}, {np.nanmax(mask[i,j]) / np.nanmin(mask[i,j])}')\n",
"\n",
"\n",
"\n",
" check_value = np.nanmean(mask2[i,j]) / (bval[\"amp_bec\"] + bval[\"amp_th\"])\n",
"\n",
" print(f'check val, {np.nansum(mask2[i,j])}')\n",
2023-07-27 17:16:08 +02:00
"\n",
" ax[i,j].pcolormesh(mask2[i,j], cmap='jet',vmin=0,vmax=0.5)\n",
2023-07-27 17:16:08 +02:00
"\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-01T13:29:36.744796500Z",
"start_time": "2023-08-01T13:29:33.948301900Z"
2023-07-27 17:16:08 +02:00
}
}
},
{
"cell_type": "code",
"execution_count": 18,
2023-07-27 17:16:08 +02:00
"outputs": [
{
"data": {
"text/plain": "array([[ 0.07268155, -0.09124867, 0.11122564, ..., 0.09485779,\n 0.04357125, 0.02711324],\n [ 0.09737416, 0.01287571, 0.04367506, ..., 0.04072961,\n -0.04108686, -0.02136833],\n [ 0.17652024, 0.05190786, 0.02469261, ..., 0.06313304,\n -0.01336323, -0.02586351],\n ...,\n [-0.11633899, -0.0156079 , -0.01670185, ..., 0.03050345,\n 0.01282069, 0.06573208],\n [ 0.07503519, -0.00413224, -0.00858374, ..., -0.02333086,\n 0.06368782, 0.03050345],\n [-0.08058049, 0.01200014, 0.02309571, ..., 0.05032508,\n -0.10199917, -0.00209424]])"
2023-07-27 17:16:08 +02:00
},
"execution_count": 18,
2023-07-27 17:16:08 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cropOD[0][0]"
2023-07-26 09:41:51 +02:00
],
2023-07-20 20:34:19 +02:00
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-02T14:46:21.508554600Z",
"start_time": "2023-08-02T14:46:21.329176100Z"
}
}
},
{
"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
}