from ipywidgets import interact, interactive, FloatSlider, IntSlider, ToggleButtons
from em_examples.TDEMInductiveSource import *
%pylab inline
Populating the interactive namespace from numpy and matplotlib
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.
Two inductive sources are considered:
Using below widget, you can choose a model that you want to explore.
Q = interact(choose_source,
src_type=ToggleButtons(
options=["VMD", "HMD"], value="VMD"
)
)
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
Then here we are going to load results. If you want to rerun, you can set re_run
as True
.
With that option, you can change conductivity value of the block and halfspace you can alter a value for sigma_halfspace
.
import matplotlib
matplotlib.rcParams['font.size']=16
options = load_or_run_results(
re_run=False,
fname=choose_source(Q.widget.kwargs['src_type']),
src_type=Q.widget.kwargs['src_type'],
sigma_halfspace=0.01
)
tdem = PlotTDEM(**options)
file already exists, new file is called /Users/sgkang/Projects/em_apps/notebooks/tdem_inductivesource.tar Downloading https://storage.googleapis.com/simpeg/em_examples/tdem_inductivesource/tdem_inductivesource.tar saved to: /Users/sgkang/Projects/em_apps/notebooks/tdem_inductivesource.tar Download completed!
interact(
tdem.show_3d_survey_geometry,
elev=FloatSlider(min=-180, max=180, step=10, value=30),
azim=FloatSlider(min=-180, max=180, step=10, value=-45),
)
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
<function ipywidgets.widgets.interaction._InteractFactory.__call__.<locals>.<lambda>>
interact(
tdem.plot_input_currents,
itime=IntSlider(min=15, max=50, step=1, value=15, contiusous_update=False),
scale=ToggleButtons(
options=["linear", "log"], value="linear"
),
)
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
<function ipywidgets.widgets.interaction._InteractFactory.__call__.<locals>.<lambda>>
interact(
tdem.plot_electric_currents,
itime=IntSlider(min=10, max=50, step=2, value=10, contiusous_update=False)
)
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
<function ipywidgets.widgets.interaction._InteractFactory.__call__.<locals>.<lambda>>
interact(
tdem.plot_magnetic_flux,
itime=IntSlider(min=10, max=50, step=2, value=10, contiusous_update=False)
)
Failed to display Jupyter Widget of type interactive
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
<function ipywidgets.widgets.interaction._InteractFactory.__call__.<locals>.<lambda>>