{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Magnetotellurics\n", "\n", "This object can be used to store magnetotelluric (MT) surveys - a natural-source geophysical method. Data are provided in the frequency-domain as point source measurements of either impedances or apparent resistity/phase.\n", "\n", "The following example shows how to generate an MT survey with associated data stored in `geoh5` format and accessible from [Geoscience ANALYST](https://mirageoscience.com/mining-industry-software/geoscience-analyst/).\n", "\n", "\n", "![mtSurvey](./images/mt_survey.png)" ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from geoh5py.workspace import Workspace\n", "from geoh5py.objects import MTReceivers\n", "\n", "# Create a new project\n", "workspace = Workspace(\"my_project.geoh5\")\n", "\n", "# Define a synthetic survey with receivers on 2 lines, 60 m apart\n", "x_loc, y_loc = np.meshgrid(np.linspace(-5, 5, 2), np.linspace(0., 20., 9))\n", "vertices = np.c_[x_loc.ravel(), y_loc.ravel(), np.zeros_like(x_loc).ravel()]\n", "\n", "# Create the survey from vertices\n", "mt_survey = MTReceivers.create(workspace, vertices=vertices)" ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "Only receivers are needed to define the survey as MT uses the ambient electromagntic field of the Earth - no transmitters (source) required." ] }, { "cell_type": "markdown", "id": "3", "metadata": {}, "source": [ "## Metadata\n", "\n", "Along with the [MTReceivers](../api/geoh5py.objects.surveys.electromagnetics.rst#module-geoh5py.objects.surveys.electromagnetics.magnetotellurics), the metadata contains all the necessary information to define the geophysical experiment." ] }, { "cell_type": "code", "execution_count": null, "id": "4", "metadata": {}, "outputs": [], "source": [ "mt_survey.metadata" ] }, { "cell_type": "markdown", "id": "5", "metadata": {}, "source": [ "### Channels\n", "\n", "List of frequencies at which the data are provided." ] }, { "cell_type": "code", "execution_count": null, "id": "6", "metadata": {}, "outputs": [], "source": [ "mt_survey.channels = [1., 10., 100.]" ] }, { "cell_type": "markdown", "id": "7", "metadata": {}, "source": [ "### Input type\n", "\n", "Generic label used in the `geoh5` standard for all EM survey entities. Restricted to `Rx only` in the case of natural sources methods." ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "### Property groups\n", "\n", "List of [PropertyGroup](../api/geoh5py.groups.rst#module-geoh5py.groups.property_group)s defining the various data components (e.g. `Zxx (real)`, `Zxy (imag)`, ...). It is not required to supply all components of the impedence tensor, but it is expected that each component contains a list of data channels of length and in the same order as the `Channels` (one `Data` per frequency).\n", "\n", "The class method [add_components_data](../api/geoh5py.objects.surveys.electromagnetics.rst#geoh5py.objects.surveys.electromagnetics.base.BaseEMSurvey.add_components_data) can help users add data from nested dictionaries. Below is an example using four components:" ] }, { "cell_type": "code", "execution_count": null, "id": "9", "metadata": {}, "outputs": [], "source": [ "# Arbitrary data generator using sine functions\n", "data_fun = lambda c, f: (c+1.) * np.sin(f * np.pi * (x_loc * y_loc).ravel() / 200.)\n", "\n", "# Create a nested dictionary of component and frequency data.\n", "data = {\n", " component : {\n", " f\"{component}_{freq}\": {\"values\": (ff+1)*1000. + (cc+1) * 100. + np.arange(vertices.shape[0])} for ff, freq in enumerate(mt_survey.channels)\n", " } for cc, component in enumerate([\n", " \"Zxx (real)\", \"Zxx (imaginary)\",\n", " \"Zxy (real)\", \"Zxy (imaginary)\",\n", " \"Zyx (real)\", \"Zyx (imaginary)\",\n", " \"Zyy (real)\", \"Zyy (imaginary)\",\n", " ])\n", "}\n", " \n", "mt_survey.add_components_data(data)" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "Metadata are updated immediately to reflect the addition of components:" ] }, { "cell_type": "code", "execution_count": null, "id": "11", "metadata": {}, "outputs": [], "source": [ "mt_survey.metadata" ] }, { "cell_type": "markdown", "id": "12", "metadata": {}, "source": [ "Data channels associated with each component can be quickly accessed through the [BaseEMSurvey.components](../api/geoh5py.objects.surveys.electromagnetics.rst#geoh5py.objects.surveys.electromagnetics.base.BaseEMSurvey.components) property:" ] }, { "cell_type": "code", "execution_count": null, "id": "13", "metadata": {}, "outputs": [], "source": [ "mt_survey.components" ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "### Receivers\n", "\n", "Generic label used in the `geoh5` standard for EM survey to identify the receiver entity. Restricted to itself in the case of `MTReceivers`." ] }, { "cell_type": "markdown", "id": "15", "metadata": {}, "source": [ "### Survey type\n", "\n", "Label identifier for `Magnetotellurics` survey type." ] }, { "cell_type": "markdown", "id": "16", "metadata": {}, "source": [ "### Unit\n", "\n", "Units for frequency sampling of the data: `Hertz (Hz)`, `KiloHertz (kHz)`, `MegaHertz (MHz)` or `Gigahertz (GHz)`." ] } ], "metadata": { "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.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }