2023-05-24 16:54:29 +02:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": 24,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 25,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 26,
|
2023-05-24 16:54:29 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"Task executing\n",
|
|
|
|
"\n",
|
|
|
|
"Task2 executing \n",
|
|
|
|
"\n",
|
2023-05-25 19:11:19 +02:00
|
|
|
"Task done\n",
|
2023-05-24 16:54:29 +02:00
|
|
|
"Task2 done\n",
|
|
|
|
"\n",
|
|
|
|
"\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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 27,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 28,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 29,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stderr",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"C:\\Users\\data\\AppData\\Roaming\\Python\\Python39\\site-packages\\distributed\\node.py:182: UserWarning: Port 8787 is already in use.\n",
|
|
|
|
"Perhaps you already have a cluster running?\n",
|
2023-05-25 19:11:19 +02:00
|
|
|
"Hosting the HTTP server on port 53497 instead\n",
|
2023-05-24 19:59:04 +02:00
|
|
|
" warnings.warn(\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-05-25 19:11:19 +02:00
|
|
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-f81d966f-fb10-11ed-96c4-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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53497/status\" target=\"_blank\">http://127.0.0.1:53497/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-05-25 19:11:19 +02:00
|
|
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">68a73a45</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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:53497/status\" target=\"_blank\">http://127.0.0.1:53497/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-05-25 19:11:19 +02:00
|
|
|
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-cea99f1c-444d-4f12-bd6b-5a8725df82cd</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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm:</strong> tcp://127.0.0.1:53498\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:53497/status\" target=\"_blank\">http://127.0.0.1:53497/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53530\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53533/status\" target=\"_blank\">http://127.0.0.1:53533/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53502\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-ph8qm9gw\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53527\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53528/status\" target=\"_blank\">http://127.0.0.1:53528/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53503\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-x4snfqwt\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53539\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53540/status\" target=\"_blank\">http://127.0.0.1:53540/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53504\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-yw4z2wi3\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53542\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53543/status\" target=\"_blank\">http://127.0.0.1:53543/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53505\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-jpmm633i\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53531\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53532/status\" target=\"_blank\">http://127.0.0.1:53532/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53506\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-_4j15kw6\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Comm: </strong> tcp://127.0.0.1:53536\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:53537/status\" target=\"_blank\">http://127.0.0.1:53537/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-05-25 19:11:19 +02:00
|
|
|
" <strong>Nanny: </strong> tcp://127.0.0.1:53507\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-05-25 19:11:19 +02:00
|
|
|
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-bmbg4f7j\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-05-25 19:11:19 +02:00
|
|
|
"<Client: 'tcp://127.0.0.1:53498' processes=6 threads=60, memory=55.88 GiB>"
|
2023-05-24 19:59:04 +02:00
|
|
|
]
|
|
|
|
},
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": 29,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 30,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 31,
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": 32,
|
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()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": 56,
|
2023-05-24 19:59:04 +02:00
|
|
|
"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",
|
2023-05-25 19:11:19 +02:00
|
|
|
"Dimensions: (fileIndex: 1, index: 1201)\n",
|
|
|
|
"Coordinates:\n",
|
|
|
|
" * index (index) int64 0 1 2 3 4 5 6 ... 1195 1196 1197 1198 1199 1200\n",
|
|
|
|
"Dimensions without coordinates: fileIndex\n",
|
2023-05-24 19:59:04 +02:00
|
|
|
"Data variables:\n",
|
2023-05-25 19:11:19 +02:00
|
|
|
" X (fileIndex, index) float64 nan 0.0 1.0 ... 1.198e+03 1.199e+03\n",
|
|
|
|
" CH1 (fileIndex, index) float64 nan -0.08 -0.08 ... 3.28 -5.52 9.68\n",
|
|
|
|
" CH2 (fileIndex, index) float64 nan 0.0 0.0 ... 0.008 -0.276 -0.128\n",
|
|
|
|
" Start (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan\n",
|
|
|
|
" Increment (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan\n",
|
|
|
|
" Unnamed: 5 (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan</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-ab18782d-a842-4c21-a6b3-4f13566e3bb2' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-ab18782d-a842-4c21-a6b3-4f13566e3bb2' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>fileIndex</span>: 1</li><li><span class='xr-has-index'>index</span>: 1201</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-c96b7ec7-482e-4441-b539-edde63b29062' class='xr-section-summary-in' type='checkbox' checked><label for='section-c96b7ec7-482e-4441-b539-edde63b29062' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>index</span></div><div class='xr-var-dims'>(index)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 ... 1197 1198 1199 1200</div><input id='attrs-383cd32e-845a-4467-8d41-928ed8609827' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-383cd32e-845a-4467-8d41-928ed8609827' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bf3f5910-78fd-4a93-9ee9-defd7ef8445d' class='xr-var-data-in' type='checkbox'><label for='data-bf3f5910-78fd-4a93-9ee9-defd7ef8445d' 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, 1, 2, ..., 1198, 1199, 1200], dtype=int64)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6044feb7-4f52-4887-90a7-1a68618d0360' class='xr-section-summary-in' type='checkbox' checked><label for='section-6044feb7-4f52-4887-90a7-1a68618d0360' class='xr-section-summary' >Data variables: <span>(6)</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>X</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan 0.0 1.0 ... 1.198e+03 1.199e+03</div><input id='attrs-1ae77e14-8e0f-49d7-8a0f-f4743612f057' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1ae77e14-8e0f-49d7-8a0f-f4743612f057' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a161b292-66bd-4d8b-9238-0e6ad0c4c618' class='xr-var-data-in' type='checkbox'><label for='data-a161b292-66bd-4d8b-9238-0e6ad0c4c618' 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([[ nan, 0.000e+00, 1.000e+00, ..., 1.197e+03, 1.198e+03,\n",
|
|
|
|
" 1.199e+03]])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>CH1</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan -0.08 -0.08 ... 3.28 -5.52 9.68</div><input id='attrs-d61ac07e-5f98-4e4f-a48b-b929c97a8143' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d61ac07e-5f98-4e4f-a48b-b929c97a8143' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c4cf86e6-5eac-4b59-b0c6-07041dfface3' class='xr-var-data-in' type='checkbox'><label for='data-c4cf86e6-5eac-4b59-b0c6-07041dfface3' 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([[ nan, -0.08, -0.08, ..., 3.28, -5.52, 9.68]])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>CH2</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan 0.0 0.0 ... 0.008 -0.276 -0.128</div><input id='attrs-224f50c0-1174-4ce6-9c0e-0f907c6bd5fa' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-224f50c0-1174-4ce6-9c0e-0f907c6bd5fa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-721707eb-b76e-4ec3-be7c-e2d944b10c63' class='xr-var-data-in' type='checkbox'><label for='data-721707eb-b76e-4ec3-be7c-e2d944b10c63' 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([[ nan, 0. , 0. , ..., 0.008, -0.276, -0.128]])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Start</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-996d5f33-c693-40cc-b5af-28e8a588ba9b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-996d5f33-c693-40cc-b5af-28e8a588ba9b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c043ab07-d337-4099-994c-a9d9011214ee' class='xr-var-data-in' type='checkbox'><label for='data-c043ab07-d337-4099-994c-a9d9011214ee' 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([[nan, nan, nan, ..., nan, nan, nan]])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Increment</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-54fc1344-e6ad-4333-bc19-f559f9dd9ced' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-54fc1344-e6ad-4333-bc19-f559f9dd9ced' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-191146ed-a804-4ebe-aadf-e796f61c5a48' class='xr-var-data-in' type='checkbox'><label for='data-191146ed-a804-4ebe-aadf-e796f61c5a48' 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([[nan, nan, nan, ..., nan, nan, nan]])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Unnamed: 5</span></div><div class='xr-var-dims'>(fileIndex, index)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-a2e77687-a64b-4ed
|
2023-05-24 19:59:04 +02:00
|
|
|
],
|
|
|
|
"text/plain": [
|
|
|
|
"<xarray.Dataset>\n",
|
2023-05-25 19:11:19 +02:00
|
|
|
"Dimensions: (fileIndex: 1, index: 1201)\n",
|
|
|
|
"Coordinates:\n",
|
|
|
|
" * index (index) int64 0 1 2 3 4 5 6 ... 1195 1196 1197 1198 1199 1200\n",
|
|
|
|
"Dimensions without coordinates: fileIndex\n",
|
2023-05-24 19:59:04 +02:00
|
|
|
"Data variables:\n",
|
2023-05-25 19:11:19 +02:00
|
|
|
" X (fileIndex, index) float64 nan 0.0 1.0 ... 1.198e+03 1.199e+03\n",
|
|
|
|
" CH1 (fileIndex, index) float64 nan -0.08 -0.08 ... 3.28 -5.52 9.68\n",
|
|
|
|
" CH2 (fileIndex, index) float64 nan 0.0 0.0 ... 0.008 -0.276 -0.128\n",
|
|
|
|
" Start (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan\n",
|
|
|
|
" Increment (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan\n",
|
|
|
|
" Unnamed: 5 (fileIndex, index) float64 nan nan nan nan ... nan nan nan nan"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 56,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"filePath = './NewFile.csv'\n",
|
|
|
|
"data = read_csv_file(filePath)\n",
|
|
|
|
"remove_bad_shots(data, index=0)\n",
|
|
|
|
"data = data.astype(float)\n",
|
|
|
|
"data"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 57,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"[<matplotlib.lines.Line2D at 0x2b6f565f730>]"
|
2023-05-24 19:59:04 +02:00
|
|
|
]
|
|
|
|
},
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": 57,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
2023-05-25 19:11:19 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"image/png": "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
|
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
2023-05-24 19:59:04 +02:00
|
|
|
}
|
|
|
|
],
|
2023-05-25 19:11:19 +02:00
|
|
|
"source": [
|
|
|
|
"fig = plt.figure()\n",
|
|
|
|
"ax = fig.gca()\n",
|
|
|
|
"\n",
|
|
|
|
"data.isel(fileIndex=0).CH2.plot(ax=ax)\n",
|
|
|
|
"plt.xlim()\n",
|
|
|
|
"plt.xlim()\n",
|
|
|
|
"\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"attachments": {},
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"# An example for one experimental run"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"attachments": {},
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Load the data"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"source": [
|
|
|
|
"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"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"attachments": {},
|
|
|
|
"cell_type": "markdown",
|
|
|
|
"metadata": {},
|
|
|
|
"source": [
|
|
|
|
"## Calculate an plot OD images"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"source": [
|
|
|
|
"params.compute().item()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
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-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"fitModel2 = Polylog22dModel(prefix='thermal_')\n",
|
|
|
|
"fitAnalyser2 = FitAnalyser(fitModel2, fitDim=2)\n",
|
|
|
|
"fitCurve2 = fitAnalyser2.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()\n",
|
|
|
|
"\n",
|
|
|
|
"fitModel3 = ThomasFermi2dModel(prefix='BEC_')\n",
|
|
|
|
"fitAnalyser3 = FitAnalyser(fitModel3, fitDim=2)\n",
|
|
|
|
"fitCurve3 = fitAnalyser3.eval(fitResult, x=np.arange(100), y=np.arange(100), dask=\"parallelized\").load()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"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",
|
|
|
|
"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-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"source": [
|
|
|
|
"value = fitAnalyser.get_fit_full_result(fitResult)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"value"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"xdb = xarray_mongodb.XarrayMongoDB(mongoDB)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"value = fitAnalyser.get_fit_value(fitResult)\n",
|
|
|
|
"value"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"dataSet_cropOD"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"dataSet_cropOD.attrs['name'] = 'name'"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"_id, _ = xdb.put(dataSet_cropOD)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"_id"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"# _id = '646e3cbbdb91e17db4b4cbd2'"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"source": [
|
|
|
|
"xdb.get(_id)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
2023-05-24 19:59:04 +02:00
|
|
|
"source": [
|
2023-05-25 19:11:19 +02:00
|
|
|
"c = bson.objectid.ObjectId('646e4919802812f029b385d7')\n",
|
2023-05-24 19:59:04 +02:00
|
|
|
"c"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2023-05-25 19:11:19 +02:00
|
|
|
"execution_count": null,
|
2023-05-24 19:59:04 +02:00
|
|
|
"metadata": {},
|
2023-05-25 19:11:19 +02:00
|
|
|
"outputs": [],
|
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
|
|
|
|
}
|