{ "cells": [ { "cell_type": "markdown", "metadata": { "extensions": { "jupyter_dashboards": { "version": 1, "views": { "grid_default": { "col": 0, "height": 10, "hidden": false, "row": 0, "width": 12 }, "report_default": { "hidden": false } } } } }, "source": [ "This is the Jupyter Notebook, an interactive coding and computation environment. For this lab, you do not have to write any code, you will only be running it. \n", "\n", "To use the notebook:\n", "- \"Shift + Enter\" runs the code within the cell (so does the forward arrow button near the top of the document)\n", "- You can alter variables and re-run cells\n", "- If you want to start with a clean slate, restart the Kernel either by going to the top, clicking on Kernel: Restart, or by \"esc + 00\" (if you do this, you will need to re-run the following block of code before running any other cells in the notebook) \n", "\n", "This notebook uses code adapted from \n", "\n", "SimPEG\n", "- Cockett, R., S. Kang, L.J. Heagy, A. Pidlisecky, D.W. Oldenburg (2015, in review), SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications. Computers and Geosciences\n" ] }, { "cell_type": "markdown", "metadata": { "extensions": { "jupyter_dashboards": { "version": 1, "views": { "grid_default": { "col": 0, "height": 11, "hidden": false, "row": 10, "width": 6 }, "report_default": {} } } } }, "source": [ "## View the model\n", "\n", "- dx: width or prism in x-direction (m)\n", "- dy: width of prism in y-direction (m)\n", "- dz: vertical extent of prism (m)\n", "- x0: x location of the center of the prism (m)\n", "- y0: y location of the center of the prism (m)\n", "- depth: depth to the top of the prism (m)\n", "- prism_inc: inclination of the prism (reference is a unit northing vector; degrees)\n", "- prism_dec: declination of the prism (reference is a unit northing vector; degrees)\n", "- View_dip: dip angle of view (degrees)\n", "- View_elev: elevation of view (degrees)\n", "- View_azim: azimuth of view (degrees)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "extensions": { "jupyter_dashboards": { "version": 1, "views": { "grid_default": { "col": 0, "height": 29, "hidden": false, "row": 21, "width": 6 }, "report_default": { "hidden": false } } } } }, "outputs": [], "source": [ "import numpy as np\n", "from geoscilabs.mag import Mag, Simulator\n", "from discretize import TensorMesh\n", "from SimPEG import utils\n", "from SimPEG.potential_fields import magnetics as mag\n", "from ipywidgets import widgets\n", "import matplotlib" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "97eefaa4140047cd8b9e36aa66cd74a1", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(ToggleButton(value=False, description='Refresh'), FloatSlider(value=2.375, continuous_up…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#Input parameters\n", "fileName = 'http://github.com/geoscixyz/geosci-labs/raw/main/assets/mag/data/350mag2023.csv'\n", "data = np.genfromtxt(fileName, skip_header=1, delimiter=',')\n", "xyzd = np.c_[np.zeros(data.shape[0]), data[:,0], np.zeros(data.shape[0]), data[:,1]]\n", "B = np.r_[60308, 83.8, 25.4]\n", "survey, dobj = Mag.createMagSurvey(xyzd, B)\n", "# View the data and chose a profile\n", "# Define the parametric model interactively\n", "model = Simulator.ViewPrism(survey)\n", "model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fit the data\n", "- Binc: Inclination of the Earth's background field (degree)\n", "- Bdec: Declination of the Earth's background field (degree)\n", "- Bigrf: Strength of the Earth's background field (nT) \n", "- depth: vertical distance from the sensor to the top of the rebar (m)\n", "- susc: magnetic susceptibility\n", "- comp: Total field (tf) of component of the field to plot\n", "- irt: Type of magnetization \n", "- Q: Koenigsberger ratio ($\\frac{M_{rem}}{M_{ind}}$)\n", "- rinc: inclination of the remanent magnetization (degree)\n", "- rdec: declination of the remanent magnetization (degree)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "extensions": { "jupyter_dashboards": { "version": 1, "views": { "grid_default": { "col": 6, "height": 29, "hidden": false, "row": 21, "width": 6 }, "report_default": { "hidden": false } } } } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8f3985cd302147c196ea32d55d83246b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(FloatSlider(value=90.0, continuous_update=False, description='Binc', max=90.0, min=-90.0…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Simulator.fitline(model,survey,dobj)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "extensions": { "jupyter_dashboards": { "activeView": "grid_default", "version": 1, "views": { "grid_default": { "cellMargin": 10, "defaultCellHeight": 20, "maxColumns": 12, "name": "grid", "type": "grid" }, "report_default": { "name": "report", "type": "report" } } } }, "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.10.4" }, "widgets": { "state": { "8789ea09a28443d0b196412593e51195": { "views": [ { "cell_index": 3 } ] }, "8bd53575b8d6470cb6158b113159182e": { "views": [ { "cell_index": 5 } ] } }, "version": "1.2.0" } }, "nbformat": 4, "nbformat_minor": 4 }