analyseScript/AccordionLattice_20230808.ipynb

2615 lines
422 KiB
Plaintext
Raw Normal View History

2023-08-21 10:28:12 +02:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Import supporting package"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import copy\n",
"import glob\n",
"from datetime import datetime\n",
"\n",
"# The package for data structure\n",
"import xarray as xr\n",
"import pandas as pd\n",
"import numpy as np\n",
"\n",
"# The packages for working with uncertainties\n",
"from uncertainties import ufloat\n",
"from uncertainties import unumpy as unp\n",
"from uncertainties import umath\n",
"\n",
"# The package for plotting\n",
"import matplotlib.pyplot as plt\n",
"plt.rcParams['font.size'] = 18 # Set the global font size\n",
"\n",
"# -------------- The modules written by us --------------\n",
"\n",
"# The packages for read data\n",
"from DataContainer.ReadData import read_hdf5_file, read_hdf5_global, read_hdf5_run_time, read_csv_file\n",
"\n",
"# The packages for data analysis\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",
"# Add errorbar plot to xarray package\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"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Start a client for parallel computing"
]
},
{
"cell_type": "code",
"execution_count": 2,
"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",
"Hosting the HTTP server on port 57804 instead\n",
" 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",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-dfee8bd5-35d5-11ee-960c-80e82ce2fa8e</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57804/status\" target=\"_blank\">http://127.0.0.1:57804/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">162c46da</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:57804/status\" target=\"_blank\">http://127.0.0.1:57804/status</a>\n",
" </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",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-b1db6959-375b-4ed2-9a77-02ce7ec59048</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm:</strong> tcp://127.0.0.1:57807\n",
" </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>Dashboard:</strong> <a href=\"http://127.0.0.1:57804/status\" target=\"_blank\">http://127.0.0.1:57804/status</a>\n",
" </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",
" <strong>Comm: </strong> tcp://127.0.0.1:57846\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57847/status\" target=\"_blank\">http://127.0.0.1:57847/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57810\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-o0fweh8b\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57840\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57842/status\" target=\"_blank\">http://127.0.0.1:57842/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57811\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-toa8_m6l\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57834\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57835/status\" target=\"_blank\">http://127.0.0.1:57835/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57812\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-_6d2fpz3\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57837\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57838/status\" target=\"_blank\">http://127.0.0.1:57838/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57813\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-jquysjj5\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 4</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57849\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57850/status\" target=\"_blank\">http://127.0.0.1:57850/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57814\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-okg6p_4_\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 5</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:57841\n",
" </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",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:57843/status\" target=\"_blank\">http://127.0.0.1:57843/status</a>\n",
" </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",
" <strong>Nanny: </strong> tcp://127.0.0.1:57815\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> C:\\Users\\data\\AppData\\Local\\Temp\\dask-worker-space\\worker-iszz7udd\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
"\n",
" </details>\n",
"</div>\n",
"\n",
" </details>\n",
" </div>\n",
"</div>\n",
" </details>\n",
" \n",
"\n",
" </div>\n",
"</div>"
],
"text/plain": [
"<Client: 'tcp://127.0.0.1:57807' processes=6 threads=60, memory=55.88 GiB>"
]
},
"execution_count": 2,
"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"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Load Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## With Modulation"
]
},
{
"cell_type": "code",
"execution_count": 3,
"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'>&lt;xarray.DataArray &#x27;CH1&#x27; (x: 6000000)&gt;\n",
"array([0.329, 0.317, 0.309, ..., 0.293, 0.305, 0.309])\n",
"Coordinates:\n",
" * x (x) float64 0.0 2e-06 4e-06 6e-06 8e-06 ... 12.0 12.0 12.0 12.0</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'>'CH1'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 6000000</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-cd69e8af-adb0-4d58-8d60-e88ea56db5b0' class='xr-array-in' type='checkbox' checked><label for='section-cd69e8af-adb0-4d58-8d60-e88ea56db5b0' 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.329 0.317 0.309 0.305 0.309 0.317 ... 0.273 0.281 0.293 0.305 0.309</span></div><div class='xr-array-data'><pre>array([0.329, 0.317, 0.309, ..., 0.293, 0.305, 0.309])</pre></div></div></li><li class='xr-section-item'><input id='section-bc920d53-f2bd-40af-bc4d-8f591ba63893' class='xr-section-summary-in' type='checkbox' checked><label for='section-bc920d53-f2bd-40af-bc4d-8f591ba63893' 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'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 2e-06 4e-06 ... 12.0 12.0 12.0</div><input id='attrs-acbf94cc-4894-45e9-8a54-c2bd6c8d627b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-acbf94cc-4894-45e9-8a54-c2bd6c8d627b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-40334779-fbfa-4a07-a197-7deb87a48270' class='xr-var-data-in' type='checkbox'><label for='data-40334779-fbfa-4a07-a197-7deb87a48270' 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.000000e+00, 2.000000e-06, 4.000000e-06, ..., 1.199999e+01,\n",
" 1.200000e+01, 1.200000e+01])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-95913ac9-6209-44de-a908-d3343b013a35' class='xr-section-summary-in' type='checkbox' ><label for='section-95913ac9-6209-44de-a908-d3343b013a35' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-2e83bee0-b8fc-40ad-9a4f-f16a2f330b4a' class='xr-index-data-in' type='checkbox'/><label for='index-2e83bee0-b8fc-40ad-9a4f-f16a2f330b4a' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ 0.0, 2e-06,\n",
" 4e-06, 6e-06,\n",
" 8e-06, 9.999999999999999e-06,\n",
" 1.2e-05, 1.4e-05,\n",
" 1.6e-05, 1.8e-05,\n",
" ...\n",
" 11.999979999999999, 11.999982,\n",
" 11.999984, 11.999986,\n",
" 11.999988, 11.999989999999999,\n",
" 11.999991999999999, 11.999994,\n",
" 11.999996, 11.999998],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;x&#x27;, length=6000000))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-ba5d9fa6-1249-46a1-897b-98e029355046' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-ba5d9fa6-1249-46a1-897b-98e029355046' 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 'CH1' (x: 6000000)>\n",
"array([0.329, 0.317, 0.309, ..., 0.293, 0.305, 0.309])\n",
"Coordinates:\n",
" * x (x) float64 0.0 2e-06 4e-06 6e-06 8e-06 ... 12.0 12.0 12.0 12.0"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filePath = r'F:\\Jianshun\\AccordionLatticeShorTermStability\\20230808\\withModulation.csv'\n",
"\n",
"data = read_csv_file(filePath, csvEngine='pandas', csvKwargs=dict(header=[0], skiprows=[1], encoding = \"ISO-8859-1\",))\n",
"dataWithModulation = xr.DataArray(\n",
" data=data.CH1[0,:],\n",
" dims=['x'],\n",
" coords=dict(\n",
" x=data.X[0,:].to_numpy() * 2e-6\n",
" )\n",
")\n",
"dataWithModulation"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmsAAAHGCAYAAAArJsxJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAACCCElEQVR4nO3dd3gVVf4/8PcN6T0ESOiht4QWURBQEERQWVdZBAUBcZV1d931u5a1rQTXsir627WturoUBVHEtipFEFQQ0FCkSE8hJARISO9lfn9gLrl9yjkzZ2Y+r+fJ8yS5c889d+7cmc+c8jkOSZIkEEIIIYQQIQUZXQFCCCGEEOIbBWuEEEIIIQKjYI0QQgghRGAUrBFCCCGECIyCNUIIIYQQgVGwRgghhB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P8o4rPd32tmdScn/ez8zjVBNXaRkbdHkdJZoVtpTtyNJnmMSMN42fAe7NtzLP7XZEwRrxK7e42vn7T6dKPR7POmdcSopA9Gy+P362QrfXkquY7lJly2l1nMtx6LQ46Tv0duysspuAY2fMf9OgltJ20bwSZcehWrtyS3R5HcIOBWvEJ0mS8NSXF3MA7cot8drVIeo4Az0Hp1cKOD5OwB40YTU1K+vqKSwzZoUFMxK1i1lEjU20r+QS9brDCwVrxKcrnt8sa7uhT3wVeCNGNh2S3y305X5lXVtaKBmLpteSKV8qTA6sdHs1zlaIGeQs3qBsduAXBiZeNpvNR8Ts2qpv5D8WS+myaS9+pd8sVSVO6dTip4Se1x0RULBGfMo7XxN4I52t3HnS6CpodqpEn/3
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dataWithModulation.plot.errorbar()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"dataWithModulation = dataWithModulation - dataWithModulation.mean()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAoAAAAHECAYAAACp7JvEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAACCpElEQVR4nO3dd3wUdf4/8Nem90IooQRCbwlVFAQUhENQOAtHR0A89ef55Zp6X9tpvKKnonf3Pdupp6CCIGJXuqCCgFKUDkIKISEEQnrPZn5/cAnZzezulM9n5jMz7+fjwePBZmc++9nZ2dn3fMr745IkSQIhhBBCCHGMILMrQAghhBBCjEUBICGEEEKIw1AASAghhBDiMBQAEkIIIYQ4DAWAhBBCCCEOQwEgIYQQQojDUABICCGEEOIwIWZXgKjX2NiI/Px8xMbGwuVymV0dQgghhCggS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wTm/hXVcd/OI9RaYx4y1E5SUoLLTkQnZS/1LEBoBkaGhowd+5c7N27F6GhoVi5cqXf1scmDz30EEpLS5v/5eYakwKBNbWJUkXN+F9nQA6yzSrGJQKXlkITkRFtFVq68B9YE3iFFTt6cZv6m6rfrfqBfUVsaq0BqXxEvS6q1XIyIC+5GoYKfPxjHoeaiMmxXcCxsZfXIayq8n2StHyu5T5qud1uzJ8/Hx999BFCQkKwcuVKTJo0SdG+4eHhCA8P1/zawqCeVsXs0istancVdfsTHuisEgt9Hv45tgWwKTcfcGnZNl9aPtdyHzWagr/Vq1cjODgY77zzDn7xi19oKsvK7PKja8RMv2KbpCPYaVASWrV4TxzROkyA9/ACLbO
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataWithModulation.plot.errorbar(ax=ax)\n",
"# ax.set_xlim([0.5, 1])\n",
"# ax.set_ylim([0, 0.25])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"dataWithModulationFFT = fft(dataWithModulation)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHFCAYAAADv8c1wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABCaElEQVR4nO3dfXyT9b3/8feVpE2TJg0td6VYaJ3KjaCrgB4OcAbCuNExtzkHgjdnnKFnOs+Bg3jmbrDuDo6C7myK82YOPCJ30zOdjhtF/B1FUbnZFCm6AQHkTuSmaZs2bZPv74/YrJW2XEkLLfT1fDzyeFzN9yaf5tsk715JrssyxhgBAACgWY62LgAAAOBsQGgCAACwgdAEAABgA6EJAADABkIT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/vmbOnGl73lAopEAgoPwZK+RwexWcd3VSdQEAgDOv7vW7tLRUWVlZbVpLSnuaotGoJk6cqGAwqB49eujll19WRUWFwuGwli1bJr/fr61bt2rq1KlJz/2LX/wiEZhuu+02ffzxxyorK1NlZaU2bdqk4cOHKxaLadasWdq0aVMq5QMAACQtpdC0aNEivf/++5KkZ599VmPGjIlP5nBo0qRJevTRRyVJq1at0rp165Ka+6mnnpIkfelLX9LDDz+snj17JuYeNGiQXnzxRfl8Phlj9Oyzz6ZSPgAAQNJSCk2LFy+WJI0aNUpDhw49qX3y5MkqLCyU9PcQZNfBgwc
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"abs(dataWithModulationFFT).plot.errorbar(ax=ax, x='freq_x')\n",
"ax.set_xlim([0, 500])\n",
"# ax.set_ylim([0, 0.25])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Without Modulation"
]
},
{
"cell_type": "code",
"execution_count": 9,
"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'>&lt;xarray.DataArray &#x27;CH1&#x27; (x: 6000000)&gt;\n",
"array([0.501, 0.485, 0.473, ..., 0.501, 0.485, 0.477])\n",
"Coordinates:\n",
" * x (x) float64 0.0 2e-06 4e-06 6e-06 8e-06 ... 12.0 12.0 12.0 12.0</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'>'CH1'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 6000000</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-fe3719a9-f72c-43e4-a4f2-36d213e72f04' class='xr-array-in' type='checkbox' checked><label for='section-fe3719a9-f72c-43e4-a4f2-36d213e72f04' 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.501 0.485 0.473 0.465 0.469 0.477 ... 0.509 0.513 0.501 0.485 0.477</span></div><div class='xr-array-data'><pre>array([0.501, 0.485, 0.473, ..., 0.501, 0.485, 0.477])</pre></div></div></li><li class='xr-section-item'><input id='section-5397a53a-6e8e-42d7-9c49-a622d357f6f6' class='xr-section-summary-in' type='checkbox' checked><label for='section-5397a53a-6e8e-42d7-9c49-a622d357f6f6' 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'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 2e-06 4e-06 ... 12.0 12.0 12.0</div><input id='attrs-424b853b-629f-4f96-ae98-8b9c32ea38de' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-424b853b-629f-4f96-ae98-8b9c32ea38de' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3805d3f8-8130-48f7-a818-fedd5f92f304' class='xr-var-data-in' type='checkbox'><label for='data-3805d3f8-8130-48f7-a818-fedd5f92f304' 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.000000e+00, 2.000000e-06, 4.000000e-06, ..., 1.199999e+01,\n",
" 1.200000e+01, 1.200000e+01])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-21c608c9-9a05-41d1-b33b-fde7446732f7' class='xr-section-summary-in' type='checkbox' ><label for='section-21c608c9-9a05-41d1-b33b-fde7446732f7' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-c1452f30-9046-4fb4-9e30-f4bc2670a046' class='xr-index-data-in' type='checkbox'/><label for='index-c1452f30-9046-4fb4-9e30-f4bc2670a046' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ 0.0, 2e-06,\n",
" 4e-06, 6e-06,\n",
" 8e-06, 9.999999999999999e-06,\n",
" 1.2e-05, 1.4e-05,\n",
" 1.6e-05, 1.8e-05,\n",
" ...\n",
" 11.999979999999999, 11.999982,\n",
" 11.999984, 11.999986,\n",
" 11.999988, 11.999989999999999,\n",
" 11.999991999999999, 11.999994,\n",
" 11.999996, 11.999998],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;x&#x27;, length=6000000))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-2eb331e4-d81c-48b8-8452-b948b64c7a6f' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-2eb331e4-d81c-48b8-8452-b948b64c7a6f' 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 'CH1' (x: 6000000)>\n",
"array([0.501, 0.485, 0.473, ..., 0.501, 0.485, 0.477])\n",
"Coordinates:\n",
" * x (x) float64 0.0 2e-06 4e-06 6e-06 8e-06 ... 12.0 12.0 12.0 12.0"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filePath = r'F:\\Jianshun\\AccordionLatticeShorTermStability\\20230808\\withoutModulation.csv'\n",
"\n",
"data = read_csv_file(filePath, csvEngine='pandas', csvKwargs=dict(header=[0], skiprows=[1], encoding = \"ISO-8859-1\",))\n",
"dataWithoutModulation = xr.DataArray(\n",
" data=data.CH1[0,:],\n",
" dims=['x'],\n",
" coords=dict(\n",
" x=data.X[0,:].to_numpy() * 2e-6\n",
" )\n",
")\n",
"dataWithoutModulation"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnoAAAHGCAYAAADjSiafAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABZFElEQVR4nO3deXwTdf4/8NekTY80bVpAbmy5ikArQqnKJVRqBQVxReRyKXKI97oq/GRhocByF/0u64ULy6EoWvHmpgsiSGGLIFAqZ1NKoQItTY+0aZPM74+aMaVNmqTpkenr+XjkYch8Pp95Z5wkr04y8xFEURRBRERERLKjaOgCiIiIiKhuMOgRERERyRSDHhEREZFMMegRERERyRSDHhEREZFMMegRERERyRSDHhEREZFMMegRERERyRSDHhEREZFMeTd0AWSf2WzG1atXERgYCEEQGrocIiIicoAoiigsLETbtm2hUDTgcTXRwxQUFIjz588XIyIixICAADEoKEjs27evmJiYKBoMBpfGnD9/vgigxtv58+edGnfYsGFS38GDB7tUW1ZWlkO18cYbb7zxxhtvje+WlZXl0ue/u3jUEb3MzEwMGTIEWq0WAKBSqWAwGJCamorU1FRs3rwZycnJCAkJcWl8pVKJZs2a2Vzu7e345tqwYQN27tzpUh3WAgMDAQBZWVkICgqq9XhERERU9woKCtChQwfpc7yheEzQM5lMGDlyJLRaLdq0aYNNmzYhNjYWZrMZSUlJmD59Oo4fP46JEydi+/btLq2jf//+2L9/f61rzcnJwWuvvYbg4GC0adMG6enpLo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lKS9Fu54cOHVwljCQkJEAQBgiBIX7VaHDhwALGxsfj4449x5coV6fHy8nIkJydj0KBBUrCcN28egoOD6+5JUoMpLefvJomISH68G7oAR3l7e+Pbb79FTEwMtFotYmNjoVKpYDabUVpaCgDo3bs3Nm/e7NS4oigiOTlZCo7+/v4ICAiATqdDeXk5AEChUODNN9+s1YWQqfH6/uRVvPTJccwb0QNTBvKreSIikg+POaIHAGFhYTh58iTmzZuHiIgICIIApVKJqKgoJCYmIiUlBSEhIU6NGRkZicTERIwePRrh4eHw9/dHfn4+/P390atXL7z00ks4ceIEFi9eXEfPihraK59WTHG38PszDVwJERGRewliTT9SowZVUFAAjUYDnU7Ha+rVkU6zt8H8+6tAu+zRhi2GiIhkobF8fnvUET0iIiIichyDHhEREZFMMegRERERyRSDHhEREZFMMegRERERyRSDHhEREZFMMegRERERyRSDHhEREZFMMeiRW5SUNa65Ys1mkfPXEhFRk8egR7WWcikX3eftxLIdvzZ0KZJR7x5CxPxdKDIYa2xr5twwREQkUwx6VGuLt6UDAD744WIDV/KHU9k6GM0ijlzKbehSiIiIGgyDHhEREZFMMegRERERyRSDHtWaCP7IjYiIqDFi0CNZE5lBiYioCWPQIyIiIpIpBj0iIiIimWLQo1rj16NERESNE4MeyRozKBERNWUMekREREQyxaBHtdaUvrotM5pRbjI71PZWcVkdV0ONRbHBCIOxdnMr18d80QajCaZazPmnLzO6bQ7pxjY/NpFcMehRrZ25VtDQJdikL6t5rltHGU1m3L80GYOW74O5hg/Lf+49j96L9iDszW1uWz81TreKy9Bz/i50m7vT5RD1zYlsdJ+3Ext/0rq3OCul5Sbcs2APHv6/Ay737zFvF+76+04YHfxjx5bdaTnoPm9no5o2kUiuGPRI1n7OvOW2sXIKSpFXXIacglKU1nD05u2959y2XmrcvjmRLd3PLTK4NMZftpwAAMz/Ns0dJVXrVLYOJeUmXLhe5FL/VO0fr6XfCl17nhYzvzgJAFi249dajUNENWPQI1lrQt8qExERVcGgR0RERCRTDHoka0JDF0AkQ2JTOgOLyMMx6BERUY0E/tVE5JEY9IiIqF4xNBLVHwY9IiIiIpli0CNZE3jogMjt+BM9Is/BoEdERDXin0xEnolBj4ioFnhwy3kMjUT1h0GPHFZXc1NeLyyt9ZRKNblVXCbLuWfLjGZcuF6I6wWltZrDtLExmUXo9OVVHjebRafnWrW135aUmVBSZpL2jdJyk9OXDSktN+H2zW4yizh8MRfXC0odGu/2+sxmsUHmgb1924ribdv6tnR2TVeCjJvFVdrpy4y4UWjAzSIDtL8vP52tg9Fklp5XdVvFaDLj0o0iZOXpHa759u2Ury+T/r86qrS8cntRFHG9sBSXc/UoLC2HKIqV3jtKykwoN5lxo9CAW8VluFlkQMbNYlwvLK00rmW7WM8vXGWb2lBmNFd6TzSZxWrnUr597mLL2NbboKTMBLNZRGFpOYoNRun5WPZ3g9GEYkPlqSIt/S3j3f7asF6PMxx9jVm3KykzobC0vNIc45b6bn+eQMW2Ki2v6FNmNFeq18L6/4Mrr3tP493QBZBn+PLnK3jt81/wj8cj8PT9oW4b98n3f0Lq79OUZSx9xC2/qbN+gzxzrQB/XncEP56/CQB4JLI13psYZbNvmdEMH+/q//6Z9fu0TQBQbDBB5dPwL5/wuTsq/Vu77NEGqsS9Ov9tOwBg2ysD0bOtRnr8T+8dwumrBTg+7yEE+SlrHOeXrHyMevcQ4vuFYsGoCOnxfWev45n1/6vS/vF72uL/xvV2qMZ8fRnuWbin0mP6MhPu/b12ALizmQoHZsXYHOPDAxexZHvlacA6/d7/b4/chWcf6OxQLY6wDs6l5Sb4Kb0qLX/yg59wPCsfJ/4eB41KiWc/OoY9Z37DoTcfRLtgf+gNf3xYTtuYirO/FVbq/9ObD+LH8zfw/7aeslvHX4Z2Rb5VLcP+7wB2vvoAusxxbl/++ng2Xv3sBBaN6ok/9wvD1fwS9F/2X2n5sw90wt8e6W53jOz8Egz4vY+
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dataWithoutModulation.plot.errorbar()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"dataWithoutModulation = dataWithoutModulation - dataWithoutModulation.mean()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAo8AAAHECAYAAABY58BJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABW2UlEQVR4nO3deXxU9b3/8fdkz2SSsCiEPSgQlkTEgIqAkEJZBNSWchVQUES86sWWgv7UFozWiijq7a1LK6CAIlRELUU2oaiAAhK1QEBUSAATAxIg+zpzfn/EGROSSc5MErLM6/l45MFkzvl+zncOZ2beOdvXYhiGIQAAAMAEv4buAAAAAJoOwiMAAABMIzwCAADANMIjAAAATCM8AgAAwDTCIwAAAEwjPAIAAMC0gIbuAC4+h8Oh9PR0hYeHy2KxNHR3AACACYZhKCcnR+3bt5efX8Pt/yM8+qD09HR16tSpobsBAAC8cPLkSXXs2LHBlk949EHh4eGSyja+iIiIBu4NAAAwIzs7W506dXJ9jzcUwqMPch6qjoiIIDwCANDENPQpZ1wwAwAAANMIjwAAADCN8AgAAADTCI8AAAAwjfAIAAAA0wiPAAAAMI3wCAAAANMIjwAAADCN8AgAAADTCI8AAAAwjfAIAAAA0wiPAAAAMI3wCNSTwhJ7Q3cBAIA6R3gE6sH6/enqOW+TXtuZ0tBdAQCgThEegXrwwKovJUlPrD/UwD0BAKBuER4BAABgGuERAAAAphEeAQAAYBrhEQAAAKYRHgEAAGAa4REAAACmER4BAABgGuERAAAAphEeAQAAYBrhEY1WQXHjGhva4TAYrxoA4PMIj2iUdh/LVK/5m/T0xq8buisuN720S7GPbVZuUWmN8zqMi9AhAAAaAOERjdKfPzgsSfrbx0cbuCc/O5CWpVKHoT3HMh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dr5/xJksVg09v926NiZPH01/5euz53CErv6PfGh2rUI0b/nDNM/v0rTb1d/pWExl+qjIz9Kkh4Z01MLqhkCckSvNtp6+LQkadLVnbTg11dobdL3mrPmP655Xr09XjPfSNKQ7pfojbuu0fx/HtSKz47rTzf10bx/JuuO66KVeGOfateJVDZ0Z/yTWzXwstZaNfPaGue77vLW6te5hV7a/vP450efukFLdhyr9Jqu7tpKe1PO6p3/Hqj5/0zWoR+yXdP+9T+DNf7Fna7XJ0mTF+/RZ8cyXdN+2butFk/tX+NraKp8ds9jfn6+du3aJansIpSqWCwWjR49WpK0ZcsW07WPHDmiEydOVFvbZrNpyJAhNdbOzMzUrFmzFBwcrFdffbVZXazx+7fLPkz++P7BOq27r9zY0yX2uvnrLyP75z0Ae1POuoKjJG04kFFt2xPV7PX49Gim6/G+1LO16CHMmrXqywq//+f7LNeePTOe+7DsSMHyz45XeP4RNwHn/a/STfftw5+CQXlfnTxf4ffqtidJlYKj2Wne+PibH12Pv7kg+EnSFyfOyzCkj78tm8/5+tbsOylJ+uzYz+v8wuAoSe8kfV9jcJSkv2z7tsLvX2dUrmXG7/7xlSRp3j/LxgN/bkvFo0KvfnKsxhpvf37S9PxPrD+kpzYcNt2/LeW2j29OlY0n7vwM2ZTs/nPo+3MFyiooUdr5ApX+tFfx64wcFZc69MXx8675ktPLxio/9mOepJ/HR3cGR0nVBkdJruAoSav2lq2L8sFRkma+kSRJrs/RFT+9l5zrfdmnqdUuw2nDwbLXXH47qnK+Az9IKltX5YOjJGXmFVX5mvamlH0eP7PpSIXgKEnz15V9ZzlfX/k+3Llsr6Sq38vNic+Gx8OHD8vhKNubFBsb63Y+57SMjAydPWvuy/3gwZ/
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"dataWithoutModulation.plot.errorbar(ax=ax)\n",
"# ax.set_xlim([0.5, 1])\n",
"# ax.set_ylim([0, 0.25])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"dataWithoutModulationFFT = fft(dataWithoutModulation)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAnwAAAHFCAYAAABowCR2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABPZElEQVR4nO3deXhU5f3//9ckZJsskwQMYU9Q2dGmEVtLYkWEiC3fUi3Wj1KUtkBpP1YpYqW1LLWKCKi/FqEWFLUqCGqtFVlksWURZLMIBLAkAWSVBCaZhGyT+/dHPjlNmMmQBJKQw/NxXXNdZ+a+3/fcZ45hXp45i8MYYwQAAADbCmruCQAAAKBxEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADbXqrkncKWoqKjQsWPHFB0dLYfD0dzTAQAAdWCMUUFBgdq3b6+goJa7n4zA10SOHTumTp06Nfc0AABAAxw5ckQdO3Zs7mk0GIGviURHR0uq/A8mJiammWcDAADqIj8/X506dbK+x1sqAl8TqfoZNyYmhsAHAEAL09IPx2q5P0YDAACgTgh8AAAANkfgAwAAsDkCHwAAgM0R+AAAAGyOwAcAAGBzBD4AAACbI/ABAADYHIEPAADA5gh8AAAANkfgAwAAsDkCHwAAgM0R+JpYcZm3uacAAACuMAS+JvbZ4bPNPQUAAHCFIfABAADYHIEPAADA5gh8AAAANkfgAwAAsDkCHwAAgM0R+AAAAGyOwAcAAGBzBD4AAACbI/ABAADYHIEPAADA5gh8AAAANkfgAwAAsLmLCnwFBQWaOnWq+vbtq6ioKLlcLvXr10+zZ89WaWnpRU3s5MmTmjBhgrp3766IiAjFx8crPT1dCxYskDHmgvUHDx7U2LFjlZycrPDwcCUkJCgjI0P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scu9dBsU+IwxJjs72yQlJVnhzel0mvDwcOt5SkqKycvL86m7UOAzxpht27aZ1q1bW/2io6NNSEiI9Xzw4MGmuLi41rktW7bMOJ1Oq7/L5TLBwcHW8wceeMBUVFT4rd2yZYu56qqrrL5V718VFKvWdenSpfX6vAh8AAC0PHYJfA2+Dl9SUpJ27dqlyZMnq0+fPnI4HAoJCVFqaqpmzZqlzZs3Ky4urkFjp6amas+ePRo/fryuvfZalZWVKTIyUmlpaZo/f76WL1+usLCwWuvvuOMO7dq1S6NHj1ZSUpLOnTun2NhYDRo0SG+//bYWLlxoXVT5fDfeeKMyMzP1xBNP6Jvf/Kbi4uJUVFSkyMhIXXfddRo/frw+//xz/eAHP2jQugEAADQ1hzHGNPckrgT5+flyuVxauSNLg1OSm3s6AACgDqq+v91ud4u+iQJ32gAAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAAAADZH4AMAALA5Ah8AAIDNEfgAAABsjsAHAABgcwQ+AAAAmyPwAQAA2ByBDwAAwOYIfAA
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"abs(dataWithoutModulationFFT).plot.errorbar(ax=ax, x='freq_x')\n",
"ax.set_xlim([0, 50e3])\n",
"# ax.set_ylim([0, 0.25])\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data analyse"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Transform intensity to phase"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"from Analyser.FitAnalyser import NewFitModel"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"def sine_with_offset(x, amplitude=1.0, frequency=1.0, shift=0.0, offset=0.0):\n",
" \"\"\"Return a sinusoidal function.\n",
"\n",
" sine(x, amplitude, frequency, shift) =\n",
" amplitude * sin(x*frequency + shift)\n",
"\n",
" \"\"\"\n",
" return amplitude*np.sin(x*frequency + shift) + offset"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"fitModel = NewFitModel(sine_with_offset)\n",
"fitAnalyser = FitAnalyser(fitModel, fitDim=1)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"params = fitAnalyser.fitModel.make_params()\n",
"params.add(name=\"amplitude\", value= 0.2, max=np.inf, min=0, vary=True)\n",
"params.add(name=\"frequency\", value= 1*2*np.pi, max=np.inf, min=0, vary=True)\n",
"params.add(name=\"shift\", value= np.pi/2, max=2*np.pi, min=0, vary=True)\n",
"params.add(name=\"offset\", value= 0, max=np.inf, min=-np.inf, vary=True)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
"# param = fitAnalyser.guess(dataWithModulation)\n",
"fitResult = fitAnalyser.fit(\n",
" dataWithModulation.where(-0.1<dataWithModulation).where(dataWithModulation<0.1), \n",
" params\n",
")\n",
"fitCurve = fitAnalyser.eval(fitResult, x=dataWithModulation.x)"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAm0AAAHECAYAAAB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FqiMg3U6pbiuaTvKfdAvI1zS5sJ5FDo1lU1pq3B7aimSVA73FiFnensSfUC8z3l79O7jqsFK2Rj6Z05CPz5ev+JyA8pD/Pt1ShtQXveWfnyA8rq39Ie0irFnGGVPGQ+Oqnt9kOKqBcp7kI20AZAByaO864w9Lmlz4UI8cpSb4ez3K8WeSFt5srcKKUnpBNtP0jF7dMpfsBbwZxWBspAk3aYrSeWNI9O7I+mvy2lPXpJUzudFj89w9mflsIcZn3Lak4/UuvZo9mR/Z9VQpUQUY49L2ly4EIt4X7aQLbRFgQTdxrqcJ0mynLuIE3vkjNKz0WnolSRfUKnZBpTH3abaQykBREmKlCG7Te8+BrQTeFntocenUu0px/zJZw+ZPxXgPi67Pfnms2uPinzKcTntKTNc0ubCWZAX0F8FBGuUr8ODlP+XM84rSdFOpRsDoJESXwAIZG1zelHIpKn4jTykpBwlAPIpJeEG5f+j5dhU8igBZA5Vij3q8yojKck7PuWYPxU2PvpDUaXYk/d9rxB7yjp/8pD+ctpTZrikzYWz6M8Skuqh2vd8Aa0OkNMvISFlgVqlcCxBuEwkKdqlkFdAO00C2iJVDhJJiDRjTxlJJFGvKsaejsL2lEMJIBs9/Y6Fy0gCKm18itlTzvlDbADKS0ry2lPG+RMt9rxcpc2FC7EgixBZlAiqykRKKs0eQpACtUpAu2pPmTYVukQEUdeA8rnbMmnNZU0/s3K6/8gzo8ennJsu+Z2hBu17lTY+5VSOVXuo+VOuQxFQwJ5KeF4V8n4Vm8/RzvJ1jSgTXNLmwlmQBYF
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"dataWithModulation.plot.errorbar(ax=ax)\n",
"fitCurve.plot.errorbar(ax=ax)\n",
"ax.plot([0, 12.5], [0.1, 0.1], 'r--')\n",
"ax.plot([0, 12.5], [-0.1, -0.1], 'r--')\n",
"plt.xlabel('t (s)')\n",
"plt.ylabel('PD signal (V)')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 39,
"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'>&lt;xarray.Dataset&gt;\n",
"Dimensions: ()\n",
"Data variables:\n",
" amplitude float64 0.2026\n",
" frequency float64 6.283\n",
" shift float64 3.003\n",
" offset float64 2.599e-06</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-0e946e25-39d4-48d4-b84f-54b7aa323331' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0e946e25-39d4-48d4-b84f-54b7aa323331' 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-11404388-0b91-434d-b3e5-b176cb78aa6d' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-11404388-0b91-434d-b3e5-b176cb78aa6d' 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-b374b4d9-7237-410f-968c-42131949e58b' class='xr-section-summary-in' type='checkbox' checked><label for='section-b374b4d9-7237-410f-968c-42131949e58b' class='xr-section-summary' >Data variables: <span>(4)</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>amplitude</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.2026</div><input id='attrs-1d120eea-f2d7-4e0a-b0b7-b9d724874cec' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1d120eea-f2d7-4e0a-b0b7-b9d724874cec' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ecd60395-5201-408b-996d-a7f4f2ff4c7e' class='xr-var-data-in' type='checkbox'><label for='data-ecd60395-5201-408b-996d-a7f4f2ff4c7e' 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.20263455)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>frequency</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>6.283</div><input id='attrs-a15c60eb-d28b-4a3b-9bc3-c5c266189e35' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-a15c60eb-d28b-4a3b-9bc3-c5c266189e35' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5829198a-541a-4384-a9d2-50d6d6a4ab16' class='xr-var-data-in' type='checkbox'><label for='data-5829198a-541a-4384-a9d2-50d6d6a4ab16' 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(6.28264352)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>shift</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>3.003</div><input id='attrs-34209ee8-ce22-4624-8824-91c47595ea3b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-34209ee8-ce22-4624-8824-91c47595ea3b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-61002a13-5e14-442e-9ae4-5521942dc934' class='xr-var-data-in' type='checkbox'><label for='data-61002a13-5e14-442e-9ae4-5521942dc934' 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(3.00276275)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>offset</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-pre
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: ()\n",
"Data variables:\n",
" amplitude float64 0.2026\n",
" frequency float64 6.283\n",
" shift float64 3.003\n",
" offset float64 2.599e-06"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"val = fitAnalyser.get_fit_value(fitResult)\n",
"val"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [],
"source": [
"def voltage_to_phase(voltage):\n",
" # voltage = (voltage - val.offset)\n",
" # voltage = voltage / val.amplitude\n",
" voltage_frac, b= np.modf(voltage.to_numpy())\n",
" voltage = xr.where(np.abs(voltage) > 1, np.arcsin(voltage_frac) + np.trunc(voltage) * np.pi, np.arcsin(voltage))\n",
" voltage = np.arcsin(voltage)\n",
" return voltage"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"def autocorr(x):\n",
" result = np.correlate(x, x, mode='full')\n",
" return result[len(result)//2:]"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
"def get_noise_spectrum(data):\n",
" data = data - data.mean()\n",
" dataAutoCorr = autocorr(data)\n",
" dataAutoCorr = xr.DataArray(\n",
" data=dataAutoCorr,\n",
" dims=['x'],\n",
" coords=dict(\n",
" x=data.x\n",
" )\n",
" )\n",
" \n",
" dataNoiseSpec = fft(dataAutoCorr)\n",
" \n",
" return dataNoiseSpec\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [],
"source": [
"phaseWithoutModulation = voltage_to_phase(dataWithoutModulation)"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAo8AAAHECAYAAABY58BJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAABJGklEQVR4nO3deXhTZf738U/SPU1bFkUWkSL7UhAKKgIKgiACoyM/RhFlE+XH+DAjD+jPFYvjyKCgz/xcR0AWQRFEHQbZBMEBFRVcgII4QgtILUqBrnRJcp4/amJKt5O0JW3zfl1Xrivtfe7vuc/pSfLpSXJui2EYhgAAAAATrIEeAAAAAOoOwiMAAABMIzwCAADANMIjAAAATCM8AgAAwDTCIwAAAEwjPAIAAMC00EAPABeey+VSWlqaYmJiZLFYAj0cAABggmEYys7OVvPmzWW1Bu78H+ExCKWlpally5aBHgYAAPDD8ePHdemllwZs/YTHIBQTEyOp+OCLjY0N8GgAAIAZWVlZatmyped1PFAIj0HI/VZ1bGws4REAgDom0B854wszAAAAMI3wCAAAANMIjwAAADCN8AgAAADTCI8AAAAwjfAIAAAA0wiPAAAAMI3wCAAAANMIjwAAADCN8AgAAADTCI8AAAAwjfAIAAAA0wiPQA3JL3IGeggAAFQ7wiNQA9btTVPHxzfq9Z0pgR4KAADVivAI1IA/vfW1JOnJdQcCPBIAAKoX4REAAACmER4BAABgGuERAAAAphEeAQAAYBrhEQAAAKYRHgEAAGAa4REAAACmER4BAABgGuERAAAAphEeUWsVOGrX3NAul6FChyvQwwAAIKAIj6iVdqeeVofHNuq5zYcCPRSPP/zjM/V4crNyCxyVLusyLsCAAAAIAMIjaqXZ/yqeE/p/P/ohwCP5ze6jZ5Rb6NSuIxmBHgoAAAFDeAQAAIBphEcAAACYRnhErWSIDw0CAFAbER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n9XN2gXan/nY87TtxVmmZ+Z5jzv1Y8X6eeujdfeUGR0me4ChJr/37iCSVCI6SNHbh58opcOhf3xaP+aVth+V0Gbr/7W/kdBl64aOSj63yrN2bpux8R4nn/DKX+/aEsgscWr8vvURwlKRTuQWlgqMkfbD3J7kM6S/rDpQIjpL0P2v2yuEy9I9ft0/69e9Q4NDtr+1SfpGrxH6ojwiPAIAaVZ8+/gCA8AgAAAAfEB6BWoKTM0Ddx2Vga58Kn1p53vUL4REAfHCh34I16vGrG/8wAXUT4RH1GmcBcKHU55BnRkVBkJCIYBEsxzrhEQBQo4IpWFvq2OXKg+lvg+pDeAQAAPVWhWfFL9ww6hXCIwCgRpWeMScw4/AVZ+VQlrp1brlmEB6BWoKXKZSlrr0NGuzq8ues60qoR+AxPSGqXYHDqfwil0KsFoWFWGS1WGQYksNV/DuHs/T/82dyCxUealV0RGiJKc/c3HO8hoVYFBpi1blCp6LCi6fUyi9yqsBRXDvq12m23PIKnAoPNVTodCk8xKoQq0WFTpciQ60qchqyWotfnA0ZCrVai8doKV5GkqwWi0KtFuWVMcesN4fTpbwip0KtxdvrrawXkwKHUyHnNWTkFKjA4dS5Qqciw0JktVhU5HTJFh5SaorFrPwi2X+dSs9qtcgwDBU5DZ0rcioyzCqrxaJCh0thv06L6N5+h8ulc4VORUeEyukyFBry23KhVotn9glv+b9ul8NlKDIsRPlFToWHWOUyDDnPe7VxugzPuGMiw8qdmtFdU5JCQ6wllnM4XXIahiJCQ36dI/fXuWRdLkWEhujXbsotdKrQ4VJsVPG2uENWToFD4aFWWS1STGSYMvOKSpwqcDgNz/73noEov8ip3AKHLBbJ4TIUGxkmp8uQw1U8BvffNjv
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"(phaseWithoutModulation/np.pi).plot.errorbar(ax=ax)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
"noiseWithoutModulation = get_noise_spectrum(phaseWithoutModulation)"
]
},
{
"cell_type": "code",
"execution_count": 55,
"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'>&lt;xarray.DataArray (freq_x: 6000000)&gt;\n",
"array([0.00146663-2.99062180e-13j, 0.00146904+2.91230736e-06j,\n",
" 0.00146276+5.40701190e-06j, ..., 0.00146716+7.80786951e-06j,\n",
" 0.00146276-5.40701190e-06j, 0.00146904-2.91230736e-06j])\n",
"Coordinates:\n",
" * freq_x (freq_x) float64 -2.5e+05 -2.5e+05 -2.5e+05 ... 2.5e+05 2.5e+05</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'></div><ul class='xr-dim-list'><li><span class='xr-has-index'>freq_x</span>: 6000000</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-8af54559-f573-490b-a117-c7aa63419946' class='xr-array-in' type='checkbox' checked><label for='section-8af54559-f573-490b-a117-c7aa63419946' 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.0014666294599858997-2.9906217954251947e-13j) ... (0.001469035917...</span></div><div class='xr-array-data'><pre>array([0.00146663-2.99062180e-13j, 0.00146904+2.91230736e-06j,\n",
" 0.00146276+5.40701190e-06j, ..., 0.00146716+7.80786951e-06j,\n",
" 0.00146276-5.40701190e-06j, 0.00146904-2.91230736e-06j])</pre></div></div></li><li class='xr-section-item'><input id='section-f9cdbaba-091e-43bc-9be8-5d807bf3e21c' class='xr-section-summary-in' type='checkbox' checked><label for='section-f9cdbaba-091e-43bc-9be8-5d807bf3e21c' 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'>freq_x</span></div><div class='xr-var-dims'>(freq_x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-2.5e+05 -2.5e+05 ... 2.5e+05</div><input id='attrs-c95594e6-a8a2-40ed-82c2-baa1acc0597d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-c95594e6-a8a2-40ed-82c2-baa1acc0597d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ec813544-e010-40ae-8dd8-bedc0ddbd5b1' class='xr-var-data-in' type='checkbox'><label for='data-ec813544-e010-40ae-8dd8-bedc0ddbd5b1' 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>spacing :</span></dt><dd>0.08333333334303461</dd><dt><span>direct_lag :</span></dt><dd>6.0</dd></dl></div><div class='xr-var-data'><pre>array([-250000. , -249999.916667, -249999.833333, ..., 249999.75 ,\n",
" 249999.833333, 249999.916667])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-b98ca7ef-738d-46b9-9d88-6de529f88bbb' class='xr-section-summary-in' type='checkbox' ><label for='section-b98ca7ef-738d-46b9-9d88-6de529f88bbb' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>freq_x</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-3af2a7d6-d077-46e3-a60c-a7b786e143b8' class='xr-index-data-in' type='checkbox'/><label for='index-3af2a7d6-d077-46e3-a60c-a7b786e143b8' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ -250000.0, -249999.91666666666, -249999.8333333333,\n",
" -249999.75, -249999.66666666666, -249999.5833333333,\n",
" -249999.5, -249999.41666666666, -249999.3333333333,\n",
" -249999.25,\n",
" ...\n",
" 249999.16666666666, 249999.25, 249999.3333333333,\n",
" 249999.41666666666, 249999.5, 249999.5833333333,\n",
" 249999.66666666666, 249999.75, 249999.8333333333,\n",
" 249999.91666666666],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;freq_x&#x27;, length=6000000))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3e3ebfd1-e26b-45b5-9eb4-c87263ca6f2a' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3e3ebfd1-e26b-45b5-9eb4-c87263ca6f2a' 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 (freq_x: 6000000)>\n",
"array([0.00146663-2.99062180e-13j, 0.00146904+2.91230736e-06j,\n",
" 0.00146276+5.40701190e-06j, ..., 0.00146716+7.80786951e-06j,\n",
" 0.00146276-5.40701190e-06j, 0.00146904-2.91230736e-06j])\n",
"Coordinates:\n",
" * freq_x (freq_x) float64 -2.5e+05 -2.5e+05 -2.5e+05 ... 2.5e+05 2.5e+05"
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"noiseWithoutModulation"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAHPCAYAAABOau4WAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAuI0lEQVR4nO3de3RU9b3//9ckIZOEXLgTrgG1cimIlIKlwO+IFxB7XKJ+e1RArXqQeo6tUglKdXFprSgX9Sw9WA4qeKxiqdr2CAup3NpysYhQLy0XhUTCHQK5ETIhmc/vj6xsJ2Qy+WQymT1Jno+1Zq2Z2fsz+z37kz3zyt579sdjjDECAABASHFuFwAAANAcEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsEJoAAAAsRCw0PfPMM/J4PM4NAACgJfFEYuy5ffv26corr1RZWZnzHEPaAQCAlqTRe5r8fr/uv/9+lZWVaeTIkZGoCQAAIOY0OjS9+OKL2rp1qyZPnqxx48ZFoiYAAICY06jQlJOToyeeeEIdO3bU888/H6maAAAAYk5CYxpPnTpV586d05IlS9S5c+dI1QQAABBzwt7TtGzZMm3YsEHXXXed7r777kjWBAAAEHPC2tN05MgRZWdnKzk5WUuXLg174T6fTz6fz3ns9/t15swZdezYkcsWAADQTBhjVFxcrO7duysuruVeAjKs0DRt2jQVFhbq2Wef1SWXXBL2wufPn6958+aF3R4AAMSOvLw89ezZ0+0ymkyDQ9NvfvMbrVmzRldeeaV+9rOfNWrhs2bNqvEahYWF6t27t/Ly8pSent6o10bzMGjOOuf+F/PGu1gJACBcRUVF6tWrl9LS0twupUk1KDSdPHlSjzzyiOLj47Vs2TIlJDTqPHJ5vV55vd5az6enpxOaWok4b4pznz4HgOatpZ9a06DU89hjjyk/P18PPvig+vfvr5KSkhrTy8vLnfvV0xITE5WYmBiBUgEAANzToLO1cnJyJEkvv/yy0tLSat3mz5/vzFv93MyZMyNbMQAAgAta7inuAAAAEdSg0LR582YZY+q8zZkzx5m3+rkXXngh0jUDAABEHXuaAAAALBCaAAAALBCaAAAALEQ0NM2dO9c5lwkAAKAlYU8TAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACABUITAACAhYRwGu3atUvvv/++PvnkE+3fv1+nTp1SUVGR0tPT1b9/f91444168MEH1aFDh0jXCwAA4IqwQtNrr72m//7v/3YeJyUlKTk5WWfOnNG2bdu0bds2vfDCC/q///s/jRw5MmLFAgAAuCWsw3MjRozQwoULtX37dp09e1bnz59XUVGRiouLtWLFCnXu3FmnT5/WxIkTVVhYGOmaAQAAoi6sPU1333130OdTU1N1zz33qFu3bho/frxOnjyp1atXa/LkyY0qEgAAwG1NciL49773Pef+4cOHm2IRAAAAUdUkoemvf/2rc//SSy9tikUAAABEVViH54Lx+Xw6duyYVq9erdmzZ0uSLrvsMt10002RWgQAAIBrGh2akpKS5PP5aj0/atQovfXWW/J6vY1dBAAAgOsaHZoyMzNVVlamkpISnTt3TpI0duxYLViwQL179w7Z1ufz1QhcRUVFjS0HAACgSTT6nKbc3FwdP35cJSUlOnHihBYtWqS///3vGjFihHOYri7z589XRkaGc+vVq1djywEAAGgSHmOMifSL7tixQyNHjpTf79f777+vf/3Xfw06X7A9Tb169VJhYaHS09MjXRZiUJ/H1zj3c5/5gYuVAADCVVRUpIyMjBb//d0kv54bMWKERo8eLUn6n//5nzrn83q9Sk9Pr3EDAACIRU02YG+PHj0kSV999VVTLQIAACBqmiw0HTx4UJKUlpbWVIsAAACImgaHpsrKStV3GtSGDRu0Y8cOSdLVV18dVmEAAACxpMGhKS8vT0OHDtXSpUt18ODBGgEqLy9PzzzzjG6++WYZY9ShQwdNnz49ogUDAAC4IazrNH366af68Y9/LElKTExUenq6zp8/71ynSZL69u2rd999V5mZmZGpFAAAwEUNDk3du3fXqlWrtHnzZv3tb3/TsWPHdPr0acXHx6t3794aMmSIbr75Zk2aNEnJyclNUTMAAEDUNTg0JSYm6oc//KF++MMfNkU9AAAAManJfj0HAADQkhCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALBCaAAAALIQVmvLz87V8+XJNmTJFAwcOVNu2beX1etWzZ09NnDhRv//97yNdJwAAgKsSwmmUmZmpiooK53FSUpLatGmjI0eO6MiRI/rjH/+oCRMm6J133lFKSkrEigUAAHBLWHuaKioqNGLECC1ZskQHDhzQ+fPnVVJSopycHN1///2SpLVr12ratGkRLRYAAMAtYe1p2rhxo8aOHVvr+T59+uiVV15RQkKCli5dqt/85jd6+umn1atXr0YXCgAA4Kaw9jQFC0yBqvc2SdLOnTvDWQQAAEBMaZJfzyUlJTn3Kysrm2IRAAAAUdUkoWnz5s3O/cGDBzfFIgAAAKIqrHOaQikoKND8+fMlSWPGjFG/fv3qnNfn88nn8zmPi4qKIl0OAABARER0T5Pf79ddd92lY8eOyev16sUXXww5//z585WRkeHcOGEcAADEqoiGpocfflirV6+WJC1ZskRDhgwJOf+sWbNUWFjo3PLy8iJZDgAAQMRE7PDcjBkz9NJLL0mSnn/+ed133331tvF6vfJ6vZEqAQAAoMlEZE/TzJkztXjxYknSwoUL9cgjj0TiZQEAAGJGo/c0ZWdna9GiRZKkBQsWaMaMGY0uCgAAINY0KjTNmDHD2cO0YMECZWdnR6QoAACAWBN2aAoMTIsWLdKjjz4asaIAAABiTVih6bHHHnMC03PPPafp06dHtCgAAIBY0+ATwQ8dOqQFCxZUNY6L07PPPqvMzMw6b9X
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure()\n",
"ax = fig.gca()\n",
"\n",
"abs(noiseWithoutModulation).plot.errorbar(ax=ax)\n",
"\n",
"# plt.xlim([25, 100e3])\n",
"plt.xlim([0, 250e3])\n",
"plt.ylim([0, 4])\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"250.0\n",
"0.08333333333333333\n"
]
}
],
"source": [
"dt = 2e-6\n",
"samplingFreq = 1/ dt\n",
"blockLength = 6e6\n",
"df = samplingFreq / blockLength\n",
"print(samplingFreq / 2 / 1e3)\n",
"print(df)"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[5, 4, 3, 2, 1, 0]\n"
]
}
],
"source": [
"print(list(range(5, -1 ,-1)))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}