{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "from ipywidgets import interact, interactive, FloatSlider, IntSlider, ToggleButtons\n", "from em_examples.TDEMInductiveSource import *\n", "%pylab inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Exploring fields from inductive sources" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Purpose\n", "\n", "We explore time-domain electromagnetic (EM) simulation results from inductive sources. Both electric currents and magnetic flux will be visualized to undertand physics of inductive source EM. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load simulation results (or run)\n", "\n", "Two inductive sources are considered:\n", "\n", "- Vertical magnetic dipole(VMD)\n", "- Horizontal magnetic dipole(HMD)\n", "\n", "Using below widget, you can choose a model that you want to explore. " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f397115717fc4ea9b400ca336d753df3", "version_major": 2, "version_minor": 0 }, "text/html": [ "
Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(ToggleButtons(description='src_type', options=('VMD', 'HMD'), value='VMD'), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Q = interact(choose_source, \n", " src_type=ToggleButtons(\n", " options=[\"VMD\", \"HMD\"], value=\"VMD\"\n", " )\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then here we are going to load results. If you want to rerun, you can set `re_run` as `True`. \n", "With that option, you can change conductivity value of the block and halfspace you can alter a value for `sigma_halfspace`." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "file already exists, new file is called /Users/sgkang/Projects/em_apps/notebooks/tdem_inductivesource.tar\n", "Downloading https://storage.googleapis.com/simpeg/em_examples/tdem_inductivesource/tdem_inductivesource.tar\n", " saved to: /Users/sgkang/Projects/em_apps/notebooks/tdem_inductivesource.tar\n", "Download completed!\n" ] } ], "source": [ "import matplotlib\n", "matplotlib.rcParams['font.size']=16\n", "options = load_or_run_results(\n", " re_run=False, \n", " fname=choose_source(Q.widget.kwargs['src_type']),\n", " src_type=Q.widget.kwargs['src_type'],\n", " sigma_halfspace=0.01\n", ")\n", "tdem = PlotTDEM(**options)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "scrolled": false }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "98f00dd3bfcb4bb88ab7989c9386d7b5", "version_major": 2, "version_minor": 0 }, "text/html": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(FloatSlider(value=30.0, description='elev', max=180.0, min=-180.0, step=10.0), FloatSlider(value=-45.0, description='azim', max=180.0, min=-180.0, step=10.0), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=15, description='itime', max=50, min=15), ToggleButtons(description='scale', options=('linear', 'log'), value='linear'), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=10, description='itime', max=50, min=10, step=2), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Failed to display Jupyter Widget of type interactive
.
\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "
\n", "\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "
\n" ], "text/plain": [ "interactive(children=(IntSlider(value=10, description='itime', max=50, min=10, step=2), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "