{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Tipper\n", "\n", "This object can be used to store tipper (ZTEM) surveys - a natural-source geophysical method. Data are provided in the frequency-domain as point source measurements of tipper data.\n", "\n", "The following example shows how to generate a tipper 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/tipper_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 TipperReceivers, TipperBaseStations\n", "\n", "# Create a new project\n", "workspace = Workspace(\"my_project.geoh5\")\n", "\n", "# Define the pole locations\n", "n_stations = 64\n", "n_lines = 2\n", "x_loc, y_loc = np.meshgrid(np.linspace(0, 60, n_stations), np.linspace(-20, 20., n_lines))\n", "vertices = np.c_[x_loc.ravel(), y_loc.ravel(), np.zeros_like(x_loc).ravel()]\n", "\n", "# Assign a line ID to the poles (vertices)\n", "parts = np.kron(np.arange(n_lines), np.ones(n_stations)).astype('int')\n", "\n", "# Create the survey from vertices\n", "receivers = TipperReceivers.create(workspace, vertices=vertices, parts=parts)\n", "base = TipperBaseStations.create(workspace, vertices=vertices)" ] }, { "cell_type": "markdown", "id": "2", "metadata": {}, "source": [ "We have so far created two seperate entities, one for the receiver locations and another for the base station(s). In order to finalize the survey, the association must be made between the two entities:" ] }, { "cell_type": "code", "execution_count": null, "id": "3", "metadata": {}, "outputs": [], "source": [ "receivers.base_station = base" ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "or equivalently" ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": {}, "outputs": [], "source": [ "base.receivers = receivers" ] }, { "cell_type": "markdown", "id": "6", "metadata": {}, "source": [ "Only one of the two options above is needed. " ] }, { "cell_type": "markdown", "id": "7", "metadata": {}, "source": [ "## Metadata\n", "\n", "Along with the [TipperReceivers](../api/geoh5py.objects.surveys.electromagnetics.rst#geoh5py.objects.surveys.electromagnetics.tipper.TipperReceivers), the metadata contains all the necessary information to define the geophysical experiment." ] }, { "cell_type": "code", "execution_count": null, "id": "8", "metadata": {}, "outputs": [], "source": [ "receivers.metadata" ] }, { "cell_type": "markdown", "id": "9", "metadata": {}, "source": [ "### Channels\n", "\n", "List of frequencies at which the data are provided." ] }, { "cell_type": "code", "execution_count": null, "id": "10", "metadata": {}, "outputs": [], "source": [ "receivers.channels = [30., 45., 90., 180., 360., 720.]" ] }, { "cell_type": "markdown", "id": "11", "metadata": {}, "source": [ "### Input type\n", "\n", "Generic label used in the `geoh5` standard for all EM survey entities. Restricted to `Rx and base station` in the case of a tipper survey." ] }, { "cell_type": "markdown", "id": "12", "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. `Txz (real)`, `Tyz (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": "13", "metadata": {}, "outputs": [], "source": [ "# Arbitrary data generator using sine functions\n", "data_fun = lambda c, f: (c+1.) * (f+1.) * np.sin(f * np.pi * (x_loc * y_loc).ravel() / 400.)\n", "\n", "# Create a nested dictionary of component and frequency data.\n", "data = {\n", " component : {\n", " f\"{component}_{freq}\": {\"values\": data_fun(cc, ff)} for ff, freq in enumerate(receivers.channels)\n", " } for cc, component in enumerate([\n", " \"Txz (real)\", \"Txz (imaginary)\",\n", " \"Tyz (real)\", \"Tyz (imaginary)\",\n", " ])\n", "}\n", " \n", "receivers.add_components_data(data)" ] }, { "cell_type": "markdown", "id": "14", "metadata": {}, "source": [ "Metadata are updated immediately to reflect the addition of components:" ] }, { "cell_type": "code", "execution_count": null, "id": "15", "metadata": {}, "outputs": [], "source": [ "receivers.metadata" ] }, { "cell_type": "markdown", "id": "16", "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": "17", "metadata": {}, "outputs": [], "source": [ "receivers.components" ] }, { "cell_type": "markdown", "id": "18", "metadata": {}, "source": [ "### Receivers\n", "\n", "Generic label used in the `geoh5` standard for EM survey to identify the [TipperReceivers](../api/geoh5py.objects.surveys.electromagnetics.rst#geoh5py.objects.surveys.electromagnetics.tipper.TipperReceivers) entity." ] }, { "cell_type": "markdown", "id": "19", "metadata": {}, "source": [ "### Base stations\n", "\n", "Generic label used in the `geoh5` standard for EM survey to identify the [TipperBaseStations](../api/geoh5py.objects.surveys.electromagnetics.rst#geoh5py.objects.surveys.electromagnetics.tipper.TipperBaseStations) entity." ] }, { "cell_type": "markdown", "id": "20", "metadata": {}, "source": [ "### Survey type\n", "\n", "Label identifier for `ZTEM` survey type." ] }, { "cell_type": "markdown", "id": "21", "metadata": {}, "source": [ "### Unit\n", "\n", "Units for frequency sampling of the data: `Hertz (Hz)`, `KiloHertz (kHz)`, `MegaHertz (MHz)` or `Gigahertz (GHz)`." ] }, { "cell_type": "code", "execution_count": null, "id": "22", "metadata": {}, "outputs": [], "source": [ "workspace.finalize()" ] } ], "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 }