{ "cells": [ { "cell_type": "markdown", "id": "e7d80e29-3aec-4498-a73f-e3eb6a77cd7d", "metadata": {}, "source": [ "# Reconstruct the voltage from the field probes" ] }, { "cell_type": "markdown", "id": "e246d25e-094b-461e-9221-27060f5c2051", "metadata": {}, "source": [ "In this notebook we show how, from the voltage measured by some electric field probes, we can reconstruct the voltage in the whole transmission line." ] }, { "cell_type": "markdown", "id": "af15b810-5f64-4884-bb01-13e6acf30afa", "metadata": {}, "source": [ "## Load data" ] }, { "cell_type": "code", "execution_count": 1, "id": "e943830e-0048-4fd4-94d1-dccfab7e3cff", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "ERROR:root:column_header = 'NI9205_E1' not present in provided file. Skipping associated instrument.\n" ] } ], "source": [ "from IPython.display import HTML\n", "import matplotlib.pyplot as plt\n", "\n", "from multipac_testbench import MultipactorTest\n", "from multipac_testbench.data import config_path\n", "from multipac_testbench.data.multipactor_tests import test_140MHz_SWR4_11\n", "from multipac_testbench.instruments import IElectricField\n", "\n", "multipactor_test = MultipactorTest(test_140MHz_SWR4_11, config_path, freq_mhz=140.0, swr=4.0, is_raw=True)" ] }, { "cell_type": "markdown", "id": "05b0cebb-ab7c-4c4f-879f-10e7f33aaf8e", "metadata": {}, "source": [ "## Fit the electric field theoretical law on the voltage signals" ] }, { "cell_type": "code", "execution_count": 2, "id": "a52ff1f5-1043-469a-ad51-b34a8f54e26a", "metadata": {}, "outputs": [], "source": [ "multipactor_test.reconstruct_voltage_along_line(name=\"reconstruct\")" ] }, { "cell_type": "markdown", "id": "4f96cc12-6a04-4481-ba0f-dfe12e1dcb7b", "metadata": {}, "source": [ "## Plot electric field at every position" ] }, { "cell_type": "code", "execution_count": 3, "id": "da0754e2-fc51-4b0c-9140-1ac032806d7a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " \n", "
\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fps = 50\n", "ani = multipactor_test.animate_instruments_vs_position(\n", " (IElectricField,),\n", " fps=fps,\n", " keep_one_frame_over=10,\n", ")\n", "plt.close()\n", "HTML(ani.to_jshtml(fps=fps))" ] }, { "cell_type": "raw", "id": "226c737a-4bda-4d2a-82bc-b029e8736e87", "metadata": { "editable": true, "raw_mimetype": "text/restructuredtext", "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ ".. todo::\n", " Find out why correlation electric field vs power is so bad...\n", " In previous campaign, we had:\n", "\n", " .. image:: ../images/old-fit.png\n", " :width: 400\n", " :alt: Old fit" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.2" } }, "nbformat": 4, "nbformat_minor": 5 }