2023-05-24 16:54:29 +02:00
{
"cells": [
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 1,
2023-05-24 16:54:29 +02:00
"metadata": {},
"outputs": [],
"source": [
2023-05-24 19:59:04 +02:00
"import pymongo\n",
2023-05-25 19:11:19 +02:00
"import xarray_mongodb\n",
"import bson\n",
"import datetime\n",
"\n",
"# datetime.datetime.utcnow()"
2023-05-24 16:54:29 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 2,
2023-05-24 16:54:29 +02:00
"metadata": {},
"outputs": [],
"source": [
"mongoClient = pymongo.MongoClient()\n",
"mongoDB = mongoClient.testDB\n",
"mongoCollection = mongoDB.testCollection"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 3,
2023-05-24 16:54:29 +02:00
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Task executing\n",
"\n",
"Task2 executing \n",
"\n",
"Task2 done\n",
"\n",
2023-06-02 18:42:18 +02:00
"Task done\n",
2023-05-24 16:54:29 +02:00
"\n"
]
}
],
"source": [
"from time import sleep\n",
"from multiprocessing.pool import ThreadPool\n",
" \n",
"# task executed in a worker thread\n",
"def task():\n",
" # report a message\n",
" print(f'Task executing\\n')\n",
" # block for a moment\n",
" sleep(1)\n",
" # report a message\n",
" print(f'Task done\\n')\n",
" \n",
"def task2():\n",
" # report a message\n",
" print(f'Task2 executing \\n')\n",
" # block for a moment\n",
" sleep(1)\n",
" # report a message\n",
" print(f'Task2 done\\n')\n",
" \n",
"# protect the entry point\n",
"if __name__ == '__main__':\n",
" # create and configure the thread pool\n",
" pool = ThreadPool()\n",
" # issue tasks to the thread pool\n",
" pool.apply_async(task)\n",
" pool.apply_async(task2)\n",
" # close the thread pool\n",
" pool.close()\n",
" # wait for all tasks to finish\n",
" pool.join()"
]
},
2023-05-24 19:59:04 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 4,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"import pandas as pd\n",
"import numpy as np\n",
"import copy\n",
"\n",
"import glob\n",
"\n",
"import xrft\n",
"import finufft\n",
"\n",
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
"from datetime import datetime\n",
"\n",
"import matplotlib.pyplot as plt\n",
"plt.rcParams['font.size'] = 18\n",
"\n",
"from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
"from Analyser.ImagingAnalyser import ImageAnalyser\n",
"from Analyser.FitAnalyser import FitAnalyser\n",
"from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
"from Analyser.FFTAnalyser import fft, ifft, fft_nutou\n",
"from ToolFunction.ToolFunction import *\n",
"\n",
"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()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 5,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"import numpy as np\n",
"\n",
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
"import matplotlib.pyplot as plt\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 ThomasFermi2dModel, DensityProfileBEC2dModel, Polylog22dModel\n",
"from Analyser.FitAnalyser import NewFitModel\n",
"from ToolFunction.ToolFunction import *\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()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Start a client for parallel computing"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 6,
2023-05-24 19:59:04 +02:00
"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",
2023-06-02 18:42:18 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-670b276f-0163-11ee-8f20-80e82ce2fa8e</p>\n",
2023-05-24 19:59:04 +02:00
" <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",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">fa22423a</p>\n",
2023-05-24 19:59:04 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 55.88 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",
2023-06-02 18:42:18 +02:00
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-5a5d5979-7705-46e0-bcc3-fb8c8f4136a4</p>\n",
2023-05-24 19:59:04 +02:00
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Comm:</strong> tcp://127.0.0.1:58048\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 6\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 60\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> 55.88 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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58078\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58079/status\" target=\"_blank\">http://127.0.0.1:58079/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58051\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-g8airt01\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58084\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58086/status\" target=\"_blank\">http://127.0.0.1:58086/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58052\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-z63mxe89\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58085\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58088/status\" target=\"_blank\">http://127.0.0.1:58088/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58053\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-zagh_ulq\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58081\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58082/status\" target=\"_blank\">http://127.0.0.1:58082/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58054\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-apiffwwt\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58090\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58091/status\" target=\"_blank\">http://127.0.0.1:58091/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58055\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-yfgb0h3_\n",
2023-05-24 19:59:04 +02:00
" </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",
2023-06-02 18:42:18 +02:00
" <strong>Comm: </strong> tcp://127.0.0.1:58071\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 10\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:58076/status\" target=\"_blank\">http://127.0.0.1:58076/status</a>\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 9.31 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Nanny: </strong> tcp://127.0.0.1:58056\n",
2023-05-24 19:59:04 +02:00
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
2023-06-02 18:42:18 +02:00
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-8p9rq6as\n",
2023-05-24 19:59:04 +02:00
" </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": [
2023-06-02 18:42:18 +02:00
"<Client: 'tcp://127.0.0.1:58048' processes=6 threads=60, memory=55.88 GiB>"
2023-05-24 19:59:04 +02:00
]
},
2023-06-02 18:42:18 +02:00
"execution_count": 6,
2023-05-24 19:59:04 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from dask.distributed import Client\n",
"client = Client(n_workers=6, threads_per_worker=10, processes=True, memory_limit='10GB')\n",
"client"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Set global path for experiment"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 7,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [],
"source": [
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/03/0043/*.h5\"\n",
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/2023-04-18_0003_Evaporative_Cooling_000.h5\"\n",
"\n",
"# filepath = \"//DyLabNAS/Data/Repetition_scan/2023/04/21/0002/*.h5\"\n",
"\n",
"# filepath = r\"./testData/0002/*.h5\"\n",
"\n",
"# filepath = r\"./testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5\"\n",
"\n",
"# filepath = r'd:/Jianshun Gao/Simulations/analyseScripts/testData/0002/2023-04-21_0002_Evaporative_Cooling_0.h5'\n",
"\n",
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/04/18/0003/*.h5\"\n",
"\n",
"# filepath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/04/0000/*.h5\"\n",
"\n",
"filepath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_08.h5'"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 8,
2023-05-24 19:59:04 +02:00
"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_1\",\n",
" \"images/ODT_1_Axis_Camera/in_situ_absorption\": \"camera_2\",\n",
" \"images/ODT_2_Axis_Camera/in_situ_absorption\": \"camera_3\",\n",
"}\n"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 9,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [],
"source": [
"img_dir = '//DyLabNAS/Data/'\n",
"SequenceName = \"Evaporative_Cooling\" + \"/\"\n",
"folderPath = img_dir + SequenceName + '2023/05/23'# get_date()"
]
},
2023-06-02 18:42:18 +02:00
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# An example for one experimental run"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load the data"
]
},
2023-05-24 19:59:04 +02:00
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 10,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [
2023-06-02 18:42:18 +02:00
{
"name": "stderr",
"output_type": "stream",
"text": [
"f:\\Jianshun\\analyseScript\\DataContainer\\ReadData.py:178: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n",
" if not key in datesetOfGlobal.scanAxis\n"
]
},
2023-05-24 19:59:04 +02:00
{
"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.Dataset>\n",
2023-06-02 18:42:18 +02:00
"Dimensions: (y: 1200, x: 1920)\n",
"Dimensions without coordinates: y, x\n",
2023-05-24 19:59:04 +02:00
"Data variables:\n",
2023-06-02 18:42:18 +02:00
" atoms (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" background (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" dark (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" shotNum <U2 '08'\n",
" OD (y, x) float64 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
" blink_off_time: nan\n",
" blink_on_time: nan\n",
" ... ...\n",
" y_offset: 0\n",
" y_offset_img: 0\n",
" z_offset: 0.189\n",
" z_offset_img: 0.189\n",
" scanAxis: []\n",
" scanAxisLength: []</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-7c3f2d40-e819-4671-aa5c-2d8465a68870' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-7c3f2d40-e819-4671-aa5c-2d8465a68870' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>y</span>: 1200</li><li><span>x</span>: 1920</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-c2a30dd0-35b9-4831-99e1-201635d02bf1' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c2a30dd0-35b9-4831-99e1-201635d02bf1' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-5545194b-e47c-44ac-9fca-98005c8c9c52' class='xr-section-summary-in' type='checkbox' checked><label for='section-5545194b-e47c-44ac-9fca-98005c8c9c52' class='xr-section-summary' >Data variables: <span>(5)</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>atoms</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-bcf8ca0e-2884-41d8-9c51-8ac7605337ab' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-bcf8ca0e-2884-41d8-9c51-8ac7605337ab' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-518f1e1a-3476-46ba-8a67-34c898daa8ea' class='xr-var-data-in' type='checkbox'><label for='data-518f1e1a-3476-46ba-8a67-34c898daa8ea' 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'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>background</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-cc03aca9-7ad2-4683-8673-b5e20e017877' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-cc03aca9-7ad2-4683-8673-b5e20e017877' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-035f9dd5-5eea-409d-91dc-d32b2bf0b544' class='xr-var-data-in' type='checkbox'><label for='data-035f9dd5-5eea-409d-91dc-d32b2bf0b544' 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'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dark</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>uint16</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-41bb60c9-889d-4ec8-b1f2-1c846cf84663' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-41bb60c9-889d-4ec8-b1f2-1c846cf84663' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-43106166-b479-44c6-87a1-6ad8287b8a1b' class='xr-var-data-in' type='checkbox'><label for='data-43106166-b479-44c6-87a1-6ad8287b8a1b' 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'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 4.39 MiB </td>\n",
" <td> 4.39 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> uint16 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shotNum</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'><U2</div><div class='xr-var-preview xr-preview'>'08'</div><input id='attrs-15a92efb-3692-4b3f-ab17-f9dfa21ebace' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-15a92efb-3692-4b3f-ab17-f9dfa21ebace' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1311bf1c-a319-4dad-bd5f-a0c75914374f' class='xr-var-data-in' type='checkbox'><label for='data-1311bf1c-a319-4dad-bd5f-a0c75914374f' 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('08', dtype='<U2')</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>OD</span></div><div class='xr-var-dims'>(y, x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1200, 1920), meta=np.ndarray></div><input id='attrs-de9c899e-320d-45cd-b4f8-ba6a09f16882' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-de9c899e-320d-45cd-b4f8-ba6a09f16882' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-88dba7c1-2862-4f62-b469-429edf0f5343' class='xr-var-data-in' type='checkbox'><label for='data-88dba7c1-2862-4f62-b469-429edf0f5343' 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'><dt><span>IMAGE_SUBCLASS :</span></dt><dd>IMAGE_GRAYSCALE</dd><dt><span>IMAGE_VERSION :</span></dt><dd>1.2</dd><dt><span>IMAGE_WHITE_IS_ZERO :</span></dt><dd>0</dd></dl></div><div class='xr-var-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 17.58 MiB </td>\n",
" <td> 17.58 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1200, 1920) </td>\n",
" <td> (1200, 1920) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 1 chunks in 16 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"170\" height=\"125\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"120\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"75\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"75\" style=\"stroke-width:2\" />\n",
" <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"75\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.0,0.0 120.0,0.0 120.0,75.0 0.0,75.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"60.000000\" y=\"95.000000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1920</text>\n",
" <text x=\"140.000000\" y=\"37.500000\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,140.000000,37.500000)\">1200</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-fd12b0b0-61bb-496d-94c2-afb7768f8f01' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-fd12b0b0-61bb-496d-94c2-afb7768f8f01' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-8a174b49-ec2e-400a-9a4d-242ffe4cdeb2' class='xr-section-summary-in' type='checkbox' ><label for='section-8a174b49-ec2e-400a-9a4d-242ffe4cdeb2' class='xr-section-summary' >Attributes: <span>(96)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>TOF_free :</span></dt><dd>0.02</dd><dt><span>abs_img_freq :</span></dt><dd>110.858</dd><dt><span>absorption_imaging_flag :</span></dt><dd>True</dd><dt><span>backup_data :</span></dt><dd>True</dd><dt><span>blink_off_time :</span></dt><dd>nan</dd><dt><span>blink_on_time :</span></dt><dd>nan</dd><dt><span>c_duration :</span></dt><dd>0.2</dd><dt><span>cmot_final_current :</span></dt><dd>0.65</dd><dt><span>cmot_hold :</span></dt><dd>0.06</dd><dt><span>cmot_initial_current :</span></dt><dd>0.18</dd><dt><span>compX_current :</span></dt><dd>0.005</dd><dt><span>compX_current_sg :</span></dt><dd>0</dd><dt><span>compX_final_current :</span></dt><dd>0.005</dd><dt><span>compX_initial_current :</span></dt><dd>0.005</dd><dt><span>compY_current :</span></dt><dd>0</dd><dt><span>compY_current_sg :</span></dt><dd>0</dd><dt><span>compY_final_current :</span></dt><dd>0.0</dd><dt><span>compY_initial_current :</span></dt><dd>0</dd><dt><span>compZ_current :</span></dt><dd>0</dd><dt><span>compZ_current_sg :</span></dt><dd>0.189</dd><dt><span>compZ_final_current :</span></dt><dd>0.2812</dd><dt><span>compZ_initial_current :</span></dt><dd>0</dd><dt><span>default_camera :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_final_pow :</span></dt><dd>0.35</dd><dt><span>evap_1_arm_1_mod_depth_final :</span></dt><dd>0</dd><dt><span>evap_1_arm_1_mod_depth_initial :</span></dt><dd>1.0</dd><dt><span>evap_1_arm_1_mod_ramp_duration :</span></dt><dd>1.15</dd><dt><span>evap_1_arm_1_pow_ramp_duration :</span></dt><dd>1.65</dd><dt><span>evap_1_arm_1_start_pow :</span></dt><dd>7</dd><dt><span>evap_1_arm_2_final_pow :</span></dt><dd>5</dd><dt><span>evap_1_arm_2_ramp_duration :</span></dt><dd>0.5</dd><dt><span>evap_1_arm_2_start_pow :</span></dt><dd>0</dd><dt><span>evap_1_mod_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_1_pow_ramp_trunc_value :</span></dt><dd>1.0</dd><dt><span>evap_1_rate_constant_1 :</span></dt><dd>0.525</dd><dt><span>evap_1_rate_constant_2 :</span></dt><dd>0.51</dd><dt><span>evap_2_arm_1_final_pow :</span></dt><dd>0.037</dd><dt><span>evap_2_arm_1_start_pow :</span></dt><dd>0.35</dd><dt><span>evap_2_arm_2_final_pow :</span></dt><dd>0.09</dd><dt><span>evap_2_arm_2_start_pow :</span></dt><dd>5</dd><dt><span>evap_2_ramp_duration :</span></dt><dd>1.0</dd><dt><span>evap_2_ramp_trunc_value :</span></dt><dd>0.7</dd><dt><span>evap_2_rate_constant_1 :</span></dt><dd>0.37</dd><dt><span>evap_2_rate_constant_2 :</span></dt><dd>0.71</dd><dt><span>evap_3_arm_1_final_pow :</span></dt><dd>0.1038</dd><dt><span>evap_3_arm_1_mod_depth_final :</span></dt><dd>0.43</dd><dt><span>evap_3_arm_1_mod_depth_initial :</span></dt><dd>0</dd><dt><span>evap_3_arm_1_start_pow :</span></dt><dd>0.037</dd><dt><span>evap_3_ramp_duration :</span></dt><dd>0.1</dd><dt><span>evap_3_ramp_trunc_value :</span></dt><dd>1</dd><dt><span>evap_3_rate_constant_1 :</span></dt><dd>-0.879</dd><dt><span>evap_3_rate_constant_2 :</span></dt><dd>-0.297</dd><dt><span>final_amp :</span></dt><dd>8e-05</dd><dt><span>final_freq :</span></dt><dd>104.0</dd><dt><span>gradCoil_current :</span></dt><dd>0.18</dd><dt><span>gradCoil_current_sg :</span></dt><dd>0</dd><dt><span>imaging_method :</span></dt><dd>in_situ_absorption</dd><dt><span>imaging_pulse_duration :</span></dt><dd>2.5e-05</dd><dt><span>imaging_wav
2023-05-24 19:59:04 +02:00
],
"text/plain": [
"<xarray.Dataset>\n",
2023-06-02 18:42:18 +02:00
"Dimensions: (y: 1200, x: 1920)\n",
"Dimensions without coordinates: y, x\n",
2023-05-24 19:59:04 +02:00
"Data variables:\n",
2023-06-02 18:42:18 +02:00
" atoms (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" background (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" dark (y, x) uint16 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
" shotNum <U2 '08'\n",
" OD (y, x) float64 dask.array<chunksize=(1200, 1920), meta=np.ndarray>\n",
"Attributes: (12/96)\n",
" TOF_free: 0.02\n",
" abs_img_freq: 110.858\n",
" absorption_imaging_flag: True\n",
" backup_data: True\n",
" blink_off_time: nan\n",
" blink_on_time: nan\n",
" ... ...\n",
" y_offset: 0\n",
" y_offset_img: 0\n",
" z_offset: 0.189\n",
" z_offset_img: 0.189\n",
" scanAxis: []\n",
" scanAxisLength: []"
2023-05-25 19:11:19 +02:00
]
},
2023-06-02 18:42:18 +02:00
"execution_count": 10,
2023-05-25 19:11:19 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2023-06-02 18:42:18 +02:00
"shotNum = \"0069\"\n",
"filePath = folderPath + \"/\" + shotNum + \"/*.h5\"\n",
"# filePath = \"//DyLabNAS/Data/Evaporative_Cooling/2023/05/12/0065/*.h5\"\n",
"filePath = './result_from_experiment/2023-04-24/0013/2023-04-24_0013_Evaporative_Cooling_08.h5'\n",
"\n",
"dataSetDict = {\n",
" dskey[groupList[i]]: read_hdf5_file(filePath, groupList[i])\n",
" for i in [0] # range(len(groupList))\n",
"}\n",
"\n",
"dataSet = dataSetDict[\"camera_1\"]\n",
"dataSet = swap_xy(dataSet)\n",
"\n",
"scanAxis = get_scanAxis(dataSet)\n",
"\n",
"dataSet = auto_rechunk(dataSet)\n",
"\n",
"dataSet = imageAnalyser.get_absorption_images(dataSet)\n",
"\n",
"dataSet"
2023-05-25 19:11:19 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 11,
2023-05-25 19:11:19 +02:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2023-06-02 18:42:18 +02:00
"['atoms', 'background', 'dark', 'shotNum', 'OD']"
2023-05-24 19:59:04 +02:00
]
},
2023-06-02 18:42:18 +02:00
"execution_count": 11,
2023-05-24 19:59:04 +02:00
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-25 19:11:19 +02:00
"source": [
2023-06-02 18:42:18 +02:00
"list(dataSet.data_vars)"
2023-05-25 19:11:19 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 32,
2023-05-25 19:11:19 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"text/plain": [
"{'IMAGE_SUBCLASS': 'IMAGE_GRAYSCALE',\n",
" 'IMAGE_VERSION': '1.2',\n",
" 'IMAGE_WHITE_IS_ZERO': 0,\n",
" 'x_start': 810,\n",
" 'x_end': 1110,\n",
" 'y_end': 1025,\n",
" 'y_start': 725,\n",
" 'x_center': 960,\n",
" 'y_center': 875,\n",
" 'x_span': 300,\n",
" 'y_span': 300}"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-24 19:59:04 +02:00
"source": [
2023-06-02 18:42:18 +02:00
"dataSet.OD.attrs"
2023-05-24 19:59:04 +02:00
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculate an plot OD images"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 13,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnIAAAHECAYAAAC9VcdgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG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tB8kHGOXeb38w1wExmrRCEOmfq4CjaEiSWQjZkGoHK/YjxlWQBFgFxBgfgEU5YABidAiMHQRrtsCTOsBfvgVoImqo2mHwB2DNJt1uz+jZJxaScJJhhv6fd4Tza4He3v2O8HyF5AGXJC0+DfxAf/+BJGAe69TMqFBfV0A9W59pzkuwpAfULfGOaUaYHsgHL54M1GtsSwMKdcSAT0FWkR7f3oD0BzMmD5lQA9Am1nd8VjsEHJOJp0ZrrI/Kv+Jqsdtq95m/Cri/Dm7areWzoXu3JPDq54IxYxx01XHh6TZ4uhiu6KCPJwCItmPEWuaCcovWrYqOWddwMeNLLTGwBxgIbIuLPR0cBvbZu7b7aZ0XOrguF4BQr3+vdmJG2rwAlkyVbXXBMQCMkwUFwJol0L3Oa1d/kQr5bTadvLEyb6ENHbNr02BjDxjeqOW1QDlMqpfiwzmY6WLT6EP+YvsQ8PkMyGUSSQbkTrHEjNw3kM9mJ3kTQKWThVo0liiT1eyr5HwJVv4grM/T+nuDMT82YQRqShu4okkQGbse0d024I3V/WtWAbvh8Xq4ygac6VDZDZpapDi4L2zVuoMAj+UNFF5Zv0OpdbAsHOAhmij5hf4PBvRiBz31967kQHxh+3ieL+rOGS+KncrbF8wNbloOVMLOS7R4Z7A/VEvaBNEBO2HSR59jVwhmpyGgy0CEqcBXefuDd1/
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-05-24 19:59:04 +02:00
"source": [
"# imageAnalyser.center = (960, 1040)\n",
"# imageAnalyser.span = (100, 100)\n",
"# imageAnalyser.fraction = (0.1, 0.1)\n",
"\n",
"imageAnalyser.center = (960, 875)\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",
"dataSet_cropOD.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Do a 2D two-peak gaussian fit to the OD images"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Do the fit"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 14,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"f:\\Jianshun\\analyseScript\\Analyser\\FitAnalyser.py:84: RuntimeWarning: invalid value encountered in power\n",
" res = (1- ((x-centerx)/(sigmax))**2 - ((y-centery)/(sigmay))**2)**(3 / 2)\n"
]
}
],
2023-05-24 19:59:04 +02:00
"source": [
"from Analyser.FitAnalyser import ThomasFermi2dModel, DensityProfileBEC2dModel, polylog2_2d\n",
"\n",
"fitModel = DensityProfileBEC2dModel()\n",
"# fitModel = ThomasFermi2dModel()\n",
"\n",
"fitAnalyser = FitAnalyser(fitModel, fitDim=2)\n",
"\n",
"# fitAnalyser = FitAnalyser(\"Gaussian-2D\", fitDim=2)\n",
"\n",
"# dataSet_cropOD = dataSet_cropOD.chunk((1,1,100,100))\n",
"\n",
"params = fitAnalyser.guess(dataSet_cropOD, guess_kwargs=dict(pureBECThreshold=0.3), dask=\"parallelized\")\n",
"fitResult = fitAnalyser.fit(dataSet_cropOD, params).load()"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 15,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"text/html": [
"<table><tr><th> name </th><th> value </th><th> initial value </th><th> min </th><th> max </th><th> vary </th><th> expression </th></tr><tr><td> BEC_amplitude </td><td> 0.00000000 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_amplitude </td><td> 3073.52821 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centerx </td><td> 146.943010 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centery </td><td> 147.472246 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centerx </td><td> 120.557038 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centery </td><td> 179.364624 </td><td> None </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmax </td><td> 17.1554887 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmay </td><td> 18.3156015 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmax </td><td> 71.8465440 </td><td> None </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmay </td><td> 86.2158528 </td><td> None </td><td> -inf </td><td> inf </td><td> False </td><td> thermalAspectRatio * thermal_sigmax </td></tr><tr><td> thermalAspectRatio </td><td> 1.20000000 </td><td> None </td><td> 0.80000000 </td><td> 1.20000000 </td><td> True </td><td> </td></tr><tr><td> condensate_fraction </td><td> 0.00000000 </td><td> None </td><td> -inf </td><td> inf </td><td> False </td><td> BEC_amplitude / (BEC_amplitude + thermal_amplitude) </td></tr></table>"
],
"text/plain": [
"Parameters([('BEC_amplitude', <Parameter 'BEC_amplitude', value=0, bounds=[0:inf]>), ('thermal_amplitude', <Parameter 'thermal_amplitude', value=3073.528205527723, bounds=[0:inf]>), ('BEC_centerx', <Parameter 'BEC_centerx', value=146.94301032591366, bounds=[-inf:inf]>), ('BEC_centery', <Parameter 'BEC_centery', value=147.47224593536436, bounds=[-inf:inf]>), ('thermal_centerx', <Parameter 'thermal_centerx', value=120.55703835420424, bounds=[-inf:inf]>), ('thermal_centery', <Parameter 'thermal_centery', value=179.3646237177809, bounds=[-inf:inf]>), ('BEC_sigmax', <Parameter 'BEC_sigmax', value=17.155488681677085, bounds=[0:inf]>), ('BEC_sigmay', <Parameter 'BEC_sigmay', value=18.315601451967396, bounds=[0:inf]>), ('thermal_sigmax', <Parameter 'thermal_sigmax', value=71.84654400127174, bounds=[0:inf]>), ('thermal_sigmay', <Parameter 'thermal_sigmay', value=86.21585280152608, bounds=[-inf:inf], expr='thermalAspectRatio * thermal_sigmax'>), ('thermalAspectRatio', <Parameter 'thermalAspectRatio', value=1.2, bounds=[0.8:1.2]>), ('condensate_fraction', <Parameter 'condensate_fraction', value=0.0, bounds=[-inf:inf], expr='BEC_amplitude / (BEC_amplitude + thermal_amplitude)'>)])"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-24 19:59:04 +02:00
"source": [
"params.compute().item()"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 16,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.QuadMesh at 0x2064618e520>"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAoEAAAHECAYAAABGLvD6AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAADLHElEQVR4nOz9e5hU1Zn3D3+rq7qqumka0TGDpwgTRVEwA2oSQ8hIMChG32QkKB5BMsqYDJkxQROiUfSJMSgmk0lGEx/Po8bEIfr4YwAxRCfqREfQREEuTZAGAmIiYJ+7quvw/lG1dq1911p7r32oY9+f6yqotddhr6raXftb92GtSD6fz4NhGIZhGIYZUbTUegIMwzAMwzBM9WERyDAMwzAMMwJhEcgwDMMwDDMCYRHIMAzDMAwzAmERyDAMwzAMMwJhEcgwDMMwDDMCYRHIMAzDMAwzAonVegIjn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zAinln8C1RB99fonHsZrr3WShdN7WwnhVCtRyC7iEUsUHBPY5DSMO3jfvn24//77cckll+CEE07AqFGjkEgkcOSRR+ILX/iCtZWLCnk/QafHH//4R8c5bNu2zVoRPJlM4kMf+hDOPPNMrFq1KuyXy1SUWu2/Wqk9cXV7y1bq9en2+PXyqId5VJJqfBa12GOZ9y1mmGaiYf6ax40bh0ym9Cs0mUyitbUVu3fvxu7du/H//t//w5w5c/Cf//mfaG9vV47R2tqKgw8+WHuOWEz/dqxZswbz5s3DwMAAAKCzsxP79u3D+vXrsX79elx++eW49957EYmw/bt
"text/plain": [
"<Figure size 640x480 with 2 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
2023-05-24 19:59:04 +02:00
"source": [
"fitCurve = fitAnalyser.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
"\n",
"fitCurve.plot.pcolormesh(cmap='jet', vmin=0, col=scanAxis[0], row=scanAxis[1])"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 17,
2023-05-24 19:59:04 +02:00
"metadata": {},
"outputs": [],
"source": [
"fitModel2 = Polylog22dModel(prefix='thermal_')\n",
"fitAnalyser2 = FitAnalyser(fitModel2, fitDim=2)\n",
2023-06-02 18:42:18 +02:00
"fitCurve2 = fitAnalyser2.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()\n",
2023-05-24 19:59:04 +02:00
"\n",
"fitModel3 = ThomasFermi2dModel(prefix='BEC_')\n",
"fitAnalyser3 = FitAnalyser(fitModel3, fitDim=2)\n",
2023-06-02 18:42:18 +02:00
"fitCurve3 = fitAnalyser3.eval(fitResult, x=np.arange(300), y=np.arange(300), dask=\"parallelized\").load()"
2023-05-24 19:59:04 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 18,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"image/png": "iV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/jL+1pGu+Pw3L4Vgje2R4zHPWmyKYToOwOmueWqVav4+te/DmgL7ebl5REMBvH7/cY+48eP54UXXqC8vDzt2Pz8fBYuXMhpp53G+vXrmTt3Lrm5uYRCIaJRbYrxggUL+P3vf993b0gI0acyM02Z9Bl0tcmlVup9YTbUtHHspBIKPXaak+0InltaydePn9jrheCN/lSGyx+JUZjj2KfXE0L0vgGRaRoxYgT//Oc/+cY3vsGcOXMoKSmhra2NRCLBmDFjOOecc3jkkUdYt24ds2fPzvoac+bMYd26ddx0001MnjyZaDRKTk4Oxx57LH/9619ZtGhRWidxIcTgUpVcQmVEQSdBUzLTpA/Pff+F1Vz26Kd8vLWRlmCqf1NDu7a9t2ua9MWEAfxhmYknxIFoQGSaHA4HF154IRdeeOE+vU5ZWRn33nsv9957by+dmRBioGhKBiUl3uw3R2UZvZo2VGvrSi6taMZcUukLxYjEEr0+ey5teE4WABbigDQgMk1CCLEvVFU1hteKOhn20gvBa9tCROMJapK1TRtqtOAp323HopU/0RKI9P7wXHtqeC4gmSYhDkgSNAkhBr22UIx4QksXFXjsWfdJFYKHqWkNkdydz5MZpxKvg0KPFnA1+iMdMk3mjuCfbGvku899lhYI7Yl5eK5dCsGFOCBJ0CSEGPSakwGJx2HFZbdm3UcvBG8NRtlS3248v6NJm3VXnOM0slTN/ohR02S3aukn8/DcXxdv58WVu1m0tqbb52gengvI8JwQByQJmoQ
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHECAYAAAAkrR7VAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAACcQ0lEQVR4nOzdeZgcZbX48W/1vs4+k8kkk30je0gIW8JOAAEREEURUFBA0asI6I8rCuhVFBGuVwRFVEBQ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AZl0FRRUUF1dTUtLS3U1NRw5513smbNGhYuXMjPfvazw/raN910E83NzcafPXvaX1yFEIfXn1+9lgaLwrgkXHL67437n1iZWQQSiWdqlJrCMepaYgA0pP+3qlnLNE0s1rLK4VgSt92a9TqXHzsWgDmjcwGMmiZdoc+JL13TZN5/bv6cyznXVoyqKPxqxa+kd5MQQ8SgDJrMSkpKuP7663nllVdQFIVf/OIXWS0H/H6/cTsc7rzrr/mY+TFtOZ1OcnJysv4IIfpORcU7PBrSOm9fNeFyzrl3FU99spdt+4Os2dNknNdqCpr0wm3QmlMCVKan5yaX6EFTIqvtwIgcJ7ecO4OHr1jIPV89EoC8dKZJV+jLZJpa2mza+8Mlf8STUllvSfDG8l8f0nsWQgwMgz5o0i1cuJBFi7SGdvfff79xf1lZmXG7srKy3ePaHsvJyem0nkkI0f/+8N7NJBSFxYqXJucX2VwT5OnVlaxMb2+ii3QWNLXEUFXVqGmaVJLJNOmBz4VHjuZ3F83FYlE4YUox5QX
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataSet_cropOD.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve2.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve3.sum(dim='x').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"\n",
2023-05-24 19:59:04 +02:00
"plt.show()\n",
"\n",
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataSet_cropOD.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve2.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"fitCurve3.sum(dim='y').plot(ax=ax, col=scanAxis[0], row=scanAxis[1])\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 19,
2023-05-25 19:11:19 +02:00
"metadata": {},
"outputs": [],
"source": [
"value = fitAnalyser.get_fit_value(fitResult)\n",
2023-06-02 18:42:18 +02:00
"std = fitAnalyser.get_fit_std(fitResult)"
2023-05-24 19:59:04 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 20,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"outputs": [
{
"data": {
"text/html": [
"<h2> Model</h2> Model(density_profile_BEC_2d) <h2>Fit Statistics</h2><table><tr><td>fitting method</td><td>leastsq</td><td></td></tr><tr><td># function evals</td><td>67</td><td></td></tr><tr><td># data points</td><td>90000</td><td></td></tr><tr><td># variables</td><td>10</td><td></td></tr><tr><td>chi-square</td><td> 517.942526</td><td></td></tr><tr><td>reduced chi-square</td><td> 0.00575556</td><td></td></tr><tr><td>Akaike info crit.</td><td>-464173.060</td><td></td></tr><tr><td>Bayesian info crit.</td><td>-464078.984</td><td></td></tr></table><h2>Variables</h2><table><tr><th> name </th><th> value </th><th> initial value </th><th> min </th><th> max </th><th> vary </th><th> expression </th></tr><tr><td> BEC_amplitude </td><td> 0.00000000 </td><td> 0 </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_amplitude </td><td> 3066.90948 </td><td> 3073.528205527723 </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centerx </td><td> 146.943010 </td><td> 146.94301032591366 </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_centery </td><td> 147.472246 </td><td> 147.47224593536436 </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centerx </td><td> 146.238705 </td><td> 120.55703835420424 </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_centery </td><td> 148.778889 </td><td> 179.3646237177809 </td><td> -inf </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmax </td><td> 17.1554887 </td><td> 17.155488681677085 </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> BEC_sigmay </td><td> 18.3156015 </td><td> 18.315601451967396 </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmax </td><td> 54.3744708 </td><td> 71.84654400127174 </td><td> 0.00000000 </td><td> inf </td><td> True </td><td> </td></tr><tr><td> thermal_sigmay </td><td> 65.2493650 </td><td> 86.21585280152608 </td><td> -inf </td><td> inf </td><td> False </td><td> thermalAspectRatio * thermal_sigmax </td></tr><tr><td> thermalAspectRatio </td><td> 1.20000000 </td><td> 1.2 </td><td> 0.80000000 </td><td> 1.20000000 </td><td> True </td><td> </td></tr><tr><td> condensate_fraction </td><td> 0.00000000 </td><td> 0.0 </td><td> -inf </td><td> inf </td><td> False </td><td> BEC_amplitude / (BEC_amplitude + thermal_amplitude) </td></tr></table>"
],
"text/plain": [
"<lmfit.model.ModelResult at 0x20645f1b220>"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
2023-05-24 19:59:04 +02:00
"source": [
2023-06-02 18:42:18 +02:00
"fitResult.item()"
2023-05-24 19:59:04 +02:00
]
},
{
"cell_type": "code",
2023-06-02 18:42:18 +02:00
"execution_count": 21,
2023-05-24 19:59:04 +02:00
"metadata": {},
2023-06-02 18:42:18 +02:00
"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.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" BEC_amplitude float64 0.0\n",
" thermal_amplitude float64 3.067e+03\n",
" BEC_centerx float64 146.9\n",
" BEC_centery float64 147.5\n",
" thermal_centerx float64 146.2\n",
" thermal_centery float64 148.8\n",
" BEC_sigmax float64 17.16\n",
" BEC_sigmay float64 18.32\n",
" thermal_sigmax float64 54.37\n",
" thermal_sigmay float64 65.25\n",
" thermalAspectRatio float64 1.2\n",
" condensate_fraction float64 0.0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-ec911abd-098d-4259-a4b6-4e568b90087f' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-ec911abd-098d-4259-a4b6-4e568b90087f' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-0f2def9a-ac29-4bf6-875c-492eaeb226a6' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0f2def9a-ac29-4bf6-875c-492eaeb226a6' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-44207dfd-4741-4012-85a5-577adbe586c8' class='xr-section-summary-in' type='checkbox' checked><label for='section-44207dfd-4741-4012-85a5-577adbe586c8' class='xr-section-summary' >Data variables: <span>(12)</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>BEC_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0</div><input id='attrs-2593f89c-3d9f-40b6-83fd-ff1adf21503c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2593f89c-3d9f-40b6-83fd-ff1adf21503c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c79ed5f3-c1aa-4b23-b8e1-a8333f299693' class='xr-var-data-in' type='checkbox'><label for='data-c79ed5f3-c1aa-4b23-b8e1-a8333f299693' 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.)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>thermal_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>3.067e+03</div><input id='attrs-8911a68d-09b5-4d43-9d8d-ed8f86bbbf53' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8911a68d-09b5-4d43-9d8d-ed8f86bbbf53' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9947ec6a-a3f5-46f8-9113-871f1e780376' class='xr-var-data-in' type='checkbox'><label for='data-9947ec6a-a3f5-46f8-9113-871f1e780376' 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(3066.90948362)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>BEC_centerx</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>146.9</div><input id='attrs-29322610-55da-4d78-a07a-e4f70addb0fe' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-29322610-55da-4d78-a07a-e4f70addb0fe' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f7d1475d-48e3-4eef-8e8f-da169a2b493a' class='xr-var-data-in' type='checkbox'><label for='data-f7d1475d-48e3-4eef-8e8f-da169a2b493a' 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(146.94301033)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>BEC_centery</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" BEC_amplitude float64 0.0\n",
" thermal_amplitude float64 3.067e+03\n",
" BEC_centerx float64 146.9\n",
" BEC_centery float64 147.5\n",
" thermal_centerx float64 146.2\n",
" thermal_centery float64 148.8\n",
" BEC_sigmax float64 17.16\n",
" BEC_sigmay float64 18.32\n",
" thermal_sigmax float64 54.37\n",
" thermal_sigmay float64 65.25\n",
" thermalAspectRatio float64 1.2\n",
" condensate_fraction float64 0.0"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"value"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# upload data to MongoDB"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"xdb = xarray_mongodb.XarrayMongoDB(mongoDB)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"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.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" BEC_amplitude float64 0.0\n",
" thermal_amplitude float64 3.067e+03\n",
" BEC_centerx float64 146.9\n",
" BEC_centery float64 147.5\n",
" thermal_centerx float64 146.2\n",
" thermal_centery float64 148.8\n",
" BEC_sigmax float64 17.16\n",
" BEC_sigmay float64 18.32\n",
" thermal_sigmax float64 54.37\n",
" thermal_sigmay float64 65.25\n",
" thermalAspectRatio float64 1.2\n",
" condensate_fraction float64 0.0</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-2d2d25d9-9fea-4bc6-8222-c2cf0a8ff9a9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-2d2d25d9-9fea-4bc6-8222-c2cf0a8ff9a9' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-d2551e18-6474-4259-b364-76480fc03dfd' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-d2551e18-6474-4259-b364-76480fc03dfd' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-4f2648bb-3ca7-47cb-b1dd-c0b486a4f456' class='xr-section-summary-in' type='checkbox' checked><label for='section-4f2648bb-3ca7-47cb-b1dd-c0b486a4f456' class='xr-section-summary' >Data variables: <span>(12)</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>BEC_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0</div><input id='attrs-9b83f124-19ff-4792-9225-22fc1c32f0ae' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-9b83f124-19ff-4792-9225-22fc1c32f0ae' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-82995608-5ce5-468c-a392-a47bdeca7ba7' class='xr-var-data-in' type='checkbox'><label for='data-82995608-5ce5-468c-a392-a47bdeca7ba7' 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.)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>thermal_amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>3.067e+03</div><input id='attrs-d4477f2d-a997-4add-a126-44995efdb5ea' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d4477f2d-a997-4add-a126-44995efdb5ea' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-937dd99a-0078-4e67-93ad-812830f6294c' class='xr-var-data-in' type='checkbox'><label for='data-937dd99a-0078-4e67-93ad-812830f6294c' 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(3066.90948362)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>BEC_centerx</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>146.9</div><input id='attrs-d70baca2-d254-4217-9919-8d10158eba32' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d70baca2-d254-4217-9919-8d10158eba32' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-665a93e0-62b1-4fad-b896-9032a19a5648' class='xr-var-data-in' type='checkbox'><label for='data-665a93e0-62b1-4fad-b896-9032a19a5648' 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(146.94301033)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>BEC_centery</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" BEC_amplitude float64 0.0\n",
" thermal_amplitude float64 3.067e+03\n",
" BEC_centerx float64 146.9\n",
" BEC_centery float64 147.5\n",
" thermal_centerx float64 146.2\n",
" thermal_centery float64 148.8\n",
" BEC_sigmax float64 17.16\n",
" BEC_sigmay float64 18.32\n",
" thermal_sigmax float64 54.37\n",
" thermal_sigmay float64 65.25\n",
" thermalAspectRatio float64 1.2\n",
" condensate_fraction float64 0.0"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"value = fitAnalyser.get_fit_value(fitResult)\n",
"value"
]
},
{
"cell_type": "code",
"execution_count": 24,
"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' (y: 300, x: 300)>\n",
"array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])\n",
"Dimensions without coordinates: y, x</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>y</span>: 300</li><li><span>x</span>: 300</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-f1a36004-4342-41b9-8b08-fa0d97623af8' class='xr-array-in' type='checkbox' checked><label for='section-f1a36004-4342-41b9-8b08-fa0d97623af8' 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>-0.06869 -0.04668 -0.03212 0.05976 ... 0.0411 -0.07083 -0.0159</span></div><div class='xr-array-data'><pre>array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])</pre></div></div></li><li class='xr-section-item'><input id='section-7a35c8e0-b7c4-4c09-a864-e7f104fd32ba' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-7a35c8e0-b7c4-4c09-a864-e7f104fd32ba' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-e5e64a51-1f0f-47bc-94b1-a8d0bf4f1cbd' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-e5e64a51-1f0f-47bc-94b1-a8d0bf4f1cbd' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-6e077103-321a-45c8-9bf6-1123c292f51e' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-6e077103-321a-45c8-9bf6-1123c292f51e' 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' (y: 300, x: 300)>\n",
"array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])\n",
"Dimensions without coordinates: y, x"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dataSet_cropOD"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"dataSet_cropOD.attrs['name'] = 'name'"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"_id, _ = xdb.put(dataSet_cropOD)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"ObjectId('647a1a3961605df9de73b6d7')"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"_id"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"# _id = '646e3cbbdb91e17db4b4cbd2'"
]
},
{
"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' (y: 300, x: 300)>\n",
"array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])\n",
"Dimensions without coordinates: y, x\n",
"Attributes:\n",
" name: name</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>y</span>: 300</li><li><span>x</span>: 300</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-e563b17b-a1e7-415f-a71a-fd32492ad8f8' class='xr-array-in' type='checkbox' checked><label for='section-e563b17b-a1e7-415f-a71a-fd32492ad8f8' 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>-0.06869 -0.04668 -0.03212 0.05976 ... 0.0411 -0.07083 -0.0159</span></div><div class='xr-array-data'><pre>array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])</pre></div></div></li><li class='xr-section-item'><input id='section-f343f4f9-c74a-42e0-a732-46855a9c2e31' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-f343f4f9-c74a-42e0-a732-46855a9c2e31' class='xr-section-summary' title='Expand/collapse section'>Coordinates: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-dcd02836-8e44-4bbc-afa8-cc09a5de106e' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-dcd02836-8e44-4bbc-afa8-cc09a5de106e' class='xr-section-summary' title='Expand/collapse section'>Indexes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'></ul></div></li><li class='xr-section-item'><input id='section-b5d8e6d5-3543-49e8-baab-250fb6cb7f8b' class='xr-section-summary-in' type='checkbox' checked><label for='section-b5d8e6d5-3543-49e8-baab-250fb6cb7f8b' class='xr-section-summary' >Attributes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>name :</span></dt><dd>name</dd></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'OD' (y: 300, x: 300)>\n",
"array([[-0.06868947, -0.04667641, -0.03211941, ..., 0.01331776,\n",
" -0.01568196, -0.01466019],\n",
" [-0.04738689, -0.10095033, -0.04738689, ..., -0.00086687,\n",
" -0.02864644, 0.04425356],\n",
" [ 0.01488149, 0.02990479, 0.02943848, ..., 0.08614451,\n",
" -0.04168887, -0.17522026],\n",
" ...,\n",
" [-0.04435198, -0.08981436, -0.12101118, ..., -0.03211941,\n",
" -0.10466366, -0.00086687],\n",
" [-0.10622739, -0.16213502, -0.04253957, ..., -0.03117222,\n",
" 0.01331776, -0.03117222],\n",
" [-0.02148616, -0.06029029, 0.17348652, ..., 0.04109733,\n",
" -0.07082546, -0.01590475]])\n",
"Dimensions without coordinates: y, x\n",
"Attributes:\n",
" name: name"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"xdb.get(_id)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"ObjectId('646e4919802812f029b385d7')"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = bson.objectid.ObjectId('646e4919802812f029b385d7')\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"ename": "DocumentNotFoundError",
"evalue": "646e4919802812f029b385d7",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mDocumentNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32mf:\\Jianshun\\analyseScript\\testMongoDB.ipynb Cell 41\u001b[0m in \u001b[0;36m1\n\u001b[1;32m----> <a href='vscode-notebook-cell:/f%3A/Jianshun/analyseScript/testMongoDB.ipynb#X64sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m xdb\u001b[39m.\u001b[39;49mget(c)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python39\\site-packages\\xarray_mongodb\\sync.py:169\u001b[0m, in \u001b[0;36mXarrayMongoDB.get\u001b[1;34m(self, _id, load)\u001b[0m\n\u001b[0;32m 167\u001b[0m meta \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmeta\u001b[39m.\u001b[39mfind_one({\u001b[39m\"\u001b[39m\u001b[39m_id\u001b[39m\u001b[39m\"\u001b[39m: _id})\n\u001b[0;32m 168\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m meta:\n\u001b[1;32m--> 169\u001b[0m \u001b[39mraise\u001b[39;00m DocumentNotFoundError(_id)\n\u001b[0;32m 170\u001b[0m load_norm, chunks_query \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_prepare_get(meta, load)\n\u001b[0;32m 171\u001b[0m \u001b[39mif\u001b[39;00m chunks_query:\n",
"\u001b[1;31mDocumentNotFoundError\u001b[0m: 646e4919802812f029b385d7"
]
}
],
2023-05-24 19:59:04 +02:00
"source": [
"xdb.get(c)"
]
},
2023-05-25 19:11:19 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import datetime\n",
"post = {\"author\": \"Mike\",\n",
" \"data_id\": _id,\n",
" \"tags\": [\"mongodb\", \"python\", \"pymongo\"],\n",
" \"date\": datetime.datetime.utcnow()}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"posts = mongoCollection\n",
"post_id = posts.insert_one(post).inserted_id\n",
"post_id"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
" for i in posts.find({'_id': bson.objectid.ObjectId('646e45a4802812f029b385d6')}):\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import gridfs\n",
"\n",
"fs = gridfs.GridFS(mongoDB, 'xarray')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fs.put(b\"hello world\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"c = bson.objectid.ObjectId('646e4919802812f029b385d7')\n",
"\n",
"fs.get(_id)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.sqrt(np.sum([0.061**2, 0.334**2, 0.447**2]))"
]
},
2023-05-24 16:54:29 +02:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "py39",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}