{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import interact, interactive, FloatSlider, IntSlider, ToggleButtons\n", "from geoscilabs.em.TDEMGroundedSource import choose_model, load_or_run_results, PlotTDEM" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Exploring fields from a grounded source" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Purpose\n", "\n", "We explore time-domain electromagnetic (EM) simulation results from a grounded source. Both electric currents and magnetic flux will be visualized to undertand physics of grounded source EM. Both charge buildup (galvanic) and EM induction (inductive) will occur at different times. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load simulation results (or run)\n", "\n", "Three models are considered here. \n", "\n", "- Halfspace (0.01 S/m)\n", "- Conductive block in halfspace (1 S/m)\n", "- Resitive block in halfspace (10$^{-4}$ S/m)\n", "\n", "Using below widget, you can choose a model that you want to explore. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Q = interact(choose_model, \n", " model=ToggleButtons(\n", " options=[\"halfspace\", \"conductor\", \"resistor\"], value=\"halfspace\"\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 values for `sigma_halfspace` and `sigma_block`." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib\n", "matplotlib.rcParams['font.size']=16\n", "options = load_or_run_results(\n", " re_run=False, \n", " fname=choose_model(Q.widget.kwargs['model']),\n", " sigma_block=0.01,\n", " sigma_halfspace=0.01\n", ")\n", "tdem = PlotTDEM(**options)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "interact(\n", " tdem.show_3d_survey_geometry, \n", " elev=FloatSlider(min=-180, max=180, step=10, value=30),\n", " azim=FloatSlider(min=-180, max=180, step=10, value=-45),\n", ");\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "interact(\n", " tdem.plot_input_currents, \n", " itime=IntSlider(min=15, max=50, step=1, value=15, continuous_update=False),\n", " scale=ToggleButtons(\n", " options=[\"linear\", \"log\"], value=\"linear\"\n", " ), \n", ");" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "interact(\n", " tdem.plot_electric_currents, \n", " itime=IntSlider(min=15, max=50, step=1, value=15, continuous_update=False)\n", ");" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "interact(\n", " tdem.plot_magnetic_flux, \n", " itime=IntSlider(min=15, max=50, step=1, value=15, continuous_update=False)\n", ");" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "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.8.10" } }, "nbformat": 4, "nbformat_minor": 1 }