5682 lines
2.8 MiB
Plaintext
5682 lines
2.8 MiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Import supporting package"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import xarray as xr\n",
|
||
|
"import numpy as np\n",
|
||
|
"import copy\n",
|
||
|
"\n",
|
||
|
"from uncertainties import ufloat\n",
|
||
|
"from uncertainties import unumpy as unp\n",
|
||
|
"from uncertainties import umath\n",
|
||
|
"import random\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"plt.rcParams['font.size'] = 12\n",
|
||
|
"\n",
|
||
|
"from DataContainer.ReadData import read_hdf5_file\n",
|
||
|
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
|
||
|
"from Analyser.FitAnalyser import FitAnalyser\n",
|
||
|
"from Analyser.FitAnalyser import NewFitModel, DensityProfileBEC2dModel\n",
|
||
|
"from ToolFunction.ToolFunction import *\n",
|
||
|
"\n",
|
||
|
"from scipy.optimize import curve_fit\n",
|
||
|
"\n",
|
||
|
"from ToolFunction.HomeMadeXarrayFunction import errorbar, dataarray_plot_errorbar\n",
|
||
|
"xr.plot.dataarray_plot.errorbar = errorbar\n",
|
||
|
"xr.plot.accessor.DataArrayPlotAccessor.errorbar = dataarray_plot_errorbar\n",
|
||
|
"\n",
|
||
|
"imageAnalyser = ImageAnalyser()\n",
|
||
|
"\n",
|
||
|
"# %matplotlib notebook"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Start a client for parallel computing"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div>\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
|
||
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-a5e5cea6-2fbd-11ee-8430-80e82ce2fa8e</p>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
"\n",
|
||
|
" <tr>\n",
|
||
|
" \n",
|
||
|
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
|
||
|
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
|
||
|
" \n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
" <details>\n",
|
||
|
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
|
||
|
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
|
||
|
" </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
|
||
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">49266936</p>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Workers:</strong> 8\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads:</strong> 128\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total memory:</strong> 149.01 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" \n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
|
||
|
" <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
|
||
|
"</tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
" </table>\n",
|
||
|
"\n",
|
||
|
" <details>\n",
|
||
|
" <summary style=\"margin-bottom: 20px;\">\n",
|
||
|
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
|
||
|
" </summary>\n",
|
||
|
"\n",
|
||
|
" <div style=\"\">\n",
|
||
|
" <div>\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
|
||
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-6db1fb2d-d8be-4f76-9fcf-6a7cc9ed86ee</p>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm:</strong> tcp://127.0.0.1:63903\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Workers:</strong> 8\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads:</strong> 128\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Started:</strong> Just now\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total memory:</strong> 149.01 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" </table>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
"\n",
|
||
|
" <details style=\"margin-left: 48px;\">\n",
|
||
|
" <summary style=\"margin-bottom: 20px;\">\n",
|
||
|
" <h3 style=\"display: inline;\">Workers</h3>\n",
|
||
|
" </summary>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63943\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63946/status\" target=\"_blank\">http://127.0.0.1:63946/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63906\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-sctehcfb\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63957\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63959/status\" target=\"_blank\">http://127.0.0.1:63959/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63907\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-b1kdawd2\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63948\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63951/status\" target=\"_blank\">http://127.0.0.1:63951/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63908\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-845evwbp\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63942\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63944/status\" target=\"_blank\">http://127.0.0.1:63944/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63909\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-xneexydx\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63949\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63953/status\" target=\"_blank\">http://127.0.0.1:63953/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63910\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-zb64b79v\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63950\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63954/status\" target=\"_blank\">http://127.0.0.1:63954/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63911\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-q6lyanmx\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 6</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63925\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63934/status\" target=\"_blank\">http://127.0.0.1:63934/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63912\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-1cvfk3q5\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
" <div style=\"margin-bottom: 20px;\">\n",
|
||
|
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
|
||
|
" <div style=\"margin-left: 48px;\">\n",
|
||
|
" <details>\n",
|
||
|
" <summary>\n",
|
||
|
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 7</h4>\n",
|
||
|
" </summary>\n",
|
||
|
" <table style=\"width: 100%; text-align: left;\">\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Comm: </strong> tcp://127.0.0.1:63958\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Total threads: </strong> 16\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:63961/status\" target=\"_blank\">http://127.0.0.1:63961/status</a>\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Memory: </strong> 18.63 GiB\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td style=\"text-align: left;\">\n",
|
||
|
" <strong>Nanny: </strong> tcp://127.0.0.1:63913\n",
|
||
|
" </td>\n",
|
||
|
" <td style=\"text-align: left;\"></td>\n",
|
||
|
" </tr>\n",
|
||
|
" <tr>\n",
|
||
|
" <td colspan=\"2\" style=\"text-align: left;\">\n",
|
||
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-0agsu53e\n",
|
||
|
" </td>\n",
|
||
|
" </tr>\n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </table>\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
" </div>\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </details>\n",
|
||
|
"</div>\n",
|
||
|
"\n",
|
||
|
" </details>\n",
|
||
|
" </div>\n",
|
||
|
"</div>\n",
|
||
|
" </details>\n",
|
||
|
" \n",
|
||
|
"\n",
|
||
|
" </div>\n",
|
||
|
"</div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<Client: 'tcp://127.0.0.1:63903' processes=8 threads=128, memory=149.01 GiB>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"from dask.distributed import Client\n",
|
||
|
"client = Client(n_workers=8, threads_per_worker=16, processes=True, memory_limit='20GB')\n",
|
||
|
"client"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Start a client for Mongo DB"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import pymongo\n",
|
||
|
"import xarray_mongodb\n",
|
||
|
"\n",
|
||
|
"from DataContainer.MongoDB import MongoDB\n",
|
||
|
"\n",
|
||
|
"mongoClient = pymongo.MongoClient('mongodb://control:DyLab2021@127.0.0.1:27017/?authMechanism=DEFAULT')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Set global path for experiment"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"groupList = [\n",
|
||
|
" \"images/MOT_3D_Camera/in_situ_absorption\",\n",
|
||
|
" \"images/ODT_1_Axis_Camera/in_situ_absorption\",\n",
|
||
|
" \"images/ODT_2_Axis_Camera/in_situ_absorption\",\n",
|
||
|
"]\n",
|
||
|
"\n",
|
||
|
"dskey = {\n",
|
||
|
" \"images/MOT_3D_Camera/in_situ_absorption\": \"camera_0\",\n",
|
||
|
" \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_1\",\n",
|
||
|
" \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
|
||
|
"}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"img_dir = 'C:/Users/control/DyLab/Experiments/DyBEC/'\n",
|
||
|
"SequenceName = \"Repetition_scan\"\n",
|
||
|
"folderPath = img_dir + SequenceName + \"/\" + get_date()\n",
|
||
|
"\n",
|
||
|
"mongoDB = mongoClient[SequenceName]\n",
|
||
|
"\n",
|
||
|
"DB = MongoDB(mongoClient, mongoDB, date=get_date())"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Repetition Scans"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## scan MOT freq"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 13,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'initial_horz_freq': array([102.75, 102.8 , 102.85, 102.9 , 102.95, 103. , 103.05]), 'initial_vert_freq': array([101.8 , 101.85, 101.9 , 101.95, 102. , 102.05, 102.1 , 102.15,\n",
|
||
|
" 102.2 , 102.25])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQm8zXX+/9+SPfdYQpSQKEsLLZRpG4NqZJ2IEiokpizZmmyTJVHMvwgj2bKUGVnGNjJSTBvSZkmELGks59q3/B/vj875nXvce78f9/M633vPua/P4+Ex5b7P+/s9z8/HePb+bDnOnTt3TthIgARIgARIgARIgASyDYEcFMBs09f8oiRAAiRAAiRAAiRgCFAAORBIgARIgARIgARIIJsRoABmsw7n1yUBEiABEiABEiABCiDHAAmQAAmQAAmQAAlkMwIUwGzW4fy6JEACJEACJEACJEAB5BggARIgARIgARIggWxGgAKYzTqcX5cESIAESIAESIAEKIAcAyRAAiRAAiRAAiSQzQhQALNZh/PrkgAJkAAJkAAJkAAFkGOABEiABEiABEiABLIZAQpgNutwfl0SIAESIAESIAESoAByDJAACZAACZAACZBANiNAAcxmHc6vSwIkQAIkQAIkQAIUQJ/HwK+//iq7d++WggULSo4cOXx+O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ZxAF0BORVQAF0ApTukF+C+BaYAWwuoiRqEhh0mVWqS210r+nVdC0Mqfr9fXv5GeeeUZ0ZlCbTeFIp2t1ylcrflosCjXdPKobQXUZ18SJE6Vbt26iG0Ejm7rFyJEjpW3bttKvXz+z32D9+vXhEK1Q6kkh+gytUmalluUE8MiRI2a3rjYt67722msGmgLU41
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0014\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0,1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (310, 815)\n",
|
||
|
"imageAnalyser.span = (550, 1275)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.pcolormesh(ax=ax, vmin=0, cmap='jet', cbar_kwargs = dict(label='NCount'))\n",
|
||
|
"plt.xlabel('Vert AOM Frequency')\n",
|
||
|
"plt.ylabel('Horz AOM Frequency')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 14,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
|
||
|
"<defs>\n",
|
||
|
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
|
||
|
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
|
||
|
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"</defs>\n",
|
||
|
"</svg>\n",
|
||
|
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
|
||
|
" *\n",
|
||
|
" */\n",
|
||
|
"\n",
|
||
|
":root {\n",
|
||
|
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
|
||
|
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
|
||
|
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
|
||
|
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
|
||
|
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
|
||
|
" --xr-background-color: var(--jp-layout-color0, white);\n",
|
||
|
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
|
||
|
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"html[theme=dark],\n",
|
||
|
"body[data-theme=dark],\n",
|
||
|
"body.vscode-dark {\n",
|
||
|
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
|
||
|
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
|
||
|
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
|
||
|
" --xr-border-color: #1F1F1F;\n",
|
||
|
" --xr-disabled-color: #515151;\n",
|
||
|
" --xr-background-color: #111111;\n",
|
||
|
" --xr-background-color-row-even: #111111;\n",
|
||
|
" --xr-background-color-row-odd: #313131;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-wrap {\n",
|
||
|
" display: block !important;\n",
|
||
|
" min-width: 300px;\n",
|
||
|
" max-width: 700px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-text-repr-fallback {\n",
|
||
|
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header {\n",
|
||
|
" padding-top: 6px;\n",
|
||
|
" padding-bottom: 6px;\n",
|
||
|
" margin-bottom: 4px;\n",
|
||
|
" border-bottom: solid 1px var(--xr-border-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header > div,\n",
|
||
|
".xr-header > ul {\n",
|
||
|
" display: inline;\n",
|
||
|
" margin-top: 0;\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type,\n",
|
||
|
".xr-array-name {\n",
|
||
|
" margin-left: 2px;\n",
|
||
|
" margin-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-sections {\n",
|
||
|
" padding-left: 0 !important;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input + label {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label {\n",
|
||
|
" cursor: pointer;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label:hover {\n",
|
||
|
" color: var(--xr-font-color0);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
" font-weight: 500;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary > span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding-left: 0.5em;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in + label:before {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" content: 'â–º';\n",
|
||
|
" font-size: 11px;\n",
|
||
|
" width: 15px;\n",
|
||
|
" text-align: center;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label:before {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label:before {\n",
|
||
|
" content: 'â–¼';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label > span {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary,\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" padding-top: 4px;\n",
|
||
|
" padding-bottom: 4px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" grid-column: 2 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-details {\n",
|
||
|
" display: none;\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" margin-bottom: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked ~ .xr-section-details {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 20px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap > label {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" vertical-align: top;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-preview {\n",
|
||
|
" color: var(--xr-font-color3);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-preview,\n",
|
||
|
".xr-array-data {\n",
|
||
|
" padding: 0 5px !important;\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-data,\n",
|
||
|
".xr-array-in:checked ~ .xr-array-preview {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-in:checked ~ .xr-array-data,\n",
|
||
|
".xr-array-preview {\n",
|
||
|
" display: inline-block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list {\n",
|
||
|
" display: inline-block !important;\n",
|
||
|
" list-style: none;\n",
|
||
|
" padding: 0 !important;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:before {\n",
|
||
|
" content: '(';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:after {\n",
|
||
|
" content: ')';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li:not(:last-child):after {\n",
|
||
|
" content: ',';\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-has-index {\n",
|
||
|
" font-weight: bold;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list,\n",
|
||
|
".xr-var-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > div,\n",
|
||
|
".xr-var-item label,\n",
|
||
|
".xr-var-item > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-even);\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > .xr-var-name:hover span {\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list > li:nth-child(odd) > div,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > label,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-odd);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dims {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dtype {\n",
|
||
|
" grid-column: 3;\n",
|
||
|
" text-align: right;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-preview {\n",
|
||
|
" grid-column: 4;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-index-preview {\n",
|
||
|
" grid-column: 2 / 5;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name,\n",
|
||
|
".xr-var-dims,\n",
|
||
|
".xr-var-dtype,\n",
|
||
|
".xr-preview,\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" white-space: nowrap;\n",
|
||
|
" overflow: hidden;\n",
|
||
|
" text-overflow: ellipsis;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name:hover,\n",
|
||
|
".xr-var-dims:hover,\n",
|
||
|
".xr-var-dtype:hover,\n",
|
||
|
".xr-attrs dt:hover {\n",
|
||
|
" overflow: visible;\n",
|
||
|
" width: auto;\n",
|
||
|
" z-index: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" display: none;\n",
|
||
|
" background-color: var(--xr-background-color) !important;\n",
|
||
|
" padding-bottom: 5px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
|
||
|
".xr-var-data-in:checked ~ .xr-var-data,\n",
|
||
|
".xr-index-data-in:checked ~ .xr-index-data {\n",
|
||
|
" display: block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-data > table {\n",
|
||
|
" float: right;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name span,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-name div,\n",
|
||
|
".xr-index-data,\n",
|
||
|
".xr-attrs {\n",
|
||
|
" padding-left: 25px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs,\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dl.xr-attrs {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 125px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt,\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" float: left;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
" width: auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" font-weight: normal;\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt:hover span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" background: var(--xr-background-color);\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
" white-space: pre-wrap;\n",
|
||
|
" word-break: break-all;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-icon-database,\n",
|
||
|
".xr-icon-file-text2,\n",
|
||
|
".xr-no-icon {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" width: 1em;\n",
|
||
|
" height: 1.5em !important;\n",
|
||
|
" stroke-width: 0;\n",
|
||
|
" stroke: currentColor;\n",
|
||
|
" fill: currentColor;\n",
|
||
|
"}\n",
|
||
|
"</style><pre class='xr-text-repr-fallback'><xarray.DataArray 'OD' (initial_horz_freq: 1, initial_vert_freq: 1)>\n",
|
||
|
"array([[65351.30239154]])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * initial_horz_freq (initial_horz_freq) float64 103.0\n",
|
||
|
" * initial_vert_freq (initial_vert_freq) float64 101.8</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'OD'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>initial_horz_freq</span>: 1</li><li><span class='xr-has-index'>initial_vert_freq</span>: 1</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-1a84307d-0552-4450-aa56-34b422ac9c57' class='xr-array-in' type='checkbox' checked><label for='section-1a84307d-0552-4450-aa56-34b422ac9c57' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>6.535e+04</span></div><div class='xr-array-data'><pre>array([[65351.30239154]])</pre></div></div></li><li class='xr-section-item'><input id='section-fc5fcc47-c424-4595-8493-b6fb33ab058a' class='xr-section-summary-in' type='checkbox' checked><label for='section-fc5fcc47-c424-4595-8493-b6fb33ab058a' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>initial_horz_freq</span></div><div class='xr-var-dims'>(initial_horz_freq)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>103.0</div><input id='attrs-2cb7430e-3fbe-4518-a5b0-c4ffa0684653' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2cb7430e-3fbe-4518-a5b0-c4ffa0684653' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-601e3bd6-edb0-4887-b832-a015a068cfbd' class='xr-var-data-in' type='checkbox'><label for='data-601e3bd6-edb0-4887-b832-a015a068cfbd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([103.05])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>initial_vert_freq</span></div><div class='xr-var-dims'>(initial_vert_freq)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>101.8</div><input id='attrs-ceb926a9-c49d-45f6-b305-c3026f758a01' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ceb926a9-c49d-45f6-b305-c3026f758a01' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-cdbc3fd8-77d8-4bda-8dc6-706f8c67e989' class='xr-var-data-in' type='checkbox'><label for='data-cdbc3fd8-77d8-4bda-8dc6-706f8c67e989' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([101.85])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-510b5835-0192-48da-a654-eee9ac81726a' class='xr-section-summary-in' type='checkbox' ><label for='section-510b5835-0192-48da-a654-eee9ac81726a' class='xr-section-summary' >Indexes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>initial_horz_freq</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-7f10b146-9ec5-442b-9b19-2080607460c7' class='xr-index-data-in' type='checkbox'/><label for='index-7f10b146-9ec5-442b-9b19-2080607460c7' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([103.05], dtype='float64', name='initial_horz_freq'))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>initial_vert_freq</div></div><div class='xr
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<xarray.DataArray 'OD' (initial_horz_freq: 1, initial_vert_freq: 1)>\n",
|
||
|
"array([[65351.30239154]])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * initial_horz_freq (initial_horz_freq) float64 103.0\n",
|
||
|
" * initial_vert_freq (initial_vert_freq) float64 101.8"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 14,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## scan MOT amp"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 15,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'initial_horz_amp': array([0.45, 0.49, 0.53, 0.57, 0.61, 0.65, 0.69, 0.73, 0.77, 0.81]), 'initial_vert_amp': array([0.35, 0.39, 0.43, 0.47, 0.51, 0.55, 0.59, 0.63, 0.67, 0.71])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQe0FEX2h68iWd4QlgySBJckSYlrQETAP1kluQiIoBiIklSSZAFByYhEJQiigEvalQUEBBUEkazkJIowD8npf27pzM6Lc+u9283MvF+dwznK+3V191eNfN7qqr7j1q1btwgNBEAABEAABEAABEAgxRC4AwKYYsYaNwoCIAACIAACIAAChgAEEA8CCIAACIAACIAACKQwAhDAFDbguF0QAAEQAAEQAAEQgADiGQABEAABEAABEACBFEYAApjCBhy3CwIgAAIgAAIgAAIQQDwDIAACIAACIAACIJDCCEAAU9iA43ZBAARAAARAAARAAAKIZwAEQAAEQAAEQAAEUhgBCGAKG3DcLgiAAAiAAAiAAAhAAPEMgAAIgAAIgAAIgEAKIwABTGEDjtsFARAAARAAARAAAQggngEQAAEQAAEQAAEQSGEEIIApbMBxuyAAAiAAAiAAAiAAAcQzAAIgAAIgAAIgAAIpjAAEMIUNOG4XBEAABEAABEAABCCAwmfg5s2bdOLECcqUKRPdcccdwqMQAwEQAAEQAAF3CNy6dYvOnz9PefLkoTvvvNPRk16+fJmuXr2qeo40adJQunTpRH0WLFiQDh8+HCf78ssv0/jx44lZDBgwgKZMmUJnz56lSpUqmd8vWbKk/5grV67Q66+/TnPnzqVLly5RjRo1aMKECZQvXz5/ho/t2LEjLVmyxPxe/fr1aezYsZQ5c2Z/5siRI/TKK6/Q6tWrKX369NSiRQsaOXIk8f2EcoMACkfn2LFjlD9/fmEaMRAAARAAARC4PQSOHj0aQ2K0r4LlL3v69PSHcse5cuWigwcPiiTw119/pRs3bviv4Mcff6SaNWvSf//7X3r00Udp+PDhNHjwYJoxYwYVK1aMBg0aROvWraO9e/eaQg63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jEEBLYMI4BFAIyiIGAbSAJYxCAIWghDEIoBAUYqgA2jwDEEAbWvIsBFDOyiYJAbShJctCAGWcbFIQQBtawbNuC+BC5Qrg06gABh9kxQQqgEKYEEAhKMsYBNASmDAOARSCsohBAC1gCaMQQCEoYcxtAfyciDIKry1Y7AIRNYQABsOk+nMIoBAnBFAIyjIGAbQEJoxDAIWgLGIQQAtYwigEUAhKGIMACkEhZghAAIUPAgRQCMoyBgG0BCaMQwCFoCxiEEALWMIoBFAIShhzWwC/UK4A1kUFUDjSOjEIoJAjBFAIyjIGAbQEJoxDAIWgLGIQQAtYwigEUAhKGHNbAFcqC2AtCKBwpHViEEAhRwigEJRlDAJoCUwYhwAKQVnEIIAWsIRRCKAQlDAGARSCQswQCEkBnDBhAo0YMYJOnjxJJUuWpDFjxtBDDz2U4JB9/PHH9M4779D+/fvJ4/FQ7dq1aeTIkZQtWzb/MZ9++in16dOHfv75ZypSpAgNHjyYGjVqJH4MIIBiVFZBCKAVLnEYAihGJQ5CAMWoxEEIoBiVKOi2AH6pXAGsgQqgaJy1QiEngPPnz6eWLVsSS2C1atVo8uTJNHXqVNq1axfdc889ce57/fr19Mgjj9Do0aOpXr16dPz4cXrppZeoaNGi9Nlnn5n8119/bQRy4MCBRvr49/v27Ut8bKVKlUQsIYAiTNYhCKA1MtEBEEARJqsQBNAKlygMARRhEofcFsC1RHS3+OoSD/5BRI9AAJVoyroJOQFkIStfvjxNnDjRfwfFixenhg0b0tChQ+PcFVf6OMuVPV8bO3asqQgePXrU/FbTpk2JBW758uX+DFcJs2TJQnPnzhWRggCKMFmHIIDWyEQHQABFmKxCEEArXKIwBF
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0015\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0,1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (310, 815)\n",
|
||
|
"imageAnalyser.span = (550, 1275)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.pcolormesh(ax=ax, vmin=0, cmap='jet', cbar_kwargs = dict(label='NCount'))\n",
|
||
|
"plt.xlabel('Vert AOM Frequency')\n",
|
||
|
"plt.ylabel('Horz AOM Frequency')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 16,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
|
||
|
"<defs>\n",
|
||
|
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
|
||
|
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
|
||
|
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"</defs>\n",
|
||
|
"</svg>\n",
|
||
|
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
|
||
|
" *\n",
|
||
|
" */\n",
|
||
|
"\n",
|
||
|
":root {\n",
|
||
|
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
|
||
|
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
|
||
|
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
|
||
|
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
|
||
|
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
|
||
|
" --xr-background-color: var(--jp-layout-color0, white);\n",
|
||
|
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
|
||
|
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"html[theme=dark],\n",
|
||
|
"body[data-theme=dark],\n",
|
||
|
"body.vscode-dark {\n",
|
||
|
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
|
||
|
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
|
||
|
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
|
||
|
" --xr-border-color: #1F1F1F;\n",
|
||
|
" --xr-disabled-color: #515151;\n",
|
||
|
" --xr-background-color: #111111;\n",
|
||
|
" --xr-background-color-row-even: #111111;\n",
|
||
|
" --xr-background-color-row-odd: #313131;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-wrap {\n",
|
||
|
" display: block !important;\n",
|
||
|
" min-width: 300px;\n",
|
||
|
" max-width: 700px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-text-repr-fallback {\n",
|
||
|
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header {\n",
|
||
|
" padding-top: 6px;\n",
|
||
|
" padding-bottom: 6px;\n",
|
||
|
" margin-bottom: 4px;\n",
|
||
|
" border-bottom: solid 1px var(--xr-border-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header > div,\n",
|
||
|
".xr-header > ul {\n",
|
||
|
" display: inline;\n",
|
||
|
" margin-top: 0;\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type,\n",
|
||
|
".xr-array-name {\n",
|
||
|
" margin-left: 2px;\n",
|
||
|
" margin-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-sections {\n",
|
||
|
" padding-left: 0 !important;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input + label {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label {\n",
|
||
|
" cursor: pointer;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label:hover {\n",
|
||
|
" color: var(--xr-font-color0);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
" font-weight: 500;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary > span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding-left: 0.5em;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in + label:before {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" content: 'â–º';\n",
|
||
|
" font-size: 11px;\n",
|
||
|
" width: 15px;\n",
|
||
|
" text-align: center;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label:before {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label:before {\n",
|
||
|
" content: 'â–¼';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label > span {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary,\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" padding-top: 4px;\n",
|
||
|
" padding-bottom: 4px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" grid-column: 2 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-details {\n",
|
||
|
" display: none;\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" margin-bottom: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked ~ .xr-section-details {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 20px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap > label {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" vertical-align: top;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-preview {\n",
|
||
|
" color: var(--xr-font-color3);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-preview,\n",
|
||
|
".xr-array-data {\n",
|
||
|
" padding: 0 5px !important;\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-data,\n",
|
||
|
".xr-array-in:checked ~ .xr-array-preview {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-in:checked ~ .xr-array-data,\n",
|
||
|
".xr-array-preview {\n",
|
||
|
" display: inline-block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list {\n",
|
||
|
" display: inline-block !important;\n",
|
||
|
" list-style: none;\n",
|
||
|
" padding: 0 !important;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:before {\n",
|
||
|
" content: '(';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:after {\n",
|
||
|
" content: ')';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li:not(:last-child):after {\n",
|
||
|
" content: ',';\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-has-index {\n",
|
||
|
" font-weight: bold;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list,\n",
|
||
|
".xr-var-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > div,\n",
|
||
|
".xr-var-item label,\n",
|
||
|
".xr-var-item > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-even);\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > .xr-var-name:hover span {\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list > li:nth-child(odd) > div,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > label,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-odd);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dims {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dtype {\n",
|
||
|
" grid-column: 3;\n",
|
||
|
" text-align: right;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-preview {\n",
|
||
|
" grid-column: 4;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-index-preview {\n",
|
||
|
" grid-column: 2 / 5;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name,\n",
|
||
|
".xr-var-dims,\n",
|
||
|
".xr-var-dtype,\n",
|
||
|
".xr-preview,\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" white-space: nowrap;\n",
|
||
|
" overflow: hidden;\n",
|
||
|
" text-overflow: ellipsis;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name:hover,\n",
|
||
|
".xr-var-dims:hover,\n",
|
||
|
".xr-var-dtype:hover,\n",
|
||
|
".xr-attrs dt:hover {\n",
|
||
|
" overflow: visible;\n",
|
||
|
" width: auto;\n",
|
||
|
" z-index: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" display: none;\n",
|
||
|
" background-color: var(--xr-background-color) !important;\n",
|
||
|
" padding-bottom: 5px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
|
||
|
".xr-var-data-in:checked ~ .xr-var-data,\n",
|
||
|
".xr-index-data-in:checked ~ .xr-index-data {\n",
|
||
|
" display: block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-data > table {\n",
|
||
|
" float: right;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name span,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-name div,\n",
|
||
|
".xr-index-data,\n",
|
||
|
".xr-attrs {\n",
|
||
|
" padding-left: 25px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs,\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dl.xr-attrs {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 125px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt,\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" float: left;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
" width: auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" font-weight: normal;\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt:hover span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" background: var(--xr-background-color);\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
" white-space: pre-wrap;\n",
|
||
|
" word-break: break-all;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-icon-database,\n",
|
||
|
".xr-icon-file-text2,\n",
|
||
|
".xr-no-icon {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" width: 1em;\n",
|
||
|
" height: 1.5em !important;\n",
|
||
|
" stroke-width: 0;\n",
|
||
|
" stroke: currentColor;\n",
|
||
|
" fill: currentColor;\n",
|
||
|
"}\n",
|
||
|
"</style><pre class='xr-text-repr-fallback'><xarray.DataArray 'OD' (initial_horz_amp: 1, initial_vert_amp: 1)>\n",
|
||
|
"array([[70751.40524034]])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * initial_horz_amp (initial_horz_amp) float64 0.81\n",
|
||
|
" * initial_vert_amp (initial_vert_amp) float64 0.59</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'OD'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>initial_horz_amp</span>: 1</li><li><span class='xr-has-index'>initial_vert_amp</span>: 1</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-177509d9-805b-470b-a14d-b81705fd4a60' class='xr-array-in' type='checkbox' checked><label for='section-177509d9-805b-470b-a14d-b81705fd4a60' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>7.075e+04</span></div><div class='xr-array-data'><pre>array([[70751.40524034]])</pre></div></div></li><li class='xr-section-item'><input id='section-76e14a22-fe3b-447b-b2dd-2bb3ba9aabbf' class='xr-section-summary-in' type='checkbox' checked><label for='section-76e14a22-fe3b-447b-b2dd-2bb3ba9aabbf' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>initial_horz_amp</span></div><div class='xr-var-dims'>(initial_horz_amp)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.81</div><input id='attrs-94907e0a-18ce-4351-bfaf-d564533bd62f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-94907e0a-18ce-4351-bfaf-d564533bd62f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e22171f2-c0a0-45f8-84b3-b4e8ef1bb135' class='xr-var-data-in' type='checkbox'><label for='data-e22171f2-c0a0-45f8-84b3-b4e8ef1bb135' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0.81])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>initial_vert_amp</span></div><div class='xr-var-dims'>(initial_vert_amp)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.59</div><input id='attrs-8ec82677-4202-4a42-869f-e24cda492fcb' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8ec82677-4202-4a42-869f-e24cda492fcb' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d4611850-9260-41d7-b5c7-4bf79a2b8bba' class='xr-var-data-in' type='checkbox'><label for='data-d4611850-9260-41d7-b5c7-4bf79a2b8bba' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0.59])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-4f941a64-d6be-490e-8286-4af1fee95797' class='xr-section-summary-in' type='checkbox' ><label for='section-4f941a64-d6be-490e-8286-4af1fee95797' class='xr-section-summary' >Indexes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>initial_horz_amp</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-7335d05f-250d-4928-af8b-4bf9e657a1f1' class='xr-index-data-in' type='checkbox'/><label for='index-7335d05f-250d-4928-af8b-4bf9e657a1f1' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([0.81], dtype='float64', name='initial_horz_amp'))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>initial_vert_amp</div></div><div class='xr-index-preview'>Pand
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<xarray.DataArray 'OD' (initial_horz_amp: 1, initial_vert_amp: 1)>\n",
|
||
|
"array([[70751.40524034]])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * initial_horz_amp (initial_horz_amp) float64 0.81\n",
|
||
|
" * initial_vert_amp (initial_vert_amp) float64 0.59"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 16,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Scan final Z Comp Current"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 25,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'compZ_final_current': array([0.233, 0.234, 0.235, 0.236, 0.237, 0.238, 0.239, 0.24 , 0.241,\n",
|
||
|
" 0.242]), 'runs': array([0., 1., 2.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQmUFdW1/neLgKAMMgrSAipgiAY0yqAR6aWAKA8IKEPHJ/BHSYSIBCSCA4JGFAGBBTGC7zHbQJ6LWQgQAXF4EEUlDgyiMjQQkVEJgg/Cf+2jt9MT3Fu97+46u+5Xa7kE+tSp73y/s7u/PlWnbtqZM2fOEA44AAfgAByAA3AADsCBlHEgDQ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BaNDAjO/JwFWAP3mE08d6iueQ/59XZsZAqB/zPMokgLyfHhq8rQLR014CncMZn7Djz0DyLt/828CYeV4BtBvfqgvv/kUpk6bmTRfYAVQeU5JASnL87Z77cLxduCGhYGZ//Biu4BZae4QiF3A/rNDffnPKL9CbWbSfIEAqDynpICU5XnbvXbheDtww8LAzAa8wt4DmJ5ONH48XgHjM0HUl890CtemzUyaLxAAleeUFJCyPG+71y4cbwduWBiY2YGHTwKxwyqmFPUFZvkdkOYLBEDlOSUFpCzP2+7xzc5bNGcVBmZ2mEX1s4Bzj+vYMaILL7TDJJ5S1Fc8h/z7ujYzab5AAFSeM1JAyvK87V67cLwduGFhYGYHHgKgHVZYAbTHqriYSfMFAqDy3JICUpbnbfcIE96iwQqgPTSFKo5ijWEFMCKTMyLD0K4xab5AAFSeaFJAyvK87V67cLwduGFhYGYLXhR5IQDamoNRV6tdY9J8gQ
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0018\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0, 1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (325, 875)\n",
|
||
|
"imageAnalyser.span = (500, 500)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
|
||
|
"#plt.xlabel('')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 26,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
|
||
|
"<defs>\n",
|
||
|
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
|
||
|
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
|
||
|
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"</defs>\n",
|
||
|
"</svg>\n",
|
||
|
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
|
||
|
" *\n",
|
||
|
" */\n",
|
||
|
"\n",
|
||
|
":root {\n",
|
||
|
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
|
||
|
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
|
||
|
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
|
||
|
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
|
||
|
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
|
||
|
" --xr-background-color: var(--jp-layout-color0, white);\n",
|
||
|
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
|
||
|
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"html[theme=dark],\n",
|
||
|
"body[data-theme=dark],\n",
|
||
|
"body.vscode-dark {\n",
|
||
|
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
|
||
|
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
|
||
|
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
|
||
|
" --xr-border-color: #1F1F1F;\n",
|
||
|
" --xr-disabled-color: #515151;\n",
|
||
|
" --xr-background-color: #111111;\n",
|
||
|
" --xr-background-color-row-even: #111111;\n",
|
||
|
" --xr-background-color-row-odd: #313131;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-wrap {\n",
|
||
|
" display: block !important;\n",
|
||
|
" min-width: 300px;\n",
|
||
|
" max-width: 700px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-text-repr-fallback {\n",
|
||
|
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header {\n",
|
||
|
" padding-top: 6px;\n",
|
||
|
" padding-bottom: 6px;\n",
|
||
|
" margin-bottom: 4px;\n",
|
||
|
" border-bottom: solid 1px var(--xr-border-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header > div,\n",
|
||
|
".xr-header > ul {\n",
|
||
|
" display: inline;\n",
|
||
|
" margin-top: 0;\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type,\n",
|
||
|
".xr-array-name {\n",
|
||
|
" margin-left: 2px;\n",
|
||
|
" margin-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-sections {\n",
|
||
|
" padding-left: 0 !important;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input + label {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label {\n",
|
||
|
" cursor: pointer;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label:hover {\n",
|
||
|
" color: var(--xr-font-color0);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
" font-weight: 500;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary > span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding-left: 0.5em;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in + label:before {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" content: 'â–º';\n",
|
||
|
" font-size: 11px;\n",
|
||
|
" width: 15px;\n",
|
||
|
" text-align: center;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label:before {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label:before {\n",
|
||
|
" content: 'â–¼';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label > span {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary,\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" padding-top: 4px;\n",
|
||
|
" padding-bottom: 4px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" grid-column: 2 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-details {\n",
|
||
|
" display: none;\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" margin-bottom: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked ~ .xr-section-details {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 20px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap > label {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" vertical-align: top;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-preview {\n",
|
||
|
" color: var(--xr-font-color3);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-preview,\n",
|
||
|
".xr-array-data {\n",
|
||
|
" padding: 0 5px !important;\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-data,\n",
|
||
|
".xr-array-in:checked ~ .xr-array-preview {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-in:checked ~ .xr-array-data,\n",
|
||
|
".xr-array-preview {\n",
|
||
|
" display: inline-block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list {\n",
|
||
|
" display: inline-block !important;\n",
|
||
|
" list-style: none;\n",
|
||
|
" padding: 0 !important;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:before {\n",
|
||
|
" content: '(';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:after {\n",
|
||
|
" content: ')';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li:not(:last-child):after {\n",
|
||
|
" content: ',';\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-has-index {\n",
|
||
|
" font-weight: bold;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list,\n",
|
||
|
".xr-var-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > div,\n",
|
||
|
".xr-var-item label,\n",
|
||
|
".xr-var-item > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-even);\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > .xr-var-name:hover span {\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list > li:nth-child(odd) > div,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > label,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-odd);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dims {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dtype {\n",
|
||
|
" grid-column: 3;\n",
|
||
|
" text-align: right;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-preview {\n",
|
||
|
" grid-column: 4;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-index-preview {\n",
|
||
|
" grid-column: 2 / 5;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name,\n",
|
||
|
".xr-var-dims,\n",
|
||
|
".xr-var-dtype,\n",
|
||
|
".xr-preview,\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" white-space: nowrap;\n",
|
||
|
" overflow: hidden;\n",
|
||
|
" text-overflow: ellipsis;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name:hover,\n",
|
||
|
".xr-var-dims:hover,\n",
|
||
|
".xr-var-dtype:hover,\n",
|
||
|
".xr-attrs dt:hover {\n",
|
||
|
" overflow: visible;\n",
|
||
|
" width: auto;\n",
|
||
|
" z-index: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" display: none;\n",
|
||
|
" background-color: var(--xr-background-color) !important;\n",
|
||
|
" padding-bottom: 5px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
|
||
|
".xr-var-data-in:checked ~ .xr-var-data,\n",
|
||
|
".xr-index-data-in:checked ~ .xr-index-data {\n",
|
||
|
" display: block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-data > table {\n",
|
||
|
" float: right;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name span,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-name div,\n",
|
||
|
".xr-index-data,\n",
|
||
|
".xr-attrs {\n",
|
||
|
" padding-left: 25px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs,\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dl.xr-attrs {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 125px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt,\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" float: left;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
" width: auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" font-weight: normal;\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt:hover span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" background: var(--xr-background-color);\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
" white-space: pre-wrap;\n",
|
||
|
" word-break: break-all;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-icon-database,\n",
|
||
|
".xr-icon-file-text2,\n",
|
||
|
".xr-no-icon {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" width: 1em;\n",
|
||
|
" height: 1.5em !important;\n",
|
||
|
" stroke-width: 0;\n",
|
||
|
" stroke: currentColor;\n",
|
||
|
" fill: currentColor;\n",
|
||
|
"}\n",
|
||
|
"</style><pre class='xr-text-repr-fallback'><xarray.DataArray 'OD' (compZ_final_current: 1)>\n",
|
||
|
"array([26642.0066982])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * compZ_final_current (compZ_final_current) float64 0.238</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'OD'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>compZ_final_current</span>: 1</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-c81e0e81-6867-48a8-817b-0270bf8320f5' class='xr-array-in' type='checkbox' checked><label for='section-c81e0e81-6867-48a8-817b-0270bf8320f5' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>2.664e+04</span></div><div class='xr-array-data'><pre>array([26642.0066982])</pre></div></div></li><li class='xr-section-item'><input id='section-213a9602-e7c9-4a8d-872a-0a9a224c9c77' class='xr-section-summary-in' type='checkbox' checked><label for='section-213a9602-e7c9-4a8d-872a-0a9a224c9c77' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>compZ_final_current</span></div><div class='xr-var-dims'>(compZ_final_current)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.238</div><input id='attrs-97b5d183-12a2-43d2-bc55-2ce7784bfe38' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-97b5d183-12a2-43d2-bc55-2ce7784bfe38' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ac436865-f3d0-4ffc-8f65-960c2f4ccf32' class='xr-var-data-in' type='checkbox'><label for='data-ac436865-f3d0-4ffc-8f65-960c2f4ccf32' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0.238])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-084aa2db-fadf-4f9c-9080-822a3683ad63' class='xr-section-summary-in' type='checkbox' ><label for='section-084aa2db-fadf-4f9c-9080-822a3683ad63' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>compZ_final_current</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-8f148761-2dbb-435d-b8e1-c7a944c677c6' class='xr-index-data-in' type='checkbox'/><label for='index-8f148761-2dbb-435d-b8e1-c7a944c677c6' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([0.238], dtype='float64', name='compZ_final_current'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e55ccffc-8a2c-4845-bb7e-8ecd0686637c' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-e55ccffc-8a2c-4845-bb7e-8ecd0686637c' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<xarray.DataArray 'OD' (compZ_final_current: 1)>\n",
|
||
|
"array([26642.0066982])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * compZ_final_current (compZ_final_current) float64 0.238"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 26,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Scan final horz amp"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 27,
|
||
|
"metadata": {
|
||
|
"scrolled": false
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'final_horz_amp': array([5.0e-05, 7.0e-05, 9.0e-05, 1.1e-04, 1.3e-04, 1.5e-04, 1.7e-04,\n",
|
||
|
" 1.9e-04, 2.1e-04, 2.3e-04, 2.5e-04]), 'runs': array([0., 1., 2.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7tfQvYVVW59YuIJnJV0EBQPIQWWkAXBE2Do4KYRw0NhToimZiaqFwENE3ySniBg5p4SkQNsAwFFBWPitewUvP4J0gmilwSL4CioMHhf95J+2t/Hx+svdeeY6659jvW8/AIfnPOd44x3nft8c255toNtmzZskV4kQEyQAbIABkgA2SADJhhoAENoBmtCZQMkAEyQAbIABkgA44BGkAmAhkgA2SADJABMkAGjDFAA2hMcMIlA2SADJABMkAGyAANIHOADJABMkAGyAAZIAPGGKABNCY44ZIBMkAGyAAZIANkgAaQOUAGyAAZIANkgAyQAWMM0AAaE5xwyQAZIANkgAyQATJAA8gcIANkgAyQATJABsiAMQZoAI0JTrhkgAyQATJABsgAGaABZA6QATJABsgAGSADZMAYAzSAxgQnXDJABsgAGSADZIAM0AAyB8gAGSADZIAMkAEyYIwBGkBjghMuGSADZIAMkAEyQAZoAJkDZIAMkAEyQAbIABkwxgANoDHBCZcMkAEyQAbIABkgA9EZwF/84heif958802nzkEHHSSXXXaZ9OvXz/17y5YtMm7cOLnttttkzZo1csghh8jNN9/s2hWuTz/9VEaOHCkzZsyQDRs2yJFHHim33HKLtGvXrqaN9h02bJjMmTPH/b/jjz9eJk+eLC1atKhps2zZMjn33HPl8ccfl912200GDRok1113neyyyy7MHDJABsgAGSADZIAM5JaB6Azg3LlzpWHDhvKFL3zBkTpt2jSZMGGCvPTSS87kjR8/Xq666iq544475IADDpArr7xSnnrqKXnttdekadOmrs/ZZ58tOo622XPPPWXEiBHywQcfyAsvvODG1ksN5fLly52R1Gvo0KHSoUMH10+vzZs3S9euXaV169Zy/fXXy/vvvy+DBw+W/v37O6NY6vV///d/snLlSje3Bg0alNqN7cgAGSADZIAMkAFjDOgi10cffSRt27aVnXbaCYo+OgNYH9o99tjDmcAf/OAHjpQLLrhARo8e7Zrqat/ee+/tjOFZZ50l69atc6btrrvuklNOOcW1UQPWvn17mTdvnvTt21cWLVoknTt3loULF7oVRL307z179pTFixfLgQceKA899JAcd9xx8vbbb7uYes2cOVNOP/10Wb16tTRr1qwkYdRkamxeZIAMkAEyQAbIABkohQH1HsW7lqX0KbdN1AZQV+F++9vfupU3XQH83Oc+Jx07dpQXX3xRunXrVoP1hBNOcFu3ulqo27W65asrfi1btqxp06VLFznxxBPd9vHtt98uw4cPl7Vr19biS8e48cYbZciQIW7befbs2fLyyy/XtNFtYzWjGqN3794lca2GVMdVMUs1jSUN/M9G//jHP2T+/PnSp08fadSoUTldc9fWElYVh3hzl6IlT5jalkxVLhtS31zKVtKk0dp++OGHbtFI/Unz5s1LmlPaRlEawFdeecWtxm3cuFGaNGki06dPl2OPPVaee+45Oeyww2TFihU1q3IKXLdv33rrLXnkkUdcWzVwujJYfKlB2n///WXKlCly9dVXu+3hJUuW1GqjW8rad+zYsW5MfQ5RzVXxteuuu7q+AwcOrJdzjVscuyDme++9BzOAjz76qBx99NEmDKAVrAUDSLxpb21x99MPEWobt0aVzI76VsJe3H3R2qpnaNWqldvNRCwaFbMbpQH87LPPRA9gqAP+3e9+J7/85S/lySefdP9WA6hbum3atKnBceaZZ7oVtocffni7BlANkq4e3nrrrc4A6mqhPjdYfHXq1EnOOOMMGTNmTC1TWdxGD4Dceeedcuqpp9abpZdffrlbZax7qTFt3Lhx3JnN2ZEBMkAGyAAZIAOZMfDJJ5+4A6dmDWBd5o866ihn3vS5v9i3gLkCiKsb9G9euJmnG5l40/GWh17UNg8qpZ8j9U3PXew90dqaXwGsmwD6TJ/uiU+dOtVt/V544YVy0UUXuWa6WrjXXnttcwjk7rvvlgEDBrg2q1atcg9T1j0E8vzzz0v37t1dG/17jx49tjkEooc4CquN99xzj3sesZxDICqm7uOj3Lwmo+LSLXILzwBawao5aUlba3ipbewf85XNj/pWxl/MvdHaoj1DMbfRbQFffPHF7hUtavj0KLSevL322mvd9q5u4+pp32uuucaZQd2y1e3cBQsWbPMamAceeMA9q6eHNv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N8WbHALXNjvsQkalvCJaziYHWFukZaAAD5wxSTBrAwGIGDoe+0QSGkxjOEl5LWLkiVt0rYtb0Rdcu0jPQACZ+DPltgBSTBtCvVrGNhr7REG92DFDb7LgPEZn6hmA5mxhobZGegQYwcM4gxfzwQ5HmzbcCmjt3k/Trt7M0bBgYYMBw6MILCKWkUMRbEk25bERtcylbyZOmviVTlbuGaG2RnoEGMHC6ocScNUtk2DCRFSv+BahdO5FJk0T69w8MMlA4dOEFglFyGOItmarcNaS2uZOsrAlT37LoylVjtLYoz1AfyXwRNDj1EGKq+Tv5ZJG6r/Bu0GArmHvvjd8EFm9fr18vsvvuyUKgCy95BmFbEG9YvkNGo7Yh2Q4fi/qG5zxURLS2CM+wPW5oAMFZ41vMzZtFOnQQWb68/omrCdSVwKVLJertYBrA5MRD32iSZxC2hSW8lrBqFhFv2FoKHc2Svmisvj3DjnKBBhBcKb7FXLBApHfv5Ek/8YRIr17J7bJqQQOYzDz6RpM8g7AtLOG1hJUGkKeAw95JsNHQtevbM9AAYvNhh6P7FnPGDJFBg5IBTZ8uMnBgcrusWtAAJjOPvtEkzyBsC0t4LWGlAaQBDHsnwUZD165vz0ADiM2HoAaQK4Dz5Nhjj5VGjXhTzTCtIaHRN1bIpFMOagkrDSDvVSnLJMpu6NqlAYxS9nST8i1m4RlAPf
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0019\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0, 1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (325, 875)\n",
|
||
|
"imageAnalyser.span = (500, 500)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
|
||
|
"#plt.xlabel('')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Scan final horz freq"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 28,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'final_horz_freq': array([104.05 , 104.055, 104.06 , 104.065, 104.07 , 104.075, 104.08 ,\n",
|
||
|
" 104.085, 104.09 , 104.095, 104.1 ]), 'runs': array([0., 1., 2.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNS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DvG25AUC7ACrR57S/bCiSlaFfBQSRfKh8Gg1RkFG9Em4PUX8AAihGXvAEpoPJuADH7pFyAFWjz2l+2FUhK0a6Cg0i+VD4MBqnIKN6INgepv4ABFCOGAZRICAMoUQ+fza+A9pct1E6mADgk00lzLTDQVDf5trU5wAAmZxFlTSkgzABGwVbqoNqNXuqEKuAHwMAGdHCIzwEM4jPgDLQ5SP0FZgCV60QKqLwbQGX5g21eu9GD7UgOBwIDG/DAIT4HMIjPAAbQBoOoWcAARpU/WHB84QaTuthAYBCfQYiDno29tJ0FesEGH20OUn+BGUDlOpECwgygMqCUNq/d6CmlWa43AwY28IJDfA5gEJ9BiB9DUn8BA6hcJ1JAMIDKgFLaPL5wUxJSsBkwEIiX4kfBIUUxy7gpMCijcCl/TJuD1F/AAKYMPHtzUkAwgMqAUtq8dqOnlGa53gwY2MALDvE5gEF8BpgBtMEgahYwgFHlDxYcX7jBpC42EBjEZxDioGdjL21ngV6wwUebg9RfYAZQuU6kgDADqAwopc1rN3pKaZbbzeTye7HLGxT0QnyiYBCfQYgfQ1J/AQOoXCdSQDCAyoBS2jy+cFMSsoybgQEso3AKH0MvKIhayk2CQSkFU1pdm4PUX8AAKoHPbFYKCAZQGVBKm9du9JTSLLebgQG0gxa9EJ8FGMRngBlAGwyiZgEDGFX+YMHxhRtM6iIDwQDG1T9/dPRCfBZgEJ8BDGAZGDz88MM0d+
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0020\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0, 1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (325, 875)\n",
|
||
|
"imageAnalyser.span = (500, 500)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
|
||
|
"#plt.xlabel('')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 29,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
|
||
|
"<defs>\n",
|
||
|
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
|
||
|
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
|
||
|
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"</defs>\n",
|
||
|
"</svg>\n",
|
||
|
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
|
||
|
" *\n",
|
||
|
" */\n",
|
||
|
"\n",
|
||
|
":root {\n",
|
||
|
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
|
||
|
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
|
||
|
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
|
||
|
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
|
||
|
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
|
||
|
" --xr-background-color: var(--jp-layout-color0, white);\n",
|
||
|
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
|
||
|
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"html[theme=dark],\n",
|
||
|
"body[data-theme=dark],\n",
|
||
|
"body.vscode-dark {\n",
|
||
|
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
|
||
|
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
|
||
|
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
|
||
|
" --xr-border-color: #1F1F1F;\n",
|
||
|
" --xr-disabled-color: #515151;\n",
|
||
|
" --xr-background-color: #111111;\n",
|
||
|
" --xr-background-color-row-even: #111111;\n",
|
||
|
" --xr-background-color-row-odd: #313131;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-wrap {\n",
|
||
|
" display: block !important;\n",
|
||
|
" min-width: 300px;\n",
|
||
|
" max-width: 700px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-text-repr-fallback {\n",
|
||
|
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header {\n",
|
||
|
" padding-top: 6px;\n",
|
||
|
" padding-bottom: 6px;\n",
|
||
|
" margin-bottom: 4px;\n",
|
||
|
" border-bottom: solid 1px var(--xr-border-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header > div,\n",
|
||
|
".xr-header > ul {\n",
|
||
|
" display: inline;\n",
|
||
|
" margin-top: 0;\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type,\n",
|
||
|
".xr-array-name {\n",
|
||
|
" margin-left: 2px;\n",
|
||
|
" margin-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-sections {\n",
|
||
|
" padding-left: 0 !important;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input + label {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label {\n",
|
||
|
" cursor: pointer;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label:hover {\n",
|
||
|
" color: var(--xr-font-color0);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
" font-weight: 500;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary > span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding-left: 0.5em;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in + label:before {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" content: 'â–º';\n",
|
||
|
" font-size: 11px;\n",
|
||
|
" width: 15px;\n",
|
||
|
" text-align: center;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label:before {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label:before {\n",
|
||
|
" content: 'â–¼';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label > span {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary,\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" padding-top: 4px;\n",
|
||
|
" padding-bottom: 4px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" grid-column: 2 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-details {\n",
|
||
|
" display: none;\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" margin-bottom: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked ~ .xr-section-details {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 20px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap > label {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" vertical-align: top;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-preview {\n",
|
||
|
" color: var(--xr-font-color3);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-preview,\n",
|
||
|
".xr-array-data {\n",
|
||
|
" padding: 0 5px !important;\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-data,\n",
|
||
|
".xr-array-in:checked ~ .xr-array-preview {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-in:checked ~ .xr-array-data,\n",
|
||
|
".xr-array-preview {\n",
|
||
|
" display: inline-block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list {\n",
|
||
|
" display: inline-block !important;\n",
|
||
|
" list-style: none;\n",
|
||
|
" padding: 0 !important;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:before {\n",
|
||
|
" content: '(';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:after {\n",
|
||
|
" content: ')';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li:not(:last-child):after {\n",
|
||
|
" content: ',';\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-has-index {\n",
|
||
|
" font-weight: bold;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list,\n",
|
||
|
".xr-var-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > div,\n",
|
||
|
".xr-var-item label,\n",
|
||
|
".xr-var-item > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-even);\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > .xr-var-name:hover span {\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list > li:nth-child(odd) > div,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > label,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-odd);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dims {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dtype {\n",
|
||
|
" grid-column: 3;\n",
|
||
|
" text-align: right;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-preview {\n",
|
||
|
" grid-column: 4;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-index-preview {\n",
|
||
|
" grid-column: 2 / 5;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name,\n",
|
||
|
".xr-var-dims,\n",
|
||
|
".xr-var-dtype,\n",
|
||
|
".xr-preview,\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" white-space: nowrap;\n",
|
||
|
" overflow: hidden;\n",
|
||
|
" text-overflow: ellipsis;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name:hover,\n",
|
||
|
".xr-var-dims:hover,\n",
|
||
|
".xr-var-dtype:hover,\n",
|
||
|
".xr-attrs dt:hover {\n",
|
||
|
" overflow: visible;\n",
|
||
|
" width: auto;\n",
|
||
|
" z-index: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" display: none;\n",
|
||
|
" background-color: var(--xr-background-color) !important;\n",
|
||
|
" padding-bottom: 5px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
|
||
|
".xr-var-data-in:checked ~ .xr-var-data,\n",
|
||
|
".xr-index-data-in:checked ~ .xr-index-data {\n",
|
||
|
" display: block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-data > table {\n",
|
||
|
" float: right;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name span,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-name div,\n",
|
||
|
".xr-index-data,\n",
|
||
|
".xr-attrs {\n",
|
||
|
" padding-left: 25px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs,\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dl.xr-attrs {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 125px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt,\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" float: left;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
" width: auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" font-weight: normal;\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt:hover span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" background: var(--xr-background-color);\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
" white-space: pre-wrap;\n",
|
||
|
" word-break: break-all;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-icon-database,\n",
|
||
|
".xr-icon-file-text2,\n",
|
||
|
".xr-no-icon {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" width: 1em;\n",
|
||
|
" height: 1.5em !important;\n",
|
||
|
" stroke-width: 0;\n",
|
||
|
" stroke: currentColor;\n",
|
||
|
" fill: currentColor;\n",
|
||
|
"}\n",
|
||
|
"</style><pre class='xr-text-repr-fallback'><xarray.DataArray 'OD' (final_horz_freq: 1)>\n",
|
||
|
"array([28952.76637914])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * final_horz_freq (final_horz_freq) float64 104.1</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'OD'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>final_horz_freq</span>: 1</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-ed0434fd-e803-4855-844d-70b0c3e842c8' class='xr-array-in' type='checkbox' checked><label for='section-ed0434fd-e803-4855-844d-70b0c3e842c8' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>2.895e+04</span></div><div class='xr-array-data'><pre>array([28952.76637914])</pre></div></div></li><li class='xr-section-item'><input id='section-d2a4729c-d36d-44fa-a8c1-4885a8e7593b' class='xr-section-summary-in' type='checkbox' checked><label for='section-d2a4729c-d36d-44fa-a8c1-4885a8e7593b' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>final_horz_freq</span></div><div class='xr-var-dims'>(final_horz_freq)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>104.1</div><input id='attrs-6f10bdef-1163-4796-8266-ab9332d89ea4' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6f10bdef-1163-4796-8266-ab9332d89ea4' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-343afb05-ab34-4141-92a8-e56c8c309e66' class='xr-var-data-in' type='checkbox'><label for='data-343afb05-ab34-4141-92a8-e56c8c309e66' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([104.06])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-d4d0971f-b5b7-4977-91e5-3ef6807a4b2f' class='xr-section-summary-in' type='checkbox' ><label for='section-d4d0971f-b5b7-4977-91e5-3ef6807a4b2f' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>final_horz_freq</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-81425834-189f-4154-bdb4-8c5e8e7207d1' class='xr-index-data-in' type='checkbox'/><label for='index-81425834-189f-4154-bdb4-8c5e8e7207d1' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([104.06], dtype='float64', name='final_horz_freq'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-813756c4-49be-4230-a482-541103019f9c' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-813756c4-49be-4230-a482-541103019f9c' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<xarray.DataArray 'OD' (final_horz_freq: 1)>\n",
|
||
|
"array([28952.76637914])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * final_horz_freq (final_horz_freq) float64 104.1"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 29,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Scan final vert amp"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 30,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'final_vert_amp': array([0.035, 0.037, 0.039, 0.041, 0.043, 0.045, 0.047, 0.049, 0.051,\n",
|
||
|
" 0.053, 0.055, 0.057, 0.059, 0.061, 0.063]), 'runs': array([0., 1., 2.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3QuQVdWVPvCFBI0PQFQ0IK0YoyZoIubhc0igjBAyRg06Kp2ZqDHiqBPw/UpicHzFIAqjMeqkVNR044RBBYSIo7RiHJ0qNcYaQWOCjwZGoyJqBP1L+Nc+pJt+wXfXt+6mb9/+blWqIuuss8/9rb0vi3PuObfH2rVr15peEpCABCQgAQlIQALdRqCHGsBuU2u9UQlIQAISkIAEJFAIqAHURJCABCQgAQlIQALdTEANYDcruN6uBCQgAQlIQAISUAOoOSABCUhAAhKQgAS6mYAawG5WcL1dCUhAAhKQgAQkoAZQc0ACEpCABCQgAQl0MwE1gN2s4Hq7EpCABCQgAQlIQA2g5oAEJCABCUhAAhLoZgJqALtZwfV2JSABCUhAAhKQgBpAzQEJSEACEpCABCTQzQTUAHazguvtSkACEpCABCQgATWAmgMSkIAEJCABCUigmwmoAexmBdfblYAEJCABCUhAAmoAM8+Bv/71r7Zs2TLr3bu39ejRI/No2r0EJCABCUhAAt1BYO3atfbee+/ZwIEDbbPNNnO/ZTWAbjJfQmNjo9XU1PiStLUEJCABCUhAAhIoQeC1116zQYMGlbBl603UALrJfAkrV660bbfd1lKB+vTp40suYev/9//+n82fP99GjhxpvXr1KiFDm5QqINtSpfzbydZvVmqGbEuV8m8nW79ZqRmyLVVq/XbvvvtucYLpnXfesb59+7p3oAbQTeZLSAVKhUmNYK4GcO7cufbNb35TDaCvNHDr9IEkW8hEbSBbiq2kJNmWxERtJFuKraQk2ZbE1GqjaH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YmXUpO3wlMr/Sdv1133bXdY2DSHcbpDuR0U0m6AzjdSKLHwPgnalfM0Id9+aqWLvsOHmzW2NjxPlMTOGiQ2ZIlpsvBQXbN2yDgRtJlK9t8Av49V10DmL6D99BDDxVn7fr27Wtf+MIXiku/qflLr6YHQafGreWDoPfZZ59mvXTzyHnnnVd8H7Dlg6BTU9n0Sg1d2wdB33DDDe0eBH366ae3exB0uhGk1Fe0QGgcfSAhIT4uW96ubWZDg1kpN84vWGA2fHj5xu2Oe9K8zVd12co2n4B/z9H+oiJvAvEzVG5GtEDonekDCQnxcdnydm0z6+vNamvx/urqzDZwgz1O1haFgOZtvokgW9nmE/DvOdpfqAH0m7syogVCg+kDCQnxcdnydl3lDGC6NL1wYfqesFl6sMCwYV3/ErTmbfnmbds9yVa2+QT8e472F2oA/eaujGiB0GD6QEJCfFy2vF3bzKbvAC5d2v4mkLRtZ3wHMN2UMmFC6+8lpu8hTp3atW9G0bwt37xVA5jPUrZx22h/oQYwXoON7iFaIHR4+rBHQnxctrxdR5lNdwGnWMs7gTvjLuBqviNZ87a887bl3mQr23wC/j1H+ws1gH5zV0a0QGgwfSAhIT4uW95uQ5kdnXVL92ZNmbLpzrpV+x3Jmrfln7dNe5StbPMJ+Pcc7S/UAPrNXRnRAqHB9IGEhPi4bHm7jWWmBmzBgo9t3rzf2ejRQ23EiE9s0ke/VPsdyZq3eeZt2qtsZZtPwL/naH+hBtBv7sqIFggNpg8kJMTHZcvboczOtK32O5I70xbVvavHZZuvgrL120b7CzWAfnNXRrRAaDAtGiTEx2XL26HMzrTVGUBUHcU3JNCZ87baqyJbf4Wj/YUaQL+5KyNaIDSYFg0S4uOy5e1QZmfaVuIdycjLE+9MW89xdsVtZZuvarL120b7Cz
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0021\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
|
||
|
" for i in [0, 1]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_1\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (325, 875)\n",
|
||
|
"imageAnalyser.span = (500, 500)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
|
||
|
"#plt.xlabel('')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"# DB.create_global(shotNum, dataSet)\n",
|
||
|
"# DB.add_data(shotNum, dataSet_cropOD, engine='xarray')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 31,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
|
||
|
"<defs>\n",
|
||
|
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
|
||
|
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
|
||
|
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
|
||
|
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
|
||
|
"</symbol>\n",
|
||
|
"</defs>\n",
|
||
|
"</svg>\n",
|
||
|
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
|
||
|
" *\n",
|
||
|
" */\n",
|
||
|
"\n",
|
||
|
":root {\n",
|
||
|
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
|
||
|
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
|
||
|
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
|
||
|
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
|
||
|
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
|
||
|
" --xr-background-color: var(--jp-layout-color0, white);\n",
|
||
|
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
|
||
|
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"html[theme=dark],\n",
|
||
|
"body[data-theme=dark],\n",
|
||
|
"body.vscode-dark {\n",
|
||
|
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
|
||
|
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
|
||
|
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
|
||
|
" --xr-border-color: #1F1F1F;\n",
|
||
|
" --xr-disabled-color: #515151;\n",
|
||
|
" --xr-background-color: #111111;\n",
|
||
|
" --xr-background-color-row-even: #111111;\n",
|
||
|
" --xr-background-color-row-odd: #313131;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-wrap {\n",
|
||
|
" display: block !important;\n",
|
||
|
" min-width: 300px;\n",
|
||
|
" max-width: 700px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-text-repr-fallback {\n",
|
||
|
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header {\n",
|
||
|
" padding-top: 6px;\n",
|
||
|
" padding-bottom: 6px;\n",
|
||
|
" margin-bottom: 4px;\n",
|
||
|
" border-bottom: solid 1px var(--xr-border-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-header > div,\n",
|
||
|
".xr-header > ul {\n",
|
||
|
" display: inline;\n",
|
||
|
" margin-top: 0;\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type,\n",
|
||
|
".xr-array-name {\n",
|
||
|
" margin-left: 2px;\n",
|
||
|
" margin-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-obj-type {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-sections {\n",
|
||
|
" padding-left: 0 !important;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input + label {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label {\n",
|
||
|
" cursor: pointer;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-item input:enabled + label:hover {\n",
|
||
|
" color: var(--xr-font-color0);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
" font-weight: 500;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary > span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding-left: 0.5em;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label {\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in + label:before {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" content: 'â–º';\n",
|
||
|
" font-size: 11px;\n",
|
||
|
" width: 15px;\n",
|
||
|
" text-align: center;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:disabled + label:before {\n",
|
||
|
" color: var(--xr-disabled-color);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label:before {\n",
|
||
|
" content: 'â–¼';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked + label > span {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary,\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" padding-top: 4px;\n",
|
||
|
" padding-bottom: 4px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-inline-details {\n",
|
||
|
" grid-column: 2 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-details {\n",
|
||
|
" display: none;\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" margin-bottom: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-section-summary-in:checked ~ .xr-section-details {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 20px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-wrap > label {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
" vertical-align: top;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-preview {\n",
|
||
|
" color: var(--xr-font-color3);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-preview,\n",
|
||
|
".xr-array-data {\n",
|
||
|
" padding: 0 5px !important;\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-data,\n",
|
||
|
".xr-array-in:checked ~ .xr-array-preview {\n",
|
||
|
" display: none;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-array-in:checked ~ .xr-array-data,\n",
|
||
|
".xr-array-preview {\n",
|
||
|
" display: inline-block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list {\n",
|
||
|
" display: inline-block !important;\n",
|
||
|
" list-style: none;\n",
|
||
|
" padding: 0 !important;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:before {\n",
|
||
|
" content: '(';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list:after {\n",
|
||
|
" content: ')';\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-dim-list li:not(:last-child):after {\n",
|
||
|
" content: ',';\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-has-index {\n",
|
||
|
" font-weight: bold;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list,\n",
|
||
|
".xr-var-item {\n",
|
||
|
" display: contents;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > div,\n",
|
||
|
".xr-var-item label,\n",
|
||
|
".xr-var-item > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-even);\n",
|
||
|
" margin-bottom: 0;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-item > .xr-var-name:hover span {\n",
|
||
|
" padding-right: 5px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-list > li:nth-child(odd) > div,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > label,\n",
|
||
|
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
|
||
|
" background-color: var(--xr-background-color-row-odd);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name {\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dims {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-dtype {\n",
|
||
|
" grid-column: 3;\n",
|
||
|
" text-align: right;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-preview {\n",
|
||
|
" grid-column: 4;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-index-preview {\n",
|
||
|
" grid-column: 2 / 5;\n",
|
||
|
" color: var(--xr-font-color2);\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name,\n",
|
||
|
".xr-var-dims,\n",
|
||
|
".xr-var-dtype,\n",
|
||
|
".xr-preview,\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" white-space: nowrap;\n",
|
||
|
" overflow: hidden;\n",
|
||
|
" text-overflow: ellipsis;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name:hover,\n",
|
||
|
".xr-var-dims:hover,\n",
|
||
|
".xr-var-dtype:hover,\n",
|
||
|
".xr-attrs dt:hover {\n",
|
||
|
" overflow: visible;\n",
|
||
|
" width: auto;\n",
|
||
|
" z-index: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" display: none;\n",
|
||
|
" background-color: var(--xr-background-color) !important;\n",
|
||
|
" padding-bottom: 5px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
|
||
|
".xr-var-data-in:checked ~ .xr-var-data,\n",
|
||
|
".xr-index-data-in:checked ~ .xr-index-data {\n",
|
||
|
" display: block;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-data > table {\n",
|
||
|
" float: right;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-var-name span,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-name div,\n",
|
||
|
".xr-index-data,\n",
|
||
|
".xr-attrs {\n",
|
||
|
" padding-left: 25px !important;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs,\n",
|
||
|
".xr-var-attrs,\n",
|
||
|
".xr-var-data,\n",
|
||
|
".xr-index-data {\n",
|
||
|
" grid-column: 1 / -1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dl.xr-attrs {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" display: grid;\n",
|
||
|
" grid-template-columns: 125px auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt,\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" padding: 0;\n",
|
||
|
" margin: 0;\n",
|
||
|
" float: left;\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
" width: auto;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt {\n",
|
||
|
" font-weight: normal;\n",
|
||
|
" grid-column: 1;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dt:hover span {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" background: var(--xr-background-color);\n",
|
||
|
" padding-right: 10px;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-attrs dd {\n",
|
||
|
" grid-column: 2;\n",
|
||
|
" white-space: pre-wrap;\n",
|
||
|
" word-break: break-all;\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
".xr-icon-database,\n",
|
||
|
".xr-icon-file-text2,\n",
|
||
|
".xr-no-icon {\n",
|
||
|
" display: inline-block;\n",
|
||
|
" vertical-align: middle;\n",
|
||
|
" width: 1em;\n",
|
||
|
" height: 1.5em !important;\n",
|
||
|
" stroke-width: 0;\n",
|
||
|
" stroke: currentColor;\n",
|
||
|
" fill: currentColor;\n",
|
||
|
"}\n",
|
||
|
"</style><pre class='xr-text-repr-fallback'><xarray.DataArray 'OD' (final_vert_amp: 1)>\n",
|
||
|
"array([29676.45060443])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * final_vert_amp (final_vert_amp) float64 0.045</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'OD'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>final_vert_amp</span>: 1</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-afcf31cf-2ab4-4ec0-bbe4-f6342cf64b8b' class='xr-array-in' type='checkbox' checked><label for='section-afcf31cf-2ab4-4ec0-bbe4-f6342cf64b8b' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>2.968e+04</span></div><div class='xr-array-data'><pre>array([29676.45060443])</pre></div></div></li><li class='xr-section-item'><input id='section-3064ec8b-148e-48c2-a58b-98b70a9fbf8e' class='xr-section-summary-in' type='checkbox' checked><label for='section-3064ec8b-148e-48c2-a58b-98b70a9fbf8e' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>final_vert_amp</span></div><div class='xr-var-dims'>(final_vert_amp)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.045</div><input id='attrs-6fa74f1c-255e-4f85-9eda-30c219bff7d4' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6fa74f1c-255e-4f85-9eda-30c219bff7d4' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a737f7e3-553a-4474-9fc0-5c8fa128a3ec' class='xr-var-data-in' type='checkbox'><label for='data-a737f7e3-553a-4474-9fc0-5c8fa128a3ec' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0.045])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-4343ca55-551c-45a4-a744-a92bbc669a71' class='xr-section-summary-in' type='checkbox' ><label for='section-4343ca55-551c-45a4-a744-a92bbc669a71' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>final_vert_amp</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-e63c7b75-53c2-4eec-8e4c-e6725f45889a' class='xr-index-data-in' type='checkbox'/><label for='index-e63c7b75-53c2-4eec-8e4c-e6725f45889a' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([0.045], dtype='float64', name='final_vert_amp'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e98f96d0-b3a2-4063-9b37-a341ae427357' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-e98f96d0-b3a2-4063-9b37-a341ae427357' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<xarray.DataArray 'OD' (final_vert_amp: 1)>\n",
|
||
|
"array([29676.45060443])\n",
|
||
|
"Coordinates:\n",
|
||
|
" * final_vert_amp (final_vert_amp) float64 0.045"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 31,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"Ncount_mean.where(Ncount_mean==Ncount_mean.max(), drop=True)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Evaporative Cooling"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 32,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"img_dir = 'C:/Users/control/DyLab/Experiments/DyBEC/'\n",
|
||
|
"# img_dir = '//DyLabNAS/Data/'\n",
|
||
|
"SequenceName = \"Evaporative_Cooling\"\n",
|
||
|
"folderPath = img_dir + SequenceName + \"/\" + get_date()\n",
|
||
|
"\n",
|
||
|
"mongoDB = mongoClient[SequenceName]\n",
|
||
|
"\n",
|
||
|
"DB = MongoDB(mongoClient, mongoDB, date=get_date())"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Measure trap frequency at various points of evap 2"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Horz TF due to arm 1: blink on modulation = 0, blink_off_modulation = 0.35 in 700 µs, hold of 1 s"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.5"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 56,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005, 0.006, 0.007, 0.008, 0.009, 0.01 , 0.011, 0.012, 0.013,\n",
|
||
|
" 0.014, 0.015, 0.016, 0.017, 0.018, 0.019]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/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gAOGTJE3n33XZk9e7a0adNGFixYIDNmzJCNGzdK27Zt5f3335fLLrtMRo0aJUOHDpVmzZqJCkIViGeddZbD5bbbbpMVK1bI3Llz5YwzzpA777xT9uzZIxs2bJD69eu7Nv3795eysjJ5/PHH3b9Hjx4tHTt2dHa5XqHg59pPXNqRsAg8PlyENwhAK2/gDLHGyhltnzTehGqQWAlArdY1adJEli1bJtddd13l+Hft2lUGDhwoU6ZMkVtvvVUaNGgg8+fPz8iP/fv3y5lnnun+rmJSr507d0r79u1l5cqVcu211zrB2KVLF3nzzTelZ8+ero3+3KtXL9m8ebN07tw5J+6Fgp9TJzFqlDTnskAPNiQsC1+SmKws+OBP+JOFL6m2SeNNqAaJlQDU6d+mTZvK6tWr3bRt6lJh1qhRI3nllVdcxe9HP/qRvP766/LOO+/IueeeKxMmTJAbb7zRNdc2aqsVv9NPP73yHhdffLFrM3nyZHnyySdl7Nixsm/fvmoc0+lfrTaOGDEiJ+6Fgp9TJzFqlDTnskAPNiQsC18QgLWjhT/hT1Z/SqJPhWqQWAlAHcDevXtLw4YNZeHChdKqVSu3jm/48OFywQUXuDV/rVu3lsaNG7tqYN++feUXv/iF3HPPPbJmzRq56qqrnJ0KOF0HWPW65pprnFicM2eOTJs2zU0Pb926tVqbTp06OVsVlJkuvWfV+yr4Wln8+OOPnXAt9UuD8qpVq6Rfv36uCst1AgGwqT1hwZuT8YEzcMYnhsIbeJNCQDVIy5YtRWc+fTRI7ASgrvEbOXKkrFu3zq3X69
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0004\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 57,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 58,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sfQcYFcX1/aEpogIq2EFiiUGNxt6ikaAgqD9RTKSoSDSisSCKJeavYkGNWLBj7wbUBA2KUSyAYktQULHEghoFRYpEgijt/523LDwe772d3ZnZ2Z298318Im9md+6ZO3PP3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//ffo2LEjbr75Zmy66aZ1cWAdvpvv3XbbbTF06FDss88+qtjBZwUq8sInBFAIoO/GT2WRK/IaEOJTdAx8lt9n+60yv1nHOQF86qmnMGHCBOy0007o3r17VQL49ddf4+67714u02qrrYZ11113+f+fdNJJGDVqFO655x6st956OPPMMzF79uwSqWzUqFFVLEaMGIGjjz66RBT33ntv3Hrrrbjjjjvw7rvvom3btkr4+axAPk/8qMEVAigEUAigeABFB/zWAZ/td5SNC393TgDLO9qgQYOqBPDbb7/FY489VlWmuXPnonXr1rj//vtx5JFHlupMmzYNbdq0wejRo9G5c+eq7ehFJOm85ZZblv/evn37kvfx8ssvV8LPZwUSAhiowJw5C9GyZRMlffCtUpF1QIy/38Zfda7KHJAwMKq6ksd6uSCAJH/0+rVs2RK/+tWvMHjwYKy//volvJ9//vnSli89fuuss87yMdhhhx1KZO6iiy5aZVx+/PFHNGvWDI888ggOO+yw5b/3798fkyZNwrhx45TGUgigEky5qyQeQPEACgEUAig64LcO+Gy/VY1u5gkgt2rXWmstbLbZZpg6dSrOP/
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 61,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0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2LCrVr88GtW7wYn6JGdc+B0qgIAUKAECAETIvA69evUbduXesQwNCaYBc2GBlcvHgxqlWrFiYBZNGqlClTYurUqWESwP379yNv3rzB/84ii2wr+fz58w4NgCKAFAGkCKDFo8EU+Qr2jRT1ERP1MS0bsROMbEGMLVguAujI+FOnTo1mzZqhR48eQreAQ8tCZwBdwTVpICOdAQyx6LOzteXKlbPmcYCvBNDqGDCDYIu+1XEgDIJcA+EgBgO1nMPltoBDL9+PHz/m27fTp09HgwYNeCiUXQL566+/8NNPP/HiLErIUsA4uwTyww8/8FvAti9DhgyoXLkyXQIJBbrlJzcRQCKAoaIdVic+tOgT8bFfJiy/RggiwW5HAF++fIlLly5xW8qePTtGjx6NokWL8jQv7D927o6lh0mUKBGuXbuG3r1748aNGzh37hxixozJ67E0MOvWreNpYFgdlhOQEUX7NDDsogi78NG2bVtex5YGhm0Rs21gRihnzJiBM2fO8C1mKZ9aZUjpwwxlLD+5iQASASQC+J0rsrxfELTom2ENcCYD2QJFAJ3ZiMN/37lzJyd8ob+GDRvyFC3sJu+xY8fAUsEwEsjK/vrrr/z2re17+/YtunXrxs8D2ieCti8TEBAAllSaEUrbx6J/I0aM4BHDTJkyYcyYMShUqJDkcRABlAyVaxckAkgEkAggEUAHXoyID0VCbW
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 303.5930 ± 6.9704 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"#yvals = val_mean.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"#yvals_std = std_mean.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"#xvals = dataSet_cropOD[scanAxis[0]].sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = val_mean.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = std_mean.to_numpy()\n",
|
||
|
"scan_para = dataSet_cropOD[scanAxis[0]].to_numpy()\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 1, 148, 1e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.55"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 62,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005, 0.006, 0.007, 0.008, 0.009, 0.01 , 0.011, 0.012, 0.013,\n",
|
||
|
" 0.014, 0.015, 0.016, 0.017, 0.018, 0.019]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sfQvYVVd55gcEjCTCzyUiCAGKgIV2iGPl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nDixCjE9ALJlyxazN09P9DZu3NiIvc985jNVZf7sz/7MHOj4zne+E9sSMDOAzADmM2NmuQo7N2LDTI5P6Cu3TI4LRsSGNpVBoNZlAPXErgq+7CtdlixZIhs2bDDLtZl9d3qYQ0/xZp4vfvGL8uqrr5q9g5lDICoahw0bZoqcP3/eXAGTewjk8OHD0r17d1NG/9yzZ08eAilgX9yzlB8Y7gGsWQA++OCdzy9deofL41lQ0Z5qDuTqq/VgH7ebVMeJvCFvsgWgJsRqzRKw3vm3f/9+s09Pl4CPHTtmrmcZO3as2ReoT+/evc2+u+eee84sAX/ve98zglGXiTPCUf+/Z88es8+vadOm5k5AvTMw9xoYPR2sfemj/Wh7vAYmv4HR8VAAumQqtCzFMYOVK2e0PH0NeUPe2BEIPYgKtwfw6tWr5noXXeK9ePGiOeWrp3/nzZsnDRo0MIjoBdG650+zfXrSV0Wbire/+Iu/kDp16pgyN27cMHsJdX9e9kXQusScebRu7kXQKip5ETQFoN307pagyGEG0IUvmbIUORQ55I0PAuRNrc0AFpcO8bYWqr7jHV3xW2fAYgbQlVUUxwxWrpxhBrBmxOiHaVMUgD5epch1KACLDGiJNkeRwwygD3UZyBnIyR
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0005\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = Ncount_std, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 63,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 64,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQnYVtPavhs+kujTgFREMo+ZHVOmBg4RohyKCEeFojgnhUMRSqZknirDUUQZDg1kLso8NCjKlIr+lKb/ut9l+97e3vfba++1x7WfdV0u5/jW2ns993r2Wvf7rGeosnbt2rWQJggIAoKAICAICAKCgCCQGQSqCAHMzFqLoIKAICAICAKCgCAgCOQQEAIoiiAICAKCgCAgCAgCgkDGEBACmLEFF3EFAUFAEBAEBAFBQBAQAig6IAgIAoKAICAICAKCQMYQEAKYsQUXcQUBQUAQEAQEAUFAEBACKDogC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ADRZDCKABeAkfGsfhR/J3yinA2rXrglOlivr/Tz8dLQmMA4MkqYXIn20CLARQCGCS9qMw5iIE0ABVIYAG4CV8aNSH/+rVQJMmwLffFgeGJJCWwNmzo7sOjhqDpKmEyC8EUHTAXh2w+fzW3UuFAOoiJVfABkilb2jUG//EiUCLFu44TZgAHHGEe78gekSNQRBzDvIZIr+9h7+unogO2KsDQgABIYC6O4EQQAOk0jc06o1/5EigQwd3nEaMAM44w71fED2ixiCIOQf5DJHf3sNfV09EB+zVASGAQgB194Gi/WxWINn4ot34xAJo9CmGMli+gWi/gVAW0fChogP26oDN57eu2osFUBcpsQAaIJW+oVFv/I4PIKN/C4NAiJ74AEavQ1HrQPQSVv7GrMtPdLKOgc3yCwEUC6
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 67,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQV4FccaPRCCRZDikOBuBYq7FytaJLhLcXcrVlyLFicBHu5SIFihUFxCcQ2eECxYyPtm0wtJuMnd3dndO5v7z/v6PVpG/jlz5t9zR/6JFRoaGgpKhAAhQAgQAoQAIUAIEAIOg0AsEoAOM9bUUU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7LhWsA1rKq3Cl55vbSoMto6yMEI7mBCQoAMGYD7960bykQgWwm8dcsu28HEH8H5o7sH4WuA+EP84WGQI/KHV6fQCqCgK4DXnl9DttnZpODOz/s/h1s8N9lz49X7V5h1YhaO3D0irRxaCxtjrTJHnECyQRXhjKSvL1C+vG2TDxwAypWznU/jHMQf+oDzUIr4Q/wh/ihDgASgMrxk5+YFVnZDUWSccXwGeu7uiYoZK+LPFn8qqu79p/dIPik5Xn14hWNtj6FYumKyypMDFtwB+/gAXjJWgr29gSZNZI25lpmIP4LzR8vB1qEu4g/xh4dWjsgfXp1CK4CCrgBWWVEFe2/uxZQqU9C7eG/F86LxusZYc2kNhpcZjlHlR8kq74gTSBYw/2WyOz60AqhkuITLa3f+CIdIRIMIHxKAPBR1RP6QAORhTDRleYHlMev1h9f4buJ3+BDyAX6/+CFHshyKq1tyZgnabGkjrf6xVUA5yREnkBxcLHnsjo/lDCC7/Rv5Eggzks4AKhlOw/PanT+G91hZg4QPCUBljKEfELw6hVYABVwBfPHuBX4/+TvOPDqDtQ3Wygr/Erkb91/eh8c0D+n837
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 286.0152 ± 2.5433 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 145, 1e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005,19e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.6"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 69,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005 , 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099,\n",
|
||
|
" 0.0106, 0.0113, 0.012 , 0.0127, 0.0134, 0.0141, 0.0148, 0.0155,\n",
|
||
|
" 0.0162, 0.0169, 0.0176, 0.0183, 0.019 , 0.0197]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sfQuUFcW19h55RRIeIqgQRh4KGLzGZ3gkUYelQMBcUERxJsZIiCSSBAhIBKIRfCDmBQT0Ct6LE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ODBxOJz6dKl1hOIpmOsjchCQ5AZyEyKzLIQrlk9BXIDAhACMH3KIT/c80NTZ3gnACuH0vDhw2nZsmW0detWysvLMwLw0KFDtHjx4rRRx0Lxmmuuocn84FmKY+PGjdSxY0dTNeTqIR/8565du9KmTZuoQ4cOVpOIpmOsDMhSIyQxBCAEYOpkQ264T3BZorGsngZxAc6U4kxNneG1ADxx4gS1aNGCRowYQWPHjjV4sgBk8cdVP16uvfnmm+mpp56iiy66qBxvFoDvvPMOlZWV0cUXX0xc7XvssceoQYMGps3MmTPNmCwkKx483qRJk2jgwIFWZKHpGCsDstQIZAYykyKzLIVs1k6D3IAATBVsiAtwphRnauoMrwXgggULqKioiHbs2GGEIB8vv/wyfepTn6JWrVrRtm3b6NFHH6WTJ0/S+vXrqV69eqbNCy+8QG3atKFLLrmEeAl5zJgxdPnll9PKlSvN7xMmTKBZs2bRli1bknzEy8Ys/rh9quP48ePE/yUOdkx+fj7t27ePGjZsmLVJJ9snYjJj7Hgpvk6dOtk+vTfnAw7Jkz1igggxgZhIJwCRH8iPirERlitYZzRt2pQOHz4srjO8FoA9e/Y0lb7qnsvbs2ePEYO8waNfv34pxQ
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0008\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 70,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 71,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQf4FTX2PT+aqKCoqKuIYMFekV3EAqIiig3FtYAKKmJvWMCCjRU7oK4NV8GyCJYFFXGRP1WxUO0FURAVG4Koiyjt/50XRx6PVzJJZibz3s33+e3qL5PJObmZnJfk3lu1cuXKlZAiDAgDwoAwIAwIA8KAMFAxDFSJAKyYsRagwoAwIAwIA8KAMCAMZBgQASiGIAwIA8KAMCAMCAPCQIUxIAKwwgZc4AoDwoAwIAwIA8KAMCACUGxAGBAGhAFhQBgQBoSBCmNABGCFDbjAFQaEAWFAGBAGhAFhQASg2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4wtyL9tueWWq4WLqTQDCvPRFAHoZnGOqxURgCIAZbc3rtmWzHvCfL+T6WE0bzXBLQIwpQIwcNzINaXOnTvj/vvvzwSFnjFjBhgKhiKQ4rB3794Zj92gFHLoYOxABpLWKeVoQGEmkghAHSvxp44IQBGAIgD9mY9R9CTM9zuK9yfVpgnucly/w/Kf+iPgsIBd1i9HAwozkUQAurSm6NsSASgCUARg9PMsyTeE+X4n2U/X7zbBXY7rd1heRQCGZSyrfjkaUJiJJALQwngSeFQEoAhAEYAJTLwYXxnm+x1jtyJ/lQnucly/wxItAjAsYyIA/2Tgp5+A9ddX/zpyJHDIIUD16haEJvioyQckwe4avVoEoAhAEYBGUyc1D1XCdyzfYJjgFgGY0juAvszGcjQg3Yn0n/8AF14IfPXVqtHYYgvgrruAnFCLvgxX0X7o4k4FmAKdFAEoAlAEYJ
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 73,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQV4FccW/kMIEAgQIHiCFtdQpFhxh+LuRYIUlyDFWpwiKRQv7hI8FHhI0aChuBM8SNAEgiXvm00u3Fxucnd3Zufu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RWAgCGJMj8/ANWp6iOwKol1mBFli92GGpx7ar21B/TX00zt8Y65uul36W46hPQp8gwx8ZEIEI3OtyBe6Z80aKFnkA9drVyvUSBFAQQBleI2e+kCEmThQRWAgCKAhgnBjK0Y2IqwTQa5sX5p+Zj19K/IKZtWfKJoCkYNlFZXH03lHMrzQdXSr0EwQwrvm9IICCAMrwaUF6voIksBAEUBBAGZOG0YrEVQKYa2Yu3Hh+A9tbbked3HUUEcDxh8Zj+L7haJGtHlZ32CYIoNGc2pa+ggAKAmjLR2SuGMgQEyeKCAIoCKAggHFiKMf9COD91/fhMd0DCRwS4IX3C6RIHJngWu4k5n/fH6X/Lo0sDq64M+plJGB+fkD16oCjY5zwArlYxAljLY0QBFAQQBmOHa/HiAU+AgtBAAUBlDFpGK1IXIwArjy3Em02tUGJTCVwosuJL10idxL7+PkjenTOiAlbQuH2Iuxrl7q7Az4+gEUibqP1uRIybETbbOosCKAggDadRP4HowxRhi8id+40vKEyDRB4fAWKBxa0PEUcAonBsWmBlTleuBbrsrULFgYsxKAygzC52mTFBBC+voho0gQOERHR9XZwiPzvDRsMTwJ5DF
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 272.6675 ± 0.6739 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 145, 1e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.65"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 74,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005 , 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099,\n",
|
||
|
" 0.0106, 0.0113, 0.012 , 0.0127, 0.0134, 0.0141, 0.0148, 0.0155,\n",
|
||
|
" 0.0162, 0.0169, 0.0176, 0.0183, 0.019 , 0.0197]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sfQuUFdWV9kZsQAwPAVGEFgivBMcogrzig14KhDZBJALSGCIhkIFkeEoAR39BEf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nSpSnbcAXw5ptvppkzZyZtw4Kxbdu2tH37durUqZNpw3/u0qUL7d27l9q0aeOZa5qO8Tx5GhsgiSEAIQAhAL0oBzxhP9l7YRy13xET9jGhqTOcE4Asynr27Gkqc7yE27hxYxo5ciQNGzbMIMnLvVzF+/73v09vvvkmvfXWW9S8eXOaPHky9enTpxRtFoDvvPMOlZSU0DXXXENc7Xv88cepVq1aps2iRYto3LhxdOrUqbic4uXfGTNm0JAhQyrk2vnz54n/ix3smNzcXDp27BjVrl07arnp215O4vXr11P37t2N8M7WAzjEkxligggxgZhIxoeIi7KbZvCEHRasMxo0aECnT58W1xnOCcAaNWoYtFic9evXj3bu3EljxoyhefPm0eDBg+mvf/0rNWrUiGrWrEnTpk0zS8W/+c1v6JFHHqENGzbQnXfeafo///zzRhhee+219PbbbxuB2LJlSyNk+Jg+fTotXryY9u/fH5e/vGzM4o/bJx5TpkyhqVOnVvj3wsJCYw8OIAAEgAAQAAJAAAhIIXDmzBkqKCjIDgFYrVo16tChA23durUUP96osWvXLtq2bRsdOXLEVAX52T8WXrGDN3BceeWVtGzZsqS4796924zL/7/llluMAF
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0009\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 75,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 76,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQnYVVPbvhveZEilDKkU8SGUITITFcqQmTKLzDOZUpmJTBHhF/oiwxdJkSmRTCEiU0ooShShvA3/dZ9la3c67zlrrz2cvfZ61nW5fJ93rb33fT/PWus+a3ieasuWLVsGKcKAMCAMCAPCgDAgDAgDzjBQTQSgM7YWoMKAMCAMCAPCgDAgDOQYEAEojiAMCAPCgDAgDAgDwoBjDIgAdMzgAlcYEAaEAWFAGBAGhAERgOIDwoAwIAwIA8KAMCAMOMaACEDHDC5whQFhQBgQBoQBYUAYEAEoPiAMCAPCgDAgDAgDwoBjDIgAdMzgAlcYE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lAjAoY776WXSgIAOICMAQzpOCpkFsnYLPjeQTXMRsOkFGQngZH+KirV3EbOrfWZy/g3Y3EYBBGRMB+C8DIgBDOE8Kmro4WbiI2XSCTIGLhvoEF23tImZT/xYBmIFbwKFGiJCNs+hAQQYQEYAhHajMzYPYusyfGtnrXcRsOkFGRnqZHuSirV3EbOrfWZy/g3Y1WQEMypisAMoKYAifSVNTFycLFzGbTpBp8lWTb3HR1i5iNvVvEYCyAmgyrvzbJosOFGQAkRXAUO5T9sZBbF32j43oA1zEbDpBRkR52R7joq1dxGzq31mcv4N2NlkBDMqYrADKCmAIn0lTUxcnCxcxm06QafJVk29x0dYuYjb1bxGAsgJoMq7ICuA/DMgKYCj3KXtjFycLFzGbTpBld9
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 79,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQV0FMkWvSEkSEIgQJAIBHf92AK7wd2d4IsssjiLLrawuLu7E5xFFwjusLi7BkIgkAQN+acaBiZhJtM9VV3Tnak+Z8/fv6l69erWfdV3qqteOURFRUVBPAIBgYBAQCAgEBAICAQEAnaDgIMQgHYz1qKjA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2y+thkTK05Et2LdZPn47+1/UX5pebgndMfTXk818ylYMRayeqvPQgILvpO5XlgieCF4IVYALUcrjzih1SliBVCsAFKvAH5OnAgH7h1ALo9c8HDxsBwZgHQ9nM9EHzwJe4KNDTeiZvaasuqpXYhH0KrdB1b2BRbiRS9WAMUKoJL5RMwZfOcMIQCVsFNBWVpgFTRl86KKg1bmTSCWOtZrVy+MPzoeDXI1wOp6qy0V5/J3xVhw8co2jTDFghFnbIMElP9IspWjHNplygsO/qrZhMAiOroCDyEA1Yw3braFAIwFaqOXedSbN3BwdbVqXE48OoGi84oiiXMSBPcO1sRnYDGBqTSBCQFoVYxosZKIEZViRIuDrdAnwQ2+3KDVKeITsBmC0wKrMG5sWlxx0Bq9zDP9nRoV89XBtCrTfrj+zVKnSM5Acnr4adhT7G62W0ogbetHMRa2dljF9pliIQSgiiPF1zRTXvB1nXlrAguxAmiOVDy4QatThAAUAlD55y2jl7lLf6Bg5pI42OqgVZPrkMAhCPsQhr
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 253.6669 ± 0.5183 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 145, 1e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.7"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 83,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005 , 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099,\n",
|
||
|
" 0.0106, 0.0113, 0.012 , 0.0127, 0.0134, 0.0141, 0.0148, 0.0155,\n",
|
||
|
" 0.0162, 0.0169, 0.0176, 0.0183, 0.019 , 0.0197]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7tnQm4VlX1/xci4sTgLMpFHCn9mUPOiXKfQoNyQlOhfpZZ/LJBzFlzxiGzEn6apvZTSQU0wgHDAQsQNc1M+zuAlFF6ATUnci70/p918L3cezkv57xnrf2ec+77Oc/jI3D23med71rru79n7bPP2621tbVVOEAABEAABEAABEAABBoGgW4IwIbxNTcKAiAAAiAAAiAAAhECCEACAQRAAARAAARAAAQaDAEEYIM5nNsFARAAARAAARAAAQQgMQACIAACIAACIAACDYYAArDBHM7tggAIgAAIgAAIgAACkBgAARAAARAAARAAgQZDAAHYYA7ndkEABEAABEAABEAAAUgMgAAIgAAIgAAIgECDIYAAbDCHc7sgAAIgAAIgAAIggAAkBkAABEAABEAABECgwRBAADaYw7ldEAABEAABEAABEEAAEgMgAAIgAAIgAAIg0GAIIAAbzOHcLgiAAAiAAAiAAAggAA0x8NFHH8miRYukV69e0q1bN8NIdAUBEAABEAABEACBjgi0trbKW2+9JZtssomsssoqrvAgAA1wtrS0SFNTk2EEuoIACIAACIAACIDAyhF48cUXpX///q4wIQANcC5ZskT69u0r6pjevXsbRip21//85z9y3333yX777Sc9evQotrEBrQOH5eCCxTIswIGYiKMc4oL86BwXWWPiX//6V1RoevPNN6VPnz6uMxwC0ACnOkYdokKwqwvA6dOny/DhwxteAILDcmIHi2UCEByIibjJnrggP9rHRVauCKkzEIAIwEQEsgZu4sAlawAOHas9THBMcB4TXMloIJW5cAUPBV4PBQjAVClX/0YhHVP/u6l+RcgMMvMisyLFtYct5AYPBdWWgHlA4gHJ4wEppM6gAmiYBUI6xmCWe1cmOQQgAjA+rcgNBCACkOJBmkk3K1eE1BkIwDSeq9ImpGMMZrl3zRq47obkPCA4MNkjhJns09AQXMFDsxdXhNQZCMA02YwA5EX3j3d8sqwDsXss6xhop7BdET08IHmJnsIGucGwrPmBADSAHrJrSMeEtLvWsbMGbq3XKXp7cGCCY4KjApiGp+AKHhS9uCKkzqACmCabqQBSAaQC2CELmOCY4LwmOAMFF7Yr+UF+eOUHArCgaR7SMUW6ZcgMMvMisyLFtYct5AZV4bg4Ii7gTC/ODKkzqAAaZoGQjjGY5d4VMoPMvMjMPThzHpDcQAAiAHktIA0NZeWKkDoDAZjGcywBswTMEjBLwDE8kJXUDbRT2K5ggRjmQdFfDCMAC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UDDXBDSMQaz3LtCZpCZF5m5B2fOA5IbCEAEYPUkJD/s+RFSZyAADRNISMcYzHLvShIjABGA8WlFbtgnOHfCKsCAxAWc6cWZIXUGAtBAFiEdYzDLvStkBpl5kZl7cOY8ILmBAKQCSAUwDQ1l5YqQOgMBmMZzVdqEdIzBLPeuWQPX3ZCcB2xUHOI2I3z00X9k+vTpMnz4cOnRo0fOnsnv8o0aE4ielcccccFDs9dDc0idgQA0zB0hHWMwy70rZNa4ZBb3OZL+/UV+8pOl0rPnbxCA/0EIVwgHnqAa6iV63CexAgyYNT9C6gwEoCEwQjrGYJZ716yB625IzgM2Gg6VDxJ3/kWKZR8kbpVTTnlMxo7diQogldAoMxstP1ZGR2DRuA/N1eIia0yE1BkIQIOoCOkYg1nuXbMGrrshOQ/YSDhUfpKspSUe9G7dWmW99d6TF1/sIauvzhJwoy+FIwA75kkjcQVCON3ElDUmQuoMBGA638W2CukYg1nuXbMGrrshOQ/YSDjMmiXS3JwM+IwZS+Vzn1s1uWEXbdFIMZHkQrBYjhBYUAHsnC
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0010\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 84,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 85,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQn4VdP6fn9NEg1SaFKGTBm73MwJKcUVISUKmcmYDLe/zBGZ42bKcBtMRSkKJTJnqMilSVGGSiUpTf/nPcup0+mcs/dae1p77289j+defmutvd73+9Za31nrW99Xtm7dunWQIgwIA8KAMCAMCAPCgDCQGgbKxABMjawFqDAgDAgDwoAwIAwIAxkGxAAURRAGhAFhQBgQBoQBYSBlDIgBmDKBC1xhQBgQBoQBYUAYEAbEABQdEAaEAWFAGBAGhAFhIGUMiAGYMoELXGFAGBAGhAFhQBgQBsQAFB0QBoQBYUAYEAaEAWEgZQyIAZgygQtcYUAYEAaEAWFAGBAGxAAUHRAGhAFhQBgQBoQBYS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fssJYOmZmkgDcOjQodhyyy3RsGFDzJo1C7169cLq1aszPoObbbbZJowsXLgwc518xhln4NZbby3K2MqVK8F/soUGYIMGDbBgwQJUq1YtDmui4xi5aI4dOxYtW7ZExYrhLiDDhpXhtNPK/20A/v30NzNiPgsuQ5Uq6zBixBocdljeM2FHVM4VosTtPLpgagjmcPU7GCm661VknQ5Zp1HO2RNu3X2L+zf9/5csWZKY/dvdarChViINwHwS+FCExuCQIUNwUl4wOSrBMcccg6222gqvvvpqSaOnd+/euOmmmzbheNCgQahSpYou91K/AAMffFAH/fr9A6tWbYj8XLPmn6hceTXmzauKChXWoHv3z3H44TmBAoVJYUAYEAaEAWFAg4Hly5ejU6
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 87,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQV4FsfWx/8hCRCCBNfg7lDcJRCsaCjuVqC4uxSnBC8U1+BuBW4hWKHF3V2CJyHBCiH3mYUXkvAmKzM7u5vMfk+fr72ZOXPmN2dmz3t25oxDaGhoKMQjCAgCgoAgIAgIAoKAIBBjCDgIBzDGjLXoqCAgCAgCgoAgIAgIAhIB4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pRYt24dmjdvjtevX8PJSVlSYFqwipUzQUEehirbTZ0igCSRdBrvNFLzD3s/RJoEn/9dLGCyI2KOrQHyanIpYYo5wqWn8o0IFsIBFOunOeYJrZ9iSQeQOH8k6ufm5oby5ctj7NixSJEiRaQjsmDBAgwaNAjPnj2TH7UvJWjBKm7IBAVNsaDb9gCS078RDoFIiDTuASRVSy4siWMPjmFOzTn4ucjPwgFUaHOmsAuFuupdTLAQTo89GxN2EZ6K4MF3ntD6KZZzANesWYP48eMjQ4YMuH37NoYNG4aPHz9KewbjxInz3Rx98eKF9Dm5RYsWGDNmTKTviffv34P8Y3sIWHd3dzx//hwJEybU+/1iqHwyaffu3YsqVarA2Tnqu3b1VNRh0yY4Nm6M0NBQxArTUChx/gCErF6N0Hr1VKsw6e9JGOo7FJ6ZPbGt8TZZB9AMLFR3UocKZrELHbqmWqRgEf7FJubIZx7CLr53AIVt8LMN4qeQcw6BgYGa/BTLOYARV25yUIQ4g6tXr0b9CHniCJyqVasiceLE2Lp1a5TOzciRIzFq1KjvXg
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 238.8665 ± 0.3901 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 3e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.725"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 93,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005 , 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099,\n",
|
||
|
" 0.0106, 0.0113, 0.012 , 0.0127, 0.0134, 0.0141, 0.0148, 0.0155,\n",
|
||
|
" 0.0162, 0.0169, 0.0176, 0.0183, 0.019 , 0.0197]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7tnQm8VlXV/xciDpSAigPKVZyNMofMocTgk2hgTogK1FuZr5QNYs70OmOm+Zbwahraq+IAVkROQYoJSJnmkP2dNcXhAmoOUI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VeSGAGIAEQAphELPBE/2adhXLbfiYn4mPDUGQjAiIzydEyEWeZdSWIEIAIQAZhGLPBE/GSfhnHZficm4mPCU2cgACMyytMxEWaZdyWJEYAIQARgGrHAE/GTfRrGZfudmIiPCU+dgQCMyChPx0SYZd6VJEYAIgARgGnEAk/ET/ZpGJftd2IiPiY8dQYCMCKjPB0TYZZ5V5IYAYgARACmEQs8ET/Zp2Fctt+JifiY8NQZCMCIjPJ0TIRZ5l1JYhsB+MEHIvPniyxeLNKvn8igQSLdu5u7qy4DEhM2MVEXZ9XpJMRE/GRfJ1fV7TTERHxMeOoMBGBEKng6JsIs864kcfxkP2OGyLhxIs3NK93Tv7/IpEkiI0aYu8x9QGIiPibcnVTnExAT8ZN9nV3mfjpiIj4mPHUGAjAiBTwdE2GWeVeSOG6yV/E3cqRIS0t713TrtuLv06eXTwQSE3ExYZ6kBRiQmIif7AvgRlMTiIn4mPDUGQjAiHD3dEyEWeZdSeLsk70u+w4Y0L7y19ZBKgK1ErhgQbmWg4mJ7DFhnqAFGZCYiJ/sC+JKMzOIifiY8NQZCMCIUPd0TIRZ5l1J4uyT/dy5IkOGpLtkzhyRwY
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0011\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 94,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 95,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQnclsP6vr42oZTK0kKbDkLIkmwJFWXPWkhHtr8lWyIiki1CKDqWhJLlZGlBhxayVygiS2UpS0XKkr7q/7vex6u3r/d732dmnmWeee75/fyc45uZZ67rvmfmfmfuue+StWvXroUUYUAYEAaEAWFAGBAGhIHUMFAiBmBqZC1AhQFhQBgQBoQBYUAYyDAgBqAogjAgDAgDwoAwIAwIAyljQAzAlAlc4AoDwoAwIAwIA8KAMCAGoOiAMCAMCAPCgDAgDAgDKWNADMCUCVzgCgPCgDAgDAgDwoAwIAag6IAwIAwIA8K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G8CwYcBZZ4kBKLEP49HLKL+qs0FGOb4wviWY5QSwkF6JASiZQIzWHRcVyLVFc8kSYMstvRO/+fOBhg2B/v2Ba68FTjkFYAgYOSGRExKjhSABjV2b134oF8xiAIoBWHimyAmgn5WknDpiABqQF1HTl14CjjgC2Hln4IMPvI8uWAB88w3QqhVQ+e81UjaLdGwWaZSz/MCRHzgRLbexfUZnXru4f6sKQAxAVcbkCtiAsXiaLl3qpYNr0aL87+ssIPGgCe6rgjkdRq8YgGIABrdq2NmTzlomBqBcARtps4sKpDORjEi0pHEacQtmMQAtmX6hDEP0W/RbroDlCjiUxYWdigEYGrWBdEy/P774zVfoDzhwIPDLL8ATTwCyWaRjs0ijnOUEUE4AA1lQLe5EZ167uH+rikiugFUZkytgA8aibcrYfzNmeA8+OnRY/9s0ABs3BipWBPhQZJNNJCtGtN
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 98,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQVYVUkbx/+AWICFoKKYq65dayeuYq3d7NqB7tqdq67d3brmKrZrx6qY2F2fmAgWigKCCXzPHLwKeOH0nHPunfM8+6x6J973N+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kkxoKJHnPxw+IiPhXGg24/katT2AwgmwG0qBnAtx/fIuuMrAj7EIY9XntQJ28dUd/77z+8x/59+9kaQLYGMF7csC82ul9sojqtholZXDABqOVsKBOAKnV+uWBVMkuVYi1pEFt1eRXa/9ueO9j5do/b3x37wgfQkljw+cr3OWPBRA+b9Uq6l7A+wgQgE4B83yQG/JwJQAM2GoAaq2vg0INDGOcxDsOrDBftBBnQd+7eCfsf7ZEmZRpUzVlVdBmWkoF9uTEByAQgE4BixjM2ZtAdM+TqFPYKmL0CtphXwIFhgcg+Mzt35duD3g+QM11OMWMXl5YMYF1XdsXKJyvhkdMDh9sdFl2GpWRggzndwdwoccPigsWFlrNerJ98I8AEoErRIBesSmapUqylDOiTT0zGkENDUCVHFRxtf1QSK8Ji5faV6HqzK2xgg0d9HsE9rbuksoyeyVLiQol2YCyY6GGzofw9ifUTuv1Erk5hM4BsBtBiZgB/3/07Fp1fhKX1l6JTyU78o5WZFKYBbPqr6Tj++Dgm15iMQRUHSSrL6JnYYE53MDdKvLC4YHHBZgD5eyuNfsIEIH87SEohF6ykSjXKRCNQabkWFBaEtCnTwjG5o6QqTSyeZnmK7nu7o4hrEV
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 232.4375 ± 0.3994 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 3e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.75"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 99,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"The detected scaning axes and values are: \n",
|
||
|
"\n",
|
||
|
"{'mod_blink_on_time': array([0.005 , 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099,\n",
|
||
|
" 0.0106, 0.0113, 0.012 , 0.0127, 0.0134, 0.0141, 0.0148, 0.0155,\n",
|
||
|
" 0.0162, 0.0169, 0.0176, 0.0183, 0.019 , 0.0197]), 'runs': array([0., 1., 2., 3.])}\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sfQmUFdXV9WmaVsTIJA4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QcRvUtZAfyA+p/IAAPPEZGAb017/+Nf3yl780H4Tm3b+33norPfDAA3TaaaeV4P3FF1/Q8OHDzfuApT8EzTt2EwfvEi77IeipU6fiQ9AQgBCAFrMkJjhMcFITnEW4xa4J8gP5IZUfWS0Ao5z5mo6J0n2DzEBmUmQWpbiWsAW5cRJFYAEswBPpWcVvfmjqjEi9AyhByEGOoemYIO/D61p+A9dr3LidBw6Y4DDByU9wceMBG3vBFXholuIKTZ0BAWiTzWnaaDrGwSzxriAzkJkUmYkHZ8gDIjfwUJAqBBEX4EwpztTUGRCADhOIpmMczBLvCjIDmUmRmXhwhjwgcgMCEAIQVWEbGvLLFZo6AwLQxnOoAJpP6OCbVv8FDidywS+ZOaRbJLsCBwhACEAIQBty8ssVEIA26IbQRtMxIdxO2kv6Ddwo3YOELcABkz0qoZjsbbgEXIFVEymu0NQZqADaZDMqgKh8nfhZI1RCQeyl6QATPR4KUAHEQ4GNjPDLFRCANuiG0EbTMSHcDiqAHqD7TeAo+VLKFmABISxV4ZCKySiNg/xAfkjlh6bOQAXQgTU0HeNglnhXkBnITIrMxIMz5AGRG6gAogKICqANDfnlCk2dAQFo4zksAWMJGEvASVngl8wc0i2SXYEDBCAEIASgDT
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0012\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 100,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 101,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7sXQm4jdX+fg/noDLToBKVJt1Kwz+Nt1whpElFKlSiWZM0iQYqShpuSpMi0aQikrpUNN0QiXvlRohkyJTEcc7/efdqd/bZ9jn7W+sb9vet77eep+d2O2utb73v+q213r2G3y+vuLi4GJKEAWFAGBAGhAFhQBgQBmLDQJ4IwNj0tQAVBoQBYUAYEAaEAWEgwYAIQDEEYUAYEAaEAWFAGBAGYsaACMCYdbjAFQaEAWFAGBAGhAFhQASg2IAwIAwIA8KAMCAMCAMxY0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5qW9r+cTX3tlK04YhYB6FwUOLWjsOYT+3be1zau37p2KTuAuozJDqALxoItmrwDyNe/6Y9A2JJsdwC3bAF+/VX9s3at+of//uGHwMiR2bGMGgVceGH2fLnKEcfFIo6YRQA6FwW5GotefVfs23lfiwCUHUBX485GA7JtAkne1WNHp4pAN6+Ane4syg6gq+HlS2Hb7NspSXHELZjFDUx548PG9dvpfJDMJzuAuozJDqALxnJTlCKwRw9g9eqS79evDwwZYuYHUGdnUe4A5qbPy/qqH6IgCq6A/MAdrp7dsTWCWQSgCMDyR2kkBeAnn3yCQYMGYcaMGVixYgXGjh2Ls88++y+kXbt2xUsvvVQKedOmTfHFF18k/tvatWvRt29ffPDBB1i6dCnq1q2bKH/fffehRjJchIPZzcZfELZOmkOHAldfrTrVi0ggTncWHZhRzrLY2tflEeo1ZidOxnPWwSkf9hp3GDBla4NgFgEoAtBCAThx4kRMnz4dRx11FNq3b59RAK
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 103,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQVUFlkbx/+IBSgmKIqK2Ni6tq6Bia69Bq5du3bXhrHWp2ut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NYVP5mwnc3m9o19q7hfcL+LzPu4bbH2DC0CN5kFasBo1S5NibWrQxhCAa44two/+bZDfJT8udLmgSgSQFDLt+DR09++OslnK4lC7Q5r0GYtCbcovRIByFmxfbCz8W406uF/Epsh5sB0ntDqFRwB5BFCVqJcakymTMmIIwI7Lm2PeleXoX7Y/xlUbp5oAJIdCZ56YWSjvXu97yOz86d/N9vDJnO1kbhb/4H7B/YJHAMVHK4txwgWgeD8oSkELVlGlOmVi4ag6mfZttTEEoMfI9Lj98Rn2tt6LSh6VVBOApKCZJ2aiYIaCKO1eWrhezoyPTfmFSAdxFlz0WHIR7hc8AqinGKbVKTwCyCOANhsBdBoC2KdIiecDniOJfRJVBaAZBV/cNvOXGxc9XPQkPJL5GOECkAtAa3jbxbGBVlmbCYlNTWKhoUCqVEL31GwBONdpiFXN1n7pLptiwaNekocp9wsuhrkYFh8ufJywHSe0OoVHAHkE0HYigOvWAT16APfvf+n1cNc0SDFzHtCwoToRwIgI4OBB4OFDnIy8j0Upb6Dtdx1QPFNx8dnTYCn4ZM52MjdY98fbHO4X3C/0jHrxcfKVABeAGnkDLViNmqVJsTYxoRPx17gxEBUVi2GUnR3syH9Zs0YQgVQsSB09ewL37n2p464z8F+fxmg+dLUmfadloVQstG
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 224.9906 ± 0.4995 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 3e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 20e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.775"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 128,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"ename": "OSError",
|
||
|
"evalue": "[Errno group not found: images] 'images'",
|
||
|
"output_type": "error",
|
||
|
"traceback": [
|
||
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
||
|
"\u001b[1;31mOSError\u001b[0m Traceback (most recent call last)",
|
||
|
"Input \u001b[1;32mIn [128]\u001b[0m, in \u001b[0;36m<cell line: 5>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m shotNum \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0013\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 3\u001b[0m filePath \u001b[38;5;241m=\u001b[39m folderPath \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m shotNum \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/*.h5\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m----> 5\u001b[0m dataSetDict \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 6\u001b[0m dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msweep_start_freq\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124msweep_stop_freq\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m 8\u001b[0m }\n\u001b[0;32m 10\u001b[0m dataSet \u001b[38;5;241m=\u001b[39m dataSetDict[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcamera_0\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 12\u001b[0m print_scanAxis(dataSet)\n",
|
||
|
"Input \u001b[1;32mIn [128]\u001b[0m, in \u001b[0;36m<dictcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 2\u001b[0m shotNum \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0013\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 3\u001b[0m filePath \u001b[38;5;241m=\u001b[39m folderPath \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m shotNum \u001b[38;5;241m+\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/*.h5\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 5\u001b[0m dataSetDict \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m----> 6\u001b[0m dskey[groupList[i]]: \u001b[43mread_hdf5_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilePath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgroupList\u001b[49m\u001b[43m[\u001b[49m\u001b[43mi\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexcludeAxis\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msweep_start_freq\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msweep_stop_freq\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m 8\u001b[0m }\n\u001b[0;32m 10\u001b[0m dataSet \u001b[38;5;241m=\u001b[39m dataSetDict[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcamera_0\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 12\u001b[0m print_scanAxis(dataSet)\n",
|
||
|
"File \u001b[1;32mZ:\\Dy_Lab\\Data\\Analysis\\2023\\07\\31\\DataContainer\\ReadData.py:170\u001b[0m, in \u001b[0;36mread_hdf5_file\u001b[1;34m(filePath, group, datesetOfGlobal, preprocess, join, parallel, engine, phony_dims, excludeAxis, maxFileNum, **kwargs)\u001b[0m\n\u001b[0;32m 167\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 168\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mupdate({\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpreprocess\u001b[39m\u001b[38;5;124m'\u001b[39m:preprocess})\n\u001b[1;32m--> 170\u001b[0m ds \u001b[38;5;241m=\u001b[39m xr\u001b[38;5;241m.\u001b[39mopen_mfdataset(fullFilePath, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 172\u001b[0m newDimKey \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mappend([\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mx\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124my\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mz\u001b[39m\u001b[38;5;124m'\u001b[39m], [ \u001b[38;5;28mchr\u001b[39m(i) \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m97\u001b[39m, \u001b[38;5;241m97\u001b[39m\u001b[38;5;241m+\u001b[39m\u001b[38;5;241m23\u001b[39m)])\n\u001b[0;32m 174\u001b[0m oldDimKey \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39msort(\n\u001b[0;32m 175\u001b[0m [\n\u001b[0;32m 176\u001b[0m key \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 179\u001b[0m ]\n\u001b[0;32m 180\u001b[0m )\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\api.py:990\u001b[0m, in \u001b[0;36mopen_mfdataset\u001b[1;34m(paths, chunks, concat_dim, compat, preprocess, engine, data_vars, coords, combine, parallel, join, attrs_file, combine_attrs, **kwargs)\u001b[0m\n\u001b[0;32m 985\u001b[0m datasets \u001b[38;5;241m=\u001b[39m [preprocess(ds) \u001b[38;5;28;01mfor\u001b[39;00m ds \u001b[38;5;129;01min\u001b[39;00m datasets]\n\u001b[0;32m 987\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m parallel:\n\u001b[0;32m 988\u001b[0m \u001b[38;5;66;03m# calling compute here will return the datasets/file_objs lists,\u001b[39;00m\n\u001b[0;32m 989\u001b[0m \u001b[38;5;66;03m# the underlying datasets will still be stored as dask arrays\u001b[39;00m\n\u001b[1;32m--> 990\u001b[0m datasets, closers \u001b[38;5;241m=\u001b[39m \u001b[43mdask\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdatasets\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mclosers\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 992\u001b[0m \u001b[38;5;66;03m# Combine all datasets, closing them in case of a ValueError\u001b[39;00m\n\u001b[0;32m 993\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\dask\\base.py:599\u001b[0m, in \u001b[0;36mcompute\u001b[1;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[0;32m 596\u001b[0m keys\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_keys__())\n\u001b[0;32m 597\u001b[0m postcomputes\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_postcompute__())\n\u001b[1;32m--> 599\u001b[0m results \u001b[38;5;241m=\u001b[39m schedule(dsk, keys, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 600\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m repack([f(r, \u001b[38;5;241m*\u001b[39ma) \u001b[38;5;28;01mfor\u001b[39;00m r, (f, a) \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(results, postcomputes)])\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\client.py:3224\u001b[0m, in \u001b[0;36mClient.get\u001b[1;34m(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)\u001b[0m\n\u001b[0;32m 3222\u001b[0m should_rejoin \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[0;32m 3223\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 3224\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgather\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpacked\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3225\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 3226\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m futures\u001b[38;5;241m.\u001b[39mvalues():\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\client.py:2359\u001b[0m, in \u001b[0;36mClient.gather\u001b[1;34m(self, futures, errors, direct, asynchronous)\u001b[0m\n\u001b[0;32m 2357\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 2358\u001b[0m local_worker \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m-> 2359\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 2360\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_gather\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2361\u001b[0m \u001b[43m \u001b[49m\u001b[43mfutures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2362\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2363\u001b[0m \u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2364\u001b[0m \u001b[43m \u001b[49m\u001b[43mlocal_worker\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlocal_worker\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2365\u001b[0m \u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 2366\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\utils.py:351\u001b[0m, in \u001b[0;36mSyncMethodMixin.sync\u001b[1;34m(self, func, asynchronous, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[0;32m 349\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m future\n\u001b[0;32m 350\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 351\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m sync(\n\u001b[0;32m 352\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloop, func, \u001b[38;5;241m*\u001b[39margs, callback_timeout\u001b[38;5;241m=\u001b[39mcallback_timeout, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs\n\u001b[0;32m 353\u001b[0m )\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\utils.py:418\u001b[0m, in \u001b[0;36msync\u001b[1;34m(loop, func, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[0;32m 416\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m error:\n\u001b[0;32m 417\u001b[0m typ, exc, tb \u001b[38;5;241m=\u001b[39m error\n\u001b[1;32m--> 418\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mwith_traceback(tb)\n\u001b[0;32m 419\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 420\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\utils.py:391\u001b[0m, in \u001b[0;36msync.<locals>.f\u001b[1;34m()\u001b[0m\n\u001b[0;32m 389\u001b[0m future \u001b[38;5;241m=\u001b[39m wait_for(future, callback_timeout)\n\u001b[0;32m 390\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mensure_future(future)\n\u001b[1;32m--> 391\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m future\n\u001b[0;32m 392\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[0;32m 393\u001b[0m error \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\tornado\\gen.py:762\u001b[0m, in \u001b[0;36mRunner.run\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 759\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 761\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 762\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 763\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[0;32m 764\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\distributed\\client.py:2222\u001b[0m, in \u001b[0;36mClient._gather\u001b[1;34m(self, futures, errors, direct, local_worker)\u001b[0m\n\u001b[0;32m 2220\u001b[0m exc \u001b[38;5;241m=\u001b[39m CancelledError(key)\n\u001b[0;32m 2221\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m-> 2222\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exception\u001b[38;5;241m.\u001b[39mwith_traceback(traceback)\n\u001b[0;32m 2223\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[0;32m 2224\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m errors \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mskip\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\dask\\utils.py:73\u001b[0m, in \u001b[0;36mapply\u001b[1;34m()\u001b[0m\n\u001b[0;32m 42\u001b[0m \u001b[38;5;124;03m\"\"\"Apply a function given its positional and keyword arguments.\u001b[39;00m\n\u001b[0;32m 43\u001b[0m \n\u001b[0;32m 44\u001b[0m \u001b[38;5;124;03mEquivalent to ``func(*args, **kwargs)``\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 70\u001b[0m \u001b[38;5;124;03m>>> dsk = {'task-name': task} # adds the task to a low level Dask task graph\u001b[39;00m\n\u001b[0;32m 71\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 72\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m kwargs:\n\u001b[1;32m---> 73\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 74\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 75\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs)\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\api.py:525\u001b[0m, in \u001b[0;36mopen_dataset\u001b[1;34m()\u001b[0m\n\u001b[0;32m 513\u001b[0m decoders \u001b[38;5;241m=\u001b[39m _resolve_decoders_kwargs(\n\u001b[0;32m 514\u001b[0m decode_cf,\n\u001b[0;32m 515\u001b[0m open_backend_dataset_parameters\u001b[38;5;241m=\u001b[39mbackend\u001b[38;5;241m.\u001b[39mopen_dataset_parameters,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 521\u001b[0m decode_coords\u001b[38;5;241m=\u001b[39mdecode_coords,\n\u001b[0;32m 522\u001b[0m )\n\u001b[0;32m 524\u001b[0m overwrite_encoded_chunks \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moverwrite_encoded_chunks\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m--> 525\u001b[0m backend_ds \u001b[38;5;241m=\u001b[39m backend\u001b[38;5;241m.\u001b[39mopen_dataset(\n\u001b[0;32m 526\u001b[0m filename_or_obj,\n\u001b[0;32m 527\u001b[0m drop_variables\u001b[38;5;241m=\u001b[39mdrop_variables,\n\u001b[0;32m 528\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mdecoders,\n\u001b[0;32m 529\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 530\u001b[0m )\n\u001b[0;32m 531\u001b[0m ds \u001b[38;5;241m=\u001b[39m _dataset_from_backend_dataset(\n\u001b[0;32m 532\u001b[0m backend_ds,\n\u001b[0;32m 533\u001b[0m filename_or_obj,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 541\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 542\u001b[0m )\n\u001b[0;32m 543\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\h5netcdf_.py:413\u001b[0m, in \u001b[0;36mopen_dataset\u001b[1;34m()\u001b[0m\n\u001b[0;32m 394\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mopen_dataset\u001b[39m( \u001b[38;5;66;03m# type: ignore[override] # allow LSP violation, not supporting **kwargs\u001b[39;00m\n\u001b[0;32m 395\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 396\u001b[0m filename_or_obj: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m os\u001b[38;5;241m.\u001b[39mPathLike[Any] \u001b[38;5;241m|\u001b[39m BufferedIOBase \u001b[38;5;241m|\u001b[39m AbstractDataStore,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 410\u001b[0m decode_vlen_strings\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[0;32m 411\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Dataset:\n\u001b[0;32m 412\u001b[0m filename_or_obj \u001b[38;5;241m=\u001b[39m _normalize_path(filename_or_obj)\n\u001b[1;32m--> 413\u001b[0m store \u001b[38;5;241m=\u001b[39m H5NetCDFStore\u001b[38;5;241m.\u001b[39mopen(\n\u001b[0;32m 414\u001b[0m filename_or_obj,\n\u001b[0;32m 415\u001b[0m \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mformat\u001b[39m,\n\u001b[0;32m 416\u001b[0m group\u001b[38;5;241m=\u001b[39mgroup,\n\u001b[0;32m 417\u001b[0m lock\u001b[38;5;241m=\u001b[39mlock,\n\u001b[0;32m 418\u001b[0m invalid_netcdf\u001b[38;5;241m=\u001b[39minvalid_netcdf,\n\u001b[0;32m 419\u001b[0m phony_dims\u001b[38;5;241m=\u001b[39mphony_dims,\n\u001b[0;32m 420\u001b[0m decode_vlen_strings\u001b[38;5;241m=\u001b[39mdecode_vlen_strings,\n\u001b[0;32m 421\u001b[0m )\n\u001b[0;32m 423\u001b[0m store_entrypoint \u001b[38;5;241m=\u001b[39m StoreBackendEntrypoint()\n\u001b[0;32m 425\u001b[0m ds \u001b[38;5;241m=\u001b[39m store_entrypoint\u001b[38;5;241m.\u001b[39mopen_dataset(\n\u001b[0;32m 426\u001b[0m store,\n\u001b[0;32m 427\u001b[0m mask_and_scale\u001b[38;5;241m=\u001b[39mmask_and_scale,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 433\u001b[0m decode_timedelta\u001b[38;5;241m=\u001b[39mdecode_timedelta,\n\u001b[0;32m 434\u001b[0m )\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\h5netcdf_.py:176\u001b[0m, in \u001b[0;36mopen\u001b[1;34m()\u001b[0m\n\u001b[0;32m 173\u001b[0m lock \u001b[38;5;241m=\u001b[39m combine_locks([HDF5_LOCK, get_write_lock(filename)])\n\u001b[0;32m 175\u001b[0m manager \u001b[38;5;241m=\u001b[39m CachingFileManager(h5netcdf\u001b[38;5;241m.\u001b[39mFile, filename, mode\u001b[38;5;241m=\u001b[39mmode, kwargs\u001b[38;5;241m=\u001b[39mkwargs)\n\u001b[1;32m--> 176\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mcls\u001b[39m(manager, group\u001b[38;5;241m=\u001b[39mgroup, mode\u001b[38;5;241m=\u001b[39mmode, lock\u001b[38;5;241m=\u001b[39mlock, autoclose\u001b[38;5;241m=\u001b[39mautoclose)\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\h5netcdf_.py:127\u001b[0m, in \u001b[0;36m__init__\u001b[1;34m()\u001b[0m\n\u001b[0;32m 124\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mformat \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 125\u001b[0m \u001b[38;5;66;03m# todo: utilizing find_root_and_group seems a bit clunky\u001b[39;00m\n\u001b[0;32m 126\u001b[0m \u001b[38;5;66;03m# making filename available on h5netcdf.Group seems better\u001b[39;00m\n\u001b[1;32m--> 127\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_filename \u001b[38;5;241m=\u001b[39m find_root_and_group(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mds)[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m.\u001b[39mfilename\n\u001b[0;32m 128\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_remote \u001b[38;5;241m=\u001b[39m is_remote_uri(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_filename)\n\u001b[0;32m 129\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlock \u001b[38;5;241m=\u001b[39m ensure_lock(lock)\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\h5netcdf_.py:187\u001b[0m, in \u001b[0;36mds\u001b[1;34m()\u001b[0m\n\u001b[0;32m 185\u001b[0m \u001b[38;5;129m@property\u001b[39m\n\u001b[0;32m 186\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mds\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 187\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_acquire()\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\h5netcdf_.py:180\u001b[0m, in \u001b[0;36m_acquire\u001b[1;34m()\u001b[0m\n\u001b[0;32m 178\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_acquire\u001b[39m(\u001b[38;5;28mself\u001b[39m, needs_lock\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m):\n\u001b[0;32m 179\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_manager\u001b[38;5;241m.\u001b[39macquire_context(needs_lock) \u001b[38;5;28;01mas\u001b[39;00m root:\n\u001b[1;32m--> 180\u001b[0m ds \u001b[38;5;241m=\u001b[39m _nc4_require_group(\n\u001b[0;32m 181\u001b[0m root, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_group, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_mode, create_group\u001b[38;5;241m=\u001b[39m_h5netcdf_create_group\n\u001b[0;32m 182\u001b[0m )\n\u001b[0;32m 183\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\n",
|
||
|
"File \u001b[1;32m~\\anaconda3\\envs\\py39\\lib\\site-packages\\xarray\\backends\\netCDF4_.py:191\u001b[0m, in \u001b[0;36m_nc4_require_group\u001b[1;34m()\u001b[0m\n\u001b[0;32m 188\u001b[0m ds \u001b[38;5;241m=\u001b[39m create_group(ds, key)\n\u001b[0;32m 189\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 190\u001b[0m \u001b[38;5;66;03m# wrap error to provide slightly more helpful message\u001b[39;00m\n\u001b[1;32m--> 191\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgroup not found: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mkey\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, e)\n\u001b[0;32m 192\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\n",
|
||
|
"\u001b[1;31mOSError\u001b[0m: [Errno group not found: images] 'images'"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0013\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 129,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"application/javascript": "/* Put everything inside the global mpl namespace */\n/* global mpl */\nwindow.mpl = {};\n\nmpl.get_websocket_type = function () {\n if (typeof WebSocket !== 'undefined') {\n return WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n return MozWebSocket;\n } else {\n alert(\n 'Your browser does not have WebSocket support. ' +\n 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n 'Firefox 4 and 5 are also supported but you ' +\n 'have to enable WebSockets in about:config.'\n );\n }\n};\n\nmpl.figure = function (figure_id, websocket, ondownload, parent_element) {\n this.id = figure_id;\n\n this.ws = websocket;\n\n this.supports_binary = this.ws.binaryType !== undefined;\n\n if (!this.supports_binary) {\n var warnings = document.getElementById('mpl-warnings');\n if (warnings) {\n warnings.style.display = 'block';\n warnings.textContent =\n 'This browser does not support binary websocket messages. ' +\n 'Performance may be slow.';\n }\n }\n\n this.imageObj = new Image();\n\n this.context = undefined;\n this.message = undefined;\n this.canvas = undefined;\n this.rubberband_canvas = undefined;\n this.rubberband_context = undefined;\n this.format_dropdown = undefined;\n\n this.image_mode = 'full';\n\n this.root = document.createElement('div');\n this.root.setAttribute('style', 'display: inline-block');\n this._root_extra_style(this.root);\n\n parent_element.appendChild(this.root);\n\n this._init_header(this);\n this._init_canvas(this);\n this._init_toolbar(this);\n\n var fig = this;\n\n this.waiting = false;\n\n this.ws.onopen = function () {\n fig.send_message('supports_binary', { value: fig.supports_binary });\n fig.send_message('send_image_mode', {});\n if (fig.ratio !== 1) {\n fig.send_message('set_device_pixel_ratio', {\n device_pixel_ratio: fig.ratio,\n });\n }\n fig.send_message('refresh', {});\n };\n\n this.imageObj.onload = function () {\n if (fig.image_mode === 'full') {\n // Full images could contain transparency (where diff images\n // almost always do), so we need to clear the canvas so that\n // there is no ghosting.\n fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n }\n fig.context.drawImage(fig.imageObj, 0, 0);\n };\n\n this.imageObj.onunload = function () {\n fig.ws.close();\n };\n\n this.ws.onmessage = this._make_on_message_function(this);\n\n this.ondownload = ondownload;\n};\n\nmpl.figure.prototype._init_header = function () {\n var titlebar = document.createElement('div');\n titlebar.classList =\n 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';\n var titletext = document.createElement('div');\n titletext.classList = 'ui-dialog-title';\n titletext.setAttribute(\n 'style',\n 'width: 100%; text-align: center; padding: 3px;'\n );\n titlebar.appendChild(titletext);\n this.root.appendChild(titlebar);\n this.header = titletext;\n};\n\nmpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._root_extra_style = function (_canvas_div) {};\n\nmpl.figure.prototype._init_canvas = function () {\n var fig = this;\n\n var canvas_div = (this.canvas_div = document.createElement('div'));\n canvas_div.setAttribute(\n 'style',\n 'border: 1px solid #ddd;' +\n 'box-sizing: content-box;' +\n 'clear: both;' +\n 'min-height: 1px;' +\n 'min-width: 1px;' +\n 'outline: 0;' +\n 'overflow: hidden;' +\n 'position: relative;' +\n 'resize: both;'\n );\n\n function on_keyboard_event_closure(name) {\n return function (event) {\n return fig.key
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Javascript object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAYAAAA10dzkAAAAAXNSR0IArs4c6QAAIABJREFUeF7snQdcFEf7x3+IBUREUVQU7L33bhQV7L0bRY0ae+/t1SS22EtiN2o0tqhYMZbYe+8aKxbErgioqMD7mdVTwDtud25mb/du9v/J5583THme7zwz+7vZKQ4xMTExEI8gIAgIAoKAICAICAKCgN0QcBAC0G7aWjgqCAgCgoAgIAgIAoKAREAIQBEIgoAgIAgIAoKAICAI2BkBIQDtrMGFu4KAICAICAKCgCAgCAgBKGJAEBAEBAFBQBAQBAQBOyMgBKCdNbhwVxAQBAQBQUAQEAQEASEARQwIAoKAICAICAKCgCBgZwSEALSzBhfuC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Nf2nxwcHDQWpPLtocVD9kVajyh4CFe8qZCVMSGiA0hADU+gMs1TwhAuaR0mC6eABxXbzr6lu3LVADqkIpRk8VLTbzUeLzUbKV/xPZD9BXRV3j0FZ5aRHwCNtFiPKFrbfCzu4Hr9WvAzU1qhprfA9OmXED+DIW4CcCYmBjdzgLaXWyY6ZyCh3jJixlAeW8w0VfY9BWeWkQIQCEAmX32lDcsWDnVhg1A795AcPAXQ2K8vOAwcybQuLHlLKKigIMHgZAQhKZOji6hK3D6yTlc63ENjokcrey88urFIM5mEFdOXh85RHx8bSfBQvQVMQOoj3HLrJU8VbfZylVOYDcDFxF/TZsCMTFxCRvW6K1bhw/16tHfBELK79MHePDgS/nBbg7oVSMGg6ceRVmvsiq3rOXV2U1syEQleIiXvJgBlN
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.HTML object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"f = 224.9906 ± 0.4995 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 3e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 19e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.8"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0036\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 2e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 19e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.85"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0038\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 2e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 19e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## Truncation: 0.9"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib notebook\n",
|
||
|
"shotNum = \"0040\"\n",
|
||
|
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
|
||
|
"\n",
|
||
|
"dataSetDict = {\n",
|
||
|
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i], excludeAxis = ['sweep_start_freq', 'sweep_stop_freq'])\n",
|
||
|
" for i in [0]\n",
|
||
|
"}\n",
|
||
|
"\n",
|
||
|
"dataSet = dataSetDict[\"camera_0\"]\n",
|
||
|
"\n",
|
||
|
"print_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"scanAxis = get_scanAxis(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = auto_rechunk(dataSet)\n",
|
||
|
"\n",
|
||
|
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
|
||
|
"\n",
|
||
|
"imageAnalyser.center = (800, 900)\n",
|
||
|
"imageAnalyser.span = (300, 300)\n",
|
||
|
"imageAnalyser.fraction = (0.1, 0.1)\n",
|
||
|
"\n",
|
||
|
"dataSet_cropOD = imageAnalyser.crop_image(dataSet.OD)\n",
|
||
|
"dataSet_cropOD = imageAnalyser.substract_offset(dataSet_cropOD).load()\n",
|
||
|
"\n",
|
||
|
"Ncount = imageAnalyser.get_Ncount(dataSet_cropOD)\n",
|
||
|
"Ncount_mean = calculate_mean(Ncount)\n",
|
||
|
"Ncount_std = calculate_std(Ncount)\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"Ncount_mean.plot.errorbar(ax=ax, yerr = None, fmt='ob')\n",
|
||
|
"plt.ylabel('NCount')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"dataSet_cropOD_chunk = dataSet_cropOD.chunk((1, 1, 300, 300))\n",
|
||
|
"fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
|
||
|
"params = fitAnalyser.guess(dataSet_cropOD_chunk, dask=\"parallelized\")\n",
|
||
|
"fitResult = fitAnalyser.fit(dataSet_cropOD_chunk, params, dask=\"parallelized\").load()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"val = fitAnalyser.get_fit_value(fitResult)\n",
|
||
|
"std = fitAnalyser.get_fit_std(fitResult)\n",
|
||
|
"\n",
|
||
|
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
|
||
|
"\n",
|
||
|
"# dataKey = 'sigmax'\n",
|
||
|
"# dataKey = 'centerx'\n",
|
||
|
"# dataKey = 'sigmay'\n",
|
||
|
"dataKey = 'centery'\n",
|
||
|
"\n",
|
||
|
"# val_mean = val[dataKey].mean(dim='runs')\n",
|
||
|
"# std_mean = val[dataKey].std(dim='runs')\n",
|
||
|
"\n",
|
||
|
"val_mean = calculate_mean(val[dataKey])\n",
|
||
|
"std_mean = calculate_std(val[dataKey])\n",
|
||
|
"\n",
|
||
|
"fig = plt.figure()\n",
|
||
|
"ax = fig.gca()\n",
|
||
|
"\n",
|
||
|
"val_mean.plot.errorbar(yerr=std_mean, fmt='--ob')\n",
|
||
|
"\n",
|
||
|
"plt.grid()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def damp_osci(t, t0, A, B, nu, gamma):\n",
|
||
|
" return A * np.exp(-gamma*t)*np.sin(2*np.pi*nu*(t-t0)) + B\n",
|
||
|
"\n",
|
||
|
"yvals = val_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"yvals_std = std_mean#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"xvals = dataSet_cropOD[scanAxis[0]]#.sel(blink_on_time=slice(0.005, 0.025))\n",
|
||
|
"\n",
|
||
|
"fitted_qtys_1 = yvals.to_numpy()\n",
|
||
|
"scan_para = xvals.to_numpy()\n",
|
||
|
"fitted_qtys_err_1 = yvals_std.to_numpy()\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"popt_x, pcov_x = curve_fit(damp_osci, scan_para, fitted_qtys_1, np.array([0, 3, 147, 2e2, 0.1]))\n",
|
||
|
"freqdata = np.linspace(0.005, 19e-3, 500)\n",
|
||
|
"plt.plot(freqdata, damp_osci(freqdata, *popt_x), 'g--',label='fit: t0=%5.3f, A=%5.3f, B=%5.3f, nu=%5.3f, Gamma=%5.3f' % tuple(popt_x))\n",
|
||
|
"plt.errorbar(scan_para, fitted_qtys_1, yerr=fitted_qtys_err_1, fmt='or')\n",
|
||
|
"plt.xlabel('hold time after switch on the trap (s)')\n",
|
||
|
"plt.ylabel('Center along gravity direction (pixels)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"#plt.ylim([0,750])\n",
|
||
|
"#plt.xlim([0.004, 0.025])\n",
|
||
|
"#plt.legend(prop={'size': 14})\n",
|
||
|
"plt.show()\n",
|
||
|
"\n",
|
||
|
"f_x = popt_x[3]\n",
|
||
|
"df_x = pcov_x[3][3]**0.5\n",
|
||
|
"\n",
|
||
|
"print('f = %.4f \\u00B1 %.4f Hz'% tuple([np.abs(f_x),df_x]))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 13,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHPCAYAAAAFwj37AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABMqElEQVR4nO3de1yUdd7/8fcl4OCJFNBEQDFrM1J3W8ulLZJMCNHSyLrbtoPnNnXBrL3zAAoesDbr1szb1krRtNMqWpaimLrZwdafdd+r22E76KaopXigVHDE6/fH3EyOAzowAzMXvJ6PB4+c7/Wd73yvj5f29jp8xzBN0xQAAAAsoYm/JwAAAADPEd4AAAAshPAGAABgIYQ3AAAACyG8AQAAWAjhDQAAwEIIbwAAABYS7O8JBLKzZ89q//79atWqlQzD8Pd0AABAA2aapn788Ud16NBBTZpUf36N8HYB+/fvV2xsrL+nAQAAGpG9e/cqJiam2u2Etwto1aqVJEcRw8LCaj2O3W7Xhg0blJKSopCQEF9Nr9Ghjt6jht6jht6jhr5BHb0XaDUsLS1VbGysM39Uh/B2AZWXSsPCwrwOb82bN1dYWFhAHBxWRR29Rw29Rw29Rw19gzp6L1BreLFbtXhgAQAAwEIIbwAAABZCeAMAALAQwhsAAICFEN4AAAAshPAGAABgIYQ3AAAACyG8AQAAWAjhDQAAwEIIbwAAABZCeAMAALAQwhsAAICFEN4AAAAshPAGAABgIYQ3AAAACyG8AQAAXMCJE5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k93T9zQ/3jzBsAAAGsokLKzHQPbg6Os27jxolLqI0I4Q0AgAC2dau0b1/1203T0N69jn5oHAhvAAAEsAMHfNsP1kd4AwAggEVF+bYfrI/wBgBAAEtMlGJiHF9GXxXDMBUb6+iHxoHwBgBAAAsKkubOdfzaPcA5nmKYM8fRD40D4Q0AgACXni6tWCF16ODaHhl5Sq+9VsEyIY0M67wBAGAB6elS377SJZc4Xq9Zc0anTxfpttvS/Dsx1DvOvAEAYBHnXhq98UaTS6WNFOENAADAQghvAAAAFkJ4AwAAsBAeWAAAwCJatPj5O07tdv/OBf7DmTcAAAALIbwBAABYCOENAADAQghvAAAAFkJ4AwAAsBDCGwAAgIUQ3gAAACyE8AYAAGAhfg9vmzZt0rBhw9S1a1e1aNFC0dHRGjhwoHbs2OHSzzRNvfDCC+rZs6fCwsIUERGh3r1765133qly3Hnz5qlr166y2Wzq3LmzcnNzZWdFQwAAYHF+D28LFizQnj17lJmZqbVr12ru3Ln64YcflJCQoE2bNjn7TZ06VaNGjVKvXr20cuVK5efny2azacCAASooKHAZc+bMmcrMzFR6errWr1+v0aNHKy8vT2PGjKnv3QMAAPApv3891vz589WuXTuXttTUVF1++eXKy8tTnz59JEmLFi3SjTfeqAULFjj7JScnq3379lqyZInS09MlSSUlJZoxY4ZGjhypvLw8SVJSUpLsdruysrI0btw4xcfH19PeAQAA+Jbfz7ydH9wkqWXLloqPj9fevXudbSEhIbrkkktc+oWGhjp/KhUWFqqsrExDhw516Tt06FCZpqnVq1f7dgcAAADqkd/PvFXl+PHj+uSTT5xn3SQpMzNTjz32mF566SWlp6errKxMTz31lI4fP66MjAxnv127dkmSunfv7jJmVFSUIiMjndurUl5ervLycufr0tJSSZLdbvfqfrnK93LPnXeoo/eoofeoofeooW9QR+8FWg09nYdhmqZZx3Opsfvuu0+vv/66tm3bpp49ezrb//KXvygzM9MZsMLDw/X666+rb9++zj6jRo3S0qVLVVZW5jb
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHPCAYAAAAFwj37AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABAaUlEQVR4nO3deXQUZfr28auyNSEQsjWQQIJKHJEILiiGo0hAUEbwVWMcHVzAdVxZXEZEQMK4oCMI7voTQQUdJcRxYFQIShBHMzICipnRMYqCgNAgTTBAJyTP+weT1pCFTqeTTqW/n3NyTuqppyp336c8XlR1VVnGGCMAAADYQliwCwAAAIDvCG8AAAA2QngDAACwEcIbAACAjRDeAAAAbITwBgAAYCOENwAAABuJCHYBwVBVVaWtW7eqY8eOsiwr2OUAAIAQYIzR3r17lZKSorAw/8+fhWR427p1q1JTU4NdBgAACEGbN29W9+7d/d4+JMNbx44dJR1qXmxsbJCraX0qKiq0fPlynXPOOYqMjAx2ObZAz/xD3/xD3/xD3xqPnvmnvr6VlpYqNTXVm0P8FZLhrfpSaWxsLOGtDhUVFWrfvr1iY2P5j9VH9Mw/9M0/9M0/9K3x6Jl/jtS3pn5lixsWAAAAbITwBgAAYCOENwAAABshvAEAANgI4Q0AAMBGCG8AAAA2QngDAACwEcIbAACAjRDeAAAAbITwBgAAYCOENwAAABshvAEAANgI4Q0AAMBGCG8AAAA2QngDAACwEcIbAAAIeZWVZSostFRYaKmysizY5TSI8AYAAGAjhDcAAAAbIbwBAADYCOENAADARghvAAAANkJ4AwAAsJGgh7fCwkJZllXnT1FRUY25a9eu1dChQ9WhQwfFxcUpOztb3377bZAqBwAAaHkRwS6g2oMPPqjBgwfXGDvhhBO8v3/55ZfKysrSSSedpDfeeEMHDhzQ1KlTNXDgQK1fv15Op7OlSwYAAGhxrSa8HXvsscr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qmUlBTt2bOn1vro6Gi9//77tcYAAABCRasKbzfeeKPOOussJSQkKC8vr9b6sLAwZWZmBqEyAACA1qHVXDZdsGCBVq1apaeffjrYpQAAALRareLM244dOzR+/HjNmDFD3bt3r3fe/v371bVrV7lcLiUnJ+vCCy/U9OnTlZCQ0OD+PR6PPB6Pd7m0tFSSVFFRoYqKisB8iDakuif0xnf0zD/0zT/0zT/0rfHomX/q61ug+mgZY0xA9tQEOTk52rZtmz788ENZlqUxY8YoLy9PP//8s3fOY489Jkk64YQTJEmrVq3SY489prS0NK1Zs6bWDQ6/Nm3aNOXm5tYaf/XVV9W+ffsAfxoAAIDa9u3bp1GjRmnPnj2KjY31ez9BD2+LFy/WqFGjtG7dOvXu3VuS6gxv9W2bk5OjWbNmacKECfXOq+vMW2pqqnbu3Nmk5rVVFRUVKigo0LBhwxQZGRnscmyBnvmHvvmHvvmHvjUePfNPfX0rLS1VUlJSk8NbUC+b/vzzz7rlllt02223KSUlRW63W5JUXl4uSXK73YqMjFRMTEyd21900UWKiYlRUVFRg3/H4XDI4XDUGo+MjORgbAD9aTx65h/65h/65h/61nj0zD+H9y1QPQzqDQs7d+7U9u3bNXPmTMXHx3t/XnvtNZWVlSk+Pl6XX355g/swxigsrNXcdwEAANCsgnrmrWvXrlq5cmWt8RkzZmjVqlV65513lJSUVO/2eXl52rdvH48PAQAAISOo4a1du3bKysqqNT5//nyFh4d7133//fcaNWqULrvsMqWnp8uyLK1atUqzZ89WRkaGrrvuupYtHAAAIEhaxaNCjiQ2NlZdunTRrFmztH37dlVWVqpHjx4aO3a
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHPCAYAAAAFwj37AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24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yNLocossio+MV2rXVB9XBn8hvAEAEMCCg4K1IGOBJDUZ4OZnzFdwULAvy4IfEd4AAAhwtiSb1jy2Rl0iujiNdwztqDdsb/CakOsM73kDAMAEbEk2Deg2QDc8f4MkacNjG3T+8/N6KPEhP1cGX+PMGwAAJnHppdF+Xfsp2MKl0usRZ94AADCJ8DbhMmZdfFmv3W73czXwF868AQAAmAjhDQAAwEQIbwAAACZCeAMAADARv4e3rVu3avTo0UpMTFR4eLhiY2OVmZmpTz75xGmeYRj605/+pN69eysyMlLR0dG677779N577zW63YULFyoxMVFWq1XdunVTQUEBN3cCAADT83t4W7x4sQ4cOKDs7Gxt3LhRCxYs0DfffKOUlBRt3brVMW/WrFkaN26c+vTpo7Vr16qoqEhWq1VDhw5VcXGx0zbnzp2r7Oxs2Ww2bdq0SePHj1dhYaEmTJjg690DAADwKr+/KmTRokXq1KmT01hGRoZuv/12FRYWqn///pKkpUuXql+/flq8eLFjXnp6ujp37qzly5fLZrv4dumKigrNmTNHY8eOVWFhoSQpLS1NdrtdeXl5ysnJUXJyso/2DgAAwLv8fubt8uAmSe3bt1dycrIOHTrkGAsNDdUNN9zgNC8sLMzxp0FJSYl
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"tf_z = [299.3777, 288.1736, 272.4744, 259.5129, 241.8841, 233.8030, 229.2665, 219.5115, 211.4388, 199.3276, 184.9726]\n",
|
||
|
"dtf_z = [3.7588, 3.5503,1.2193, 0.7946, 1.7848, 1.4811, 0.7289, 1.0038, 0.7646, 1.0321, 1.0431]\n",
|
||
|
"trunc = [0.5, 0.55, 0.6, 0.65, 0.7, 0.725, 0.75, 0.775, 0.8, 0.85, 0.9]\n",
|
||
|
"p_1 = [0.507, 0.449, 0.398, 0.354, 0.315, 0.298, 0.282, 0.266, 0.252, 0.226, 0.204]\n",
|
||
|
"p_2 = [3.88, 3.38, 2.911, 2.474, 2.066, 1.873, 1.687, 1.507, 1.33, 1.003, 0.696]\n",
|
||
|
" \n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.errorbar(p_1, tf_z, yerr = dtf_z, fmt = 'ob')\n",
|
||
|
"plt.xlabel('Power of Arm 1')\n",
|
||
|
"plt.ylabel('Vertical TF (Hz)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"\n",
|
||
|
"tf_y = [49.3970, 47.4535, 43.9127, 40.8258, 36.6638, 35.6111, 34.3650, 32.0196, 29.9294, 26.5413, 22.4257]\n",
|
||
|
"dtf_y = [1.5574, 0.5536, 0.3721, 0.4734, 0.9428, 0.7725, 0.3264, 0.2862, 0.1988, 0.2477, 0.3690]\n",
|
||
|
"trunc = [0.5, 0.55, 0.6, 0.65, 0.7, 0.725, 0.75, 0.775, 0.8, 0.85, 0.9]\n",
|
||
|
" \n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.errorbar(p_2, tf_y, yerr = dtf_y, fmt = 'oy')\n",
|
||
|
"plt.xlabel('Power of Arm 2')\n",
|
||
|
"plt.ylabel('Axial TF (Hz)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"\n",
|
||
|
"tf_x = [303.5930, 286.0152, 272.6675, 253.6669, 238.8665, 232.4375, 224.9906, 218.7975, 210.9468, 196.7401, 180.0950]\n",
|
||
|
"dtf_x = [6.9704, 2.5433, 0.6739, 0.5183, 0.3901, 0.3994, 0.4995, 0.3777, 0.3864, 0.3636, 0.4790]\n",
|
||
|
"trunc = [0.5, 0.55, 0.6, 0.65, 0.7, 0.725, 0.75, 0.775, 0.8, 0.85, 0.9]\n",
|
||
|
" \n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.errorbar(p_1, tf_x, yerr = dtf_x, fmt = 'og')\n",
|
||
|
"plt.xlabel('Power of Arm 1')\n",
|
||
|
"plt.ylabel('Horz TF (Hz)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 17,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"v_x = 27451.697 Hz\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"from astropy import units as u, constants as ac\n",
|
||
|
"\n",
|
||
|
"DY_POLARIZABILITY = 184.4 # in a.u, most precise measured value of Dy polarizability\n",
|
||
|
"DY_MASS = 164*u.u\n",
|
||
|
"\n",
|
||
|
"def horz_tf(x, w_x, w_z):\n",
|
||
|
" w_x = w_x*u.um\n",
|
||
|
" w_z = w_z*u.um\n",
|
||
|
" x = x * u.W\n",
|
||
|
" alpha = DY_POLARIZABILITY\n",
|
||
|
" m = DY_MASS\n",
|
||
|
" TrapDepth = 2*x/(np.pi*w_x*w_z) * (1 / (2 * ac.eps0 * ac.c)) * alpha * (4 * np.pi * ac.eps0 * ac.a0**3)\n",
|
||
|
" ret = ((1/(2 * np.pi)) * np.sqrt(4 * TrapDepth / (m*w_x**2))).decompose()\n",
|
||
|
" return ret.value\n",
|
||
|
" \n",
|
||
|
"def vert_tf(x, w_x, w_z):\n",
|
||
|
" w_x = w_x*u.um\n",
|
||
|
" w_z = w_z*u.um\n",
|
||
|
" x = x * u.W\n",
|
||
|
" alpha = DY_POLARIZABILITY\n",
|
||
|
" m = DY_MASS\n",
|
||
|
" TrapDepth = 2*x/(np.pi*w_x*w_z) * (1 / (2 * ac.eps0 * ac.c)) * alpha * (4 * np.pi * ac.eps0 * ac.a0**3)\n",
|
||
|
" ret = ((1/(2 * np.pi)) * np.sqrt(4 * TrapDepth / (m*w_z**2))).decompose()\n",
|
||
|
" return ret.value\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"v = horz_tf(30, 30, 0.2)\n",
|
||
|
"print('v_x = %.3f Hz' %(v))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 42,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
"<h2> Model</h2> Model(horz_tf) <h2>Fit Statistics</h2><table><tr><td>fitting method</td><td>leastsq</td><td></td></tr><tr><td># function evals</td><td>26</td><td></td></tr><tr><td># data points</td><td>9</td><td></td></tr><tr><td># variables</td><td>2</td><td></td></tr><tr><td>chi-square</td><td> 79.9011718</td><td></td></tr><tr><td>reduced chi-square</td><td> 11.4144531</td><td></td></tr><tr><td>Akaike info crit.</td><td> 23.6520935</td><td></td></tr><tr><td>Bayesian info crit.</td><td> 24.0465426</td><td></td></tr></table><h2>Variables</h2><table><tr><th> name </th><th> value </th><th> standard error </th><th> relative error </th><th> initial value </th><th> min </th><th> max </th><th> vary </th></tr><tr><td> w_x </td><td> 24.1519450 </td><td> 292150.064 </td><td> (1209633.69%) </td><td> 25 </td><td> 0.00000000 </td><td> 100.000000 </td><td> True </td></tr><tr><td> w_z </td><td> 52.4613985 </td><td> 1903772.36 </td><td> (3628901.28%) </td><td> 35 </td><td> 0.00000000 </td><td> 100.000000 </td><td> True </td></tr></table><h2>Correlations (unreported correlations are < 0.100)</h2><table><tr><td>w_x</td><td>w_z</td><td>-1.0000</td></tr></table>"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<lmfit.model.ModelResult at 0x1b68d072d60>"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 42,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm8AAAHPCAYAAAAFwj37AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABjnklEQVR4nO3dfXzO9f///9uxmWNONmzIbISUbU56i0RRzs1J0ZLSmSakyJbIyYZNM50gcxIpjUrFm1GkOfdpnay3Nyl+VAphJszJFjbHttfvD1/H29GGbce2Y8d2v14uu1w6nq/n63k8Xg+v6eH5er2eL5NhGAYiIiIi4hRcHB2AiIiIiOSfijcRERERJ6LiTURERMSJqHgTERERcSIq3kRERESciIo3ERERESei4k1ERETEiVRwdAClWU5ODsePH8fDwwOTyeTocERERKQMMwyD9PR06tati4vL9efXVLzdwPHjx6lXr56jwxAREZFy5OjRo/j5+V13u4q3G/Dw8ACuJNHT07PQ41gsFjZu3Ej37t1xc3MrqvDKHeXRfsqh/ZRD+ymHRUN5tF9py2FaWhr16tWz1h/Xo+LtBq5eKvX09LS7eKtcuTKenp6l4uRwVsqj/ZRD+ymH9lMOi4byaL/SmsOb3aqlBxZEREREnIiKNxEREREnouJNRERExImoeBMRERFxIireRERERJyIijcRERERJ6LiTURERMSJqHgTERERcSIq3kRERESciIo3ERERESei4k1ERETEiah4ExEREXEiKt5EREREnIiKNxEREREnouJNRERExImoeBMRERG5gQuXL2CKMmGKMnHh8gVHh6PiTURERMSZqHgTERERcSIq3kRERESciIo3ERERESei4k1ERETEiah4ExEREXEiKt5EREREnIiKNxEREREnouJNRERExImoeBMRERFxIireRERERJyIijcRERERJ6LiTURERMSJqHgTERERuYGs7Cz4FciCr//8muycbIfGo+JNRERE5DoiP4ikVpNa8CmwC3p90osGsQ2I3x/vsJhUvImIiIj8w3/+8x9atGtB1HNRWI5awA3IurItOS2Z/iv6O6yAU/EmIiIi8v/s27eP4OBg7rnnHvYk7QFX4B4gFLj3Sh8DA4CwhDCHXEJV8SYiIiLy/4wdO5bVq1fj4uIC/wJeAnoCVW37GRgcTTtK4pHEEo+xQol/o4iIiEgpce7cOU6fPo2Pjw8A0dHRmM1m2j3Tjld/evWm+6ekpxR3iLlo5k1ERETKnfPnzzNlyhSGDx9OdHS0tb1ly5bEx8dz97/uztc4Ph4+xRXidWnmTURERMqNS5cuMW/ePF5//XXOnDkDwO7du8nOzsbV1dXar0P9Dvh5+pGclmy9x+1aJkz4efrRoX6HEov9Ks28iYiISJlnsVh49913ady4Ma+++ipnzpzB39+fcePGsW3bNpvCDcDVxZXYoFjgSqF2raufZwfNxtXFdr+SoOJNREREyryYmBiGDx/O8ePHqV+/PkuWLOHHH3+kXbt2mEymPPcJDghm5YCV1PWoa9Pu5+nHygErCQ4ILonQc3F48bZ792569+5N/fr1qVSpEl5eXrRr146PP/44V99du3bRtWtXqlatSvXq1QkODubgwYN5jjt37lz8/f0xm800bNiQqKgoLBZLcR+OiIiIlAKGYZCWlmb9/MILL9CoUSNiY2P57bffGDRoUK7ZtrwEBwSz78V91s/rn1jPodBDDivcoBTc83bu3Dnq1avHwIED8fX15cKFCyxbtoynn36aw4cPExERAcAvv/xCx44d+de//sWKFSvIyMhg8uTJdOjQgd27d1OrVi3rmNOmTWPSpEmMHz+e7t27s2PHDiIiIkhOTmbRokWOOlQREREpAYmJiUycOBF3d3c2bdoEQO3atTlw4MCVJUAK6NpLo/ffer9DLpVey+HFW8eOHenYsaNNW58+fTh06BCLFi2yFm+TJ0/GbDazbt06PD09AWjVqhW33347M2bM4I033gAgNTWV6Ohohg4dSkxMjPU7LBYLERERhIWFERgYWHIHKCIiIiVi9+7dTJw4ka+++goAd3d3Dh48SKNGjQAKVbiVRqX2KGrWrEmFCldqy6ysLNatW8cjjzxiLdwAbr31Vjp16sTq1autbQkJCWRkZBASEmIzXkhICIZhsGbNmhKJX0RERErGgQMHePzxx2nZsiVfffUVrq6uPP/88/z+++/Wwq0scfjM21U5OTnk5ORw9uxZ/v3vf7NhwwbmzZsHwB9//MGlS5do0aJFrv1atGjBpk2byMjIwN3dnb179wLQvHlzm34+Pj7UrFnTuj0vmZmZZGZmWj9fvVZusVjsul/u6r66584+yqP9lEP7KYf2Uw6L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aERcXx9KlSzl37hxVq1blzjvv5KOPPuKpp56y9vP392f79u2MGzeO/v37U6FCBTp37syMGTNs3q4AEB4ejoeHB/Pnz2fGjBnUqVOH8ePHEx4eXtKHJyIiIvnwn//8h+joaN5//33rPWzvvfce1apVs97XLlc4vHgLCQnJtaDu9bRq1YrNmzfnq++oUaMYNWqUPaGJiIhIMdu3bx8RERHWBfenT5/O22+/DVxZjF9yc3jxJiIiIuXP4cOHiYyM5KOPPiInJwcXFxeefvppQkNDHR1aqafiTURERErU2LFjiY2Ntb5R4OGHHyY6Olr3peeTijcREREpUZmZmVgsFrp06UJMTAxt2rRxdEg3VKViFYwphqPDsCq/z9mKiIhIsbt06RJvvfUWP/74o7UtPDycTZs2sXnz5lJfuJVGmnkTERGRImexWIiLi2Pq1KkkJycTFBTEV199BcAtt9zCLbfc4uAInZeKNxERESkyOTk5rFixgkmTJvH7778DV16B+dhjj9m8UF4KT8WbiIiIFIktW7YwZswYdu/eDUCtWrWIiIjg+eefz/Pd4VI4Kt5ERESkSPzyyy/s3r0bT09
|
||
|
"text/plain": [
|
||
|
"<Figure size 640x480 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"from lmfit import Model\n",
|
||
|
"\n",
|
||
|
"fitModel = Model(horz_tf, independent_vars=['x'], param_names=['w_x', 'w_z'], nan_policy='raise')\n",
|
||
|
"params = fitModel.make_params()\n",
|
||
|
"params['w_x'].set(value=25, min=0, max=100)\n",
|
||
|
"params['w_z'].set(value=35, min=0, max=100)\n",
|
||
|
"fitResult = fitModel.fit(data=np.array(tf_z[:-2]), params=params, x=np.array(p_1[:-2]))\n",
|
||
|
"\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.errorbar(p_1, tf_x, yerr = dtf_x, fmt = 'og')\n",
|
||
|
"plt.errorbar(p_1[:-2], fitResult.best_fit, fmt = 'k--')\n",
|
||
|
"plt.xlabel('Power of Arm 1')\n",
|
||
|
"plt.ylabel('Horz TF (Hz)')\n",
|
||
|
"plt.tight_layout()\n",
|
||
|
"plt.grid(visible=1)\n",
|
||
|
"\n",
|
||
|
"fitResult"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 68,
|
||
|
"metadata": {
|
||
|
"scrolled": true
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"[0.005, 0.0057, 0.0064, 0.0071, 0.0078, 0.0085, 0.0092, 0.0099, 0.0106, 0.0113, 0.012, 0.0127, 0.0134, 0.0141, 0.0148, 0.0155, 0.0162, 0.0169, 0.0176, 0.0183, 0.019, 0.0197]\n",
|
||
|
"22\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"data": {
|
||
|
"text/plain": [
|
||
|
"0.01235"
|
||
|
]
|
||
|
},
|
||
|
"execution_count": 68,
|
||
|
"metadata": {},
|
||
|
"output_type": "execute_result"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"l = list(np.arange(0.005, 0.02, 7e-4))\n",
|
||
|
"# l = np.logspace(np.log10(250e-6), np.log10(500e-3), num=15)\n",
|
||
|
"\n",
|
||
|
"l = [round(item, 7) for item in l]\n",
|
||
|
"#random.shuffle(l)\n",
|
||
|
"\n",
|
||
|
"print(l)\n",
|
||
|
"print(len(l))\n",
|
||
|
"np.mean(l)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"pixel = 5.86e-6\n",
|
||
|
"M = 0.6827\n",
|
||
|
"F = (1/(0.3725*8.4743e-14)) * (pixel / M)**2\n",
|
||
|
"NCount = 85000\n",
|
||
|
"AtomNumber = NCount * F / 1e8\n",
|
||
|
"print(AtomNumber)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"muB = 9.274e-24\n",
|
||
|
"hbar = 6.626e-34 / (2 * np.pi)\n",
|
||
|
"gJ = 1.24\n",
|
||
|
"\n",
|
||
|
"f = ufloat(10108.46982, 0.26282) \n",
|
||
|
"Delta = 2 * np.pi * f * 1e3\n",
|
||
|
"\n",
|
||
|
"Bz = (Delta*hbar) / (muB*gJ)\n",
|
||
|
"print(Bz * 1e4)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"muB = 9.274e-24\n",
|
||
|
"hbar = 6.626e-34 / (2 * np.pi)\n",
|
||
|
"gJ = 1.24\n",
|
||
|
"Bz = 5.8854 * 1e-4\n",
|
||
|
"(Bz*muB*gJ/hbar) / (2 * np.pi * 1e6)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## ODT 1 Calibration"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"v_high = 2.7\n",
|
||
|
"\"\"\"High Power\"\"\"\n",
|
||
|
"P_arm1_high = 5.776 * v_high - 0.683\n",
|
||
|
"\n",
|
||
|
"v_mid = 0.2076\n",
|
||
|
"\"\"\"Intermediate Power\"\"\"\n",
|
||
|
"P_arm1_mid = 5.815 * v_mid - 0.03651\n",
|
||
|
"\n",
|
||
|
"v_low = 0.062\n",
|
||
|
"\"\"\"Low Power\"\"\"\n",
|
||
|
"P_arm1_low = 5271 * v_low - 27.5\n",
|
||
|
"\n",
|
||
|
"print(round(P_arm1_high, 3))\n",
|
||
|
"print(round(P_arm1_mid, 3))\n",
|
||
|
"print(round(P_arm1_low, 3))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"## ODT 2 Power Calibration"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"v = 0.842\n",
|
||
|
"P_arm2 = 2.302 * v - 0.06452\n",
|
||
|
"print(round(P_arm2, 3))"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3 (ipykernel)",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.9.12"
|
||
|
},
|
||
|
"vscode": {
|
||
|
"interpreter": {
|
||
|
"hash": "c05913ad4f24fdc6b2418069394dc5835b1981849b107c9ba6df693aafd66650"
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|