{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# IMPORT PACKAGES\n", "from em_examples import UXO_TEM_Widget as UXO\n", "from IPython.display import display\n", "from ipywidgets import HBox" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Contents\n", "\n", "This app contains 3 widgets:\n", "\n", "* **Orientation and polarization widget:** This widget allows the user to visualize the orientation, infer the dimensions and change the polarizabilities of compact objects they wish to model.\n", "* **Data visualization widget:** This widget allows the user to visualize the step-off response of compact objects using three commonly used instruments: EM61, TEMTADS, and MPV.\n", "* **Parameter estimation widget:** This widget allows the user to invert synthetic data collected using EM61, TEMTADS or MPV instruments in order to recover the location and primary polarizabilities for a compact object.\n", "\n", "\n", "# Background Theory\n", "\n", "## Polarization Tensor\n", "\n", "The magnetic dipole moment ${\\bf m}$ being experienced by a compact object is given by:\n", "\n", "\\begin{equation}\n", "\\mathbf{m = Q \\, h_p}\n", "\\end{equation}\n", "\n", "where ${\\bf h_p} = [h_x,h_y,h_z]^T$ is the primary magnetic field caused by the transmitter before shut-off and ${\\bf Q}$ is the called the **polarizability tensor**. The polarizability tensor is a 3X3 symmetric, positive-definite (SPD) matrix given by:\n", "\n", "\\begin{equation}\n", "{\\bf Q} = \\begin{bmatrix} q_{11} & q_{12} & q_{13} \\\\ q_{12} & q_{22} & q_{23} \\\\ q_{13} & q_{23} & q_{33} \\end{bmatrix}\n", "\\end{equation}\n", "\n", "where $q_{ij}$ defines hows strongly field component $h_i$ contributes towards $m_j$.\n", "\n", "\n", "\n", "## Coordinates and Primary Polarizations\n", "\n", "The polarizability tensor for an object depends on its orientation, dimensions and electromagnetic properties. Because the polarizability tensor is SPD, it can be decomposed using the following eigen-decomposition:\n", "\n", "\\begin{equation}\n", "{\\bf Q = A \\, L(t) \\, A^T}\n", "\\end{equation}\n", "\n", "where\n", "\n", "\\begin{equation}\n", "{\\bf A} = \\begin{bmatrix} a_{11} & a_{12} & a_{13} \\\\ a_{12} & a_{22} & a_{23} \\\\ a_{13} & a_{23} & a_{33} \\end{bmatrix} \\;\\;\\;\\; \\textrm{and} \\;\\;\\;\\;\n", "{\\bf L(t)} = \\begin{bmatrix} L_{x'}(t) & 0 & 0 \\\\ 0 & L_{y'}(t) & 0 \\\\ 0 & 0 & L_{z'}(t) \\end{bmatrix}\n", "\\end{equation}\n", "\n", "${\\bf A}$ is a SPD rotation matrix from the coordinate system defined by the UXO ($x',y',z'$) to the field coordinate system ($x,y,z$). ${\\bf A}$ is defined by three angles: $\\psi,\\theta$ and $\\phi$. $\\theta$ is the azimuthal angle (angle relative to vertical), $\\phi$ is the declination (angle relative to North) and $\\psi$ is the roll (rotation about z' axis). \n", "\n", "${\\bf L(t)}$ characterizes the primary polarizabilities of the object. The magnetic dipole moment experienced by the object is a linear combination of polarizabilities $L_{x'},L_{y'}$ and $L_{z'}$. Depending on the dimensions and of the object, $L_{x'},L_{y'}$ and $L_{z'}$ may differ. For example:\n", "\n", "* A sphere has primary polarizabilities $L_{x'}=L_{y'}=L_{z'}$\n", "* A UXO has primary polarizabilities $L_{x'}=L_{y'}0$ is given by:\n", "\n", "\\begin{equation}\n", "L_{ii}(t) = k_i \\Bigg ( 1 + \\frac{t^{1/2}}{\\alpha_i^{1/2}} \\Bigg )^{-\\beta_i} e^{-t/\\gamma_i}\n", "\\end{equation}\n", "\n", "where the decay of the object's polarization is determined by parameters $k_i,\\alpha_i,\\beta_i$ and $\\gamma_i$.\n", "\n", "\n", "\n", "## Predicting Data\n", "\n", "There are a multitude of instruments used to measure the time-domain responses exhibited by UXOs (EM61, TEMTADS, MPV). For each individual measurement, a transmitter loop produces a primary magnetic field ${\\bf h_p} = [h_x,h_y,h_z]^T$ which is turned off a $t=0$. The primary field polarizes the UXO according to its polarizability tensor ${\\bf Q}$. The polarization of the object produces a secondary field which induces an EMF in one or more receiver coils. The field component being measured by each receiver coil depends on its orientation.\n", "\n", "Where ${\\bf G} = [g_x,g_y,g_z]$ maps the dipole moment experienced by the object to the induced voltage in a receiver coil:\n", "\n", "\\begin{equation}\n", "d = {\\bf G \\, m} = {\\bf G \\, Q \\, h_p}\n", "\\end{equation}\n", "\n", "Because it is SPD, the polarizability tensor may be characterized at each time by 6 parameters $(q_{11},q_{12},q_{13},q_{22},q_{23},q_{33})$. The previous expression can ultimately be reformulated as:\n", "\n", "\\begin{equation}\n", "d = {\\bf P \\, q}\n", "\\end{equation}\n", "\n", "where\n", "\n", "\\begin{equation}\n", "{\\bf q^T} = [q_{11} \\;\\; q_{12} \\;\\; q_{13} \\;\\; q_{22}\\;\\; q_{23} \\;\\; q_{33}]\n", "\\end{equation}\n", "\n", "and\n", "\n", "\\begin{equation}\n", "{\\bf P} = [h_xg_x \\;\\; h_xg_y \\!+\\! h_yg_x \\;\\; h_xg_z \\!+\\! h_zg_x \\;\\; h_zg_y \\;\\; h_yg_z \\!+\\! h_zg_y \\;\\; h_zg_z]\n", "\\end{equation}\n", "\n", "Thus in the case that there are $N$ distinct transmitter-receiver pair, each transmitter-receiver pair is represented as a row within ${\\bf P}$. ${\\bf q}$ contains all the necessary information to construct ${\\bf Q}$ and ${\\bf P}$ contains all the geometric information associated with the problem.\n", "\n", "## Inversion and Parameter Estimation\n", "\n", "When inverting field-collected UXO data there are two primary goals:\n", "\n", "* Accurate location of a target object (recover $x,y,z$)\n", "* Accurate characterization of a target object (by recovering $L_{x'},L_{y'},L_{z'}$)\n", "\n", "For this widget, we will accomplish these goals in two steps.\n", "\n", "### Step 1\n", "\n", "In step 1, we intend to recover the location of the target $(x,y,z)$ and the elements of the polarizability tensor $(q_{11},q_{12},q_{13},q_{22},q_{23},q_{33})$ at each time. A basic approach is applied by finding the location and polarizabilities which minimize the following data misfit function:\n", "\n", "\\begin{equation}\n", "\\begin{split}\n", "\\Phi &= \\sum_{i=k}^K \\Big \\| {\\bf W_k} \\big ( {\\bf P \\, q_k - d_{k,obs}} \\big ) \\Big \\|^2 \\\\\n", "& \\textrm{s.t.} \\\\\n", "& q_{min} \\leq q_{ij}(t) \\leq q_{max} \\\\\n", "& q_{ii}(t) \\geq 0 \\\\\n", "& \\big | q_{ij}(t) \\big | \\leq \\frac{1}{2} \\big ( \\; \\big | q_{ii}(t) \\big | + \\big | q_{jj}(t) \\big | \\; \\big )\n", "\\end{split}\n", "\\end{equation}\n", "\n", "where ${\\bf P}$ depends on the location of the target, $i$ refers to the time-channel, $d_{i,obs}$ is the observed data at time $i$ and ${\\bf W_i}$ are a set of weights applied to the data misfit. The constraint assures that negative polarizabilities (non-physical) are not recovered in order to fit the data.\n", "\n", "### Step 2\n", "\n", "Once recovered, ${\\bf q}$ at each time can be used to construct the corresponding polarizability tensor ${\\bf Q}$. Recall that the eigen-decomposition of ${\\bf Q}$ is given by:\n", "\n", "\\begin{equation}\n", "{\\bf Q = A \\, L(t) \\, A^T}\n", "\\end{equation}\n", "\n", "Thus $L_{x'}(t),L_{y'}(t),L_{z'}(t)$ are just the eigenvalues of ${\\bf Q}$ and the elements of the rotation matrix ${\\bf A}$ are the eigenvectors. Once $L_{x'},L_{y'},L_{z'}$ have been recovered at all times, the curves can be compared against the known primary polarizabilities of objects which are stored in a library.\n", "\n", "### Practical Considerations\n", "\n", "**Sampling Density:** The optimum line and station spacing depends significantly on the dimensions of the target, its depth and the system being used to perform the survey. It is important to use a sampling density which accurately characterizes TEM anomalies without adding unnecessary time and expense.\n", "\n", "**Excitation Orientation:** The excitation of a buried target occurs parallel to the inducing field. Thus in order to accurately recover polarizations $L_{x′},L_{y′}$ and $L_{z′}$ for the target, we must excite the target significantly from multiple angles. Ideally, the target would be excited from 3 orthogonal directions; thus assuring the data contains significant contributions from each polarization." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Orientation and Polarization Widget\n", "\n", "### Purpose\n", "\n", "This app allows the user to visualize the orientation, approximate dimensions and polarizability of compact objects they wish to model with subsequent apps.\n", "\n", "### Parameter Descriptions\n", "\n", "* $\\Phi$: Clockwise rotation about the z-axis\n", "* $\\theta$: Azimuthal angle (angle from vertical)\n", "* $\\phi$: Declination angle (Clockwise angle from North)\n", "* $k_i,\\alpha_i,\\beta_i,\\gamma_i$: Parameters which characterize the polarization along axis $i$" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4dbeb30666b14012bf94c5fefd82eaba" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7a6d1a03e3ef4add95e700abafe92c18" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8cda2505816e40cbb67f09c441108e04" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4fb06fb2d7bc448f96af4e8f8ca73a04" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b9688838459e43128b86b222d3680990" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8a10a8ae2cbd43eeaee4c8b5e6f04780" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NOTE: INITIATE WIDGET BY ADJUSTING ANY PARAMETER!!!\n", "\n", "Out1 = UXO.ImageUXOWidget()\n", "display(HBox(Out1.children[0:3]))\n", "display(HBox(Out1.children[3:7]))\n", "display(HBox(Out1.children[7:11]))\n", "display(HBox(Out1.children[11:15]))\n", "display(Out1.children[15])\n", "Out1.out" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Data Visualization Widget\n", "\n", "### Purpose\n", "\n", "This widget allows the user to visualize the time-domain response using three commonly used instruments: EM61, TEMTADS, and MPV. On the leftmost plot, the TEM anomaly at the center of the transmitter loop is plotted at a specified time. On the rightmost plot, the TEM decays registered by all receiver coils for a particular transmitter loop are plotted.\n", "\n", "### Parameter Descriptions\n", "\n", "* TxType: Instrument used to predict data. Set as \"EM61\", \"TEMTADS\" or \"MPV\"\n", "* $x_{true},y_{true},z_{true}$: Location of the object\n", "* $\\psi,\\theta,\\phi$: Angles defining the orientation of the object\n", "* $k_i,\\alpha_i,\\beta_i,\\gamma_i$: Parameters which characterize the polarization along axis $i$\n", "* Time channel: Adjusts the time in which the TEM anomaly at the center of the transmitter loop is plotted\n", "* X location, Y location: The transmitter location at which you would like to see all decays measured by the receiver coils." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "db056c0cd64e4ef483ccf12fc255337f" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a7974d6e82fc482d897b29ce0d165eda" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ecbc1b8ea7a34c688f2d892aafb87f39" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "50512e59c79f4341b0ed355ca9fe5056" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b3e105d9c5154de9b213e7a55770e296" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5368e7f01e024183b76e70b364713cb9" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a3205d5e294341c696496a2da86a3d48" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3fb26715ec51400c851d457e8c6ecff3" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NOTE: INITIATE WIDGET BY ADJUSTING ANY PARAMETER!!!\n", "\n", "TxType = \"MPV\" # Set TxType to \"EM61\", \"TEMTADS\" or \"MPV\"\n", "\n", "Out2 = UXO.ImageDataWidget(TxType)\n", "display(HBox(Out2.children[0:3]))\n", "display(HBox(Out2.children[3:6]))\n", "display(HBox(Out2.children[6:10]))\n", "display(HBox(Out2.children[10:14]))\n", "display(HBox(Out2.children[14:18]))\n", "display(HBox(Out2.children[18:21]))\n", "if TxType is \"MPV\":\n", " display(Out2.children[21])\n", "Out2.out" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Parameter Estimation Widget\n", "\n", "### Purpose\n", "\n", "This widget allows the user to invert synthetic data using EM61, TEMTADS or MPV instruments in order to recover the location and primary polarizabilities for a compact object. The goal of this app is to demonstrate how successful recovery depends on:\n", "\n", "* Sampling density\n", "* Excitation orientation\n", "\n", "### Parameter Descriptions\n", "\n", "* TxType: Instrument used for simulation. Set as \"EM61\", \"TEMTADS\" or \"MPV\"\n", "* $x_{true},y_{true},z_{true}$: True location of the object\n", "* $\\psi,\\theta,\\phi$: True angles defining the orientation of the object\n", "* $k_i,\\alpha_i,\\beta_i,\\gamma_i$: True parameters which characterize the polarization of the object along axis $i$\n", "* $D_x,D_y$: The x-width and y-width for the cued-interrogation region\n", "* $N_x,N_y$: The number of stations in the x and y direction\n", "* $x_0,y_0,z_0$: Starting guess for the location of the object" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "728642e353d1445abf697696492b8d02" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9453363e492c47838d92690f640a654e" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "022f5c903a6a4cb9aed28beb3cdf7fe4" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "379ce7795433480f855c29d0cabb9442" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "653835f36d8244b5a42df38bdb343a08" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9ecaf476fecf41a8a88ec97d05cde2ea" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c27b346023624aeeb77c82e7f2f2b8bc" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "90de80ce5fe240868584449607c18eae" } }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3a305ac7294640bab428d5f530505855" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# NOTE: INITIATE WIDGET BY ADJUSTING ANY PARAMETER!!!\n", "\n", "TxType = \"EM61\" # Set TxType to \"EM61\", \"TEMTADS\" or \"MPV\"\n", "\n", "Out3 = UXO.InversionWidget(TxType)\n", "display(HBox(Out3.children[0:3]))\n", "display(HBox(Out3.children[3:6]))\n", "display(HBox(Out3.children[6:10]))\n", "display(HBox(Out3.children[10:14]))\n", "display(HBox(Out3.children[14:18]))\n", "display(HBox(Out3.children[18:22]))\n", "display(HBox(Out3.children[22:25]))\n", "if TxType is \"MPV\":\n", " display(HBox(Out3.children[25:27]))\n", "else:\n", " display(Out3.children[25])\n", "Out3.out" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 2 }