Magnetotellurics#
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.
The following example shows how to generate an MT survey with associated data stored in geoh5 format and accessible from Geoscience ANALYST.

import numpy as np
from geoh5py.objects import MTReceivers
from geoh5py.workspace import Workspace
# Create a new project
workspace = Workspace("my_project.geoh5")
# Define a synthetic survey with receivers on 2 lines, 60 m apart
x_loc, y_loc = np.meshgrid(np.linspace(-5, 5, 2), np.linspace(0.0, 20.0, 9))
vertices = np.c_[x_loc.ravel(), y_loc.ravel(), np.zeros_like(x_loc).ravel()]
# Create the survey from vertices
mt_survey = MTReceivers.create(workspace, vertices=vertices)
/home/docs/checkouts/readthedocs.org/user_builds/mirageoscience-geoh5py/conda/latest/lib/python3.10/site-packages/geoh5py/workspace/workspace.py:1107: UserWarning: From version 0.8.0, the 'h5file' attribute must be a string or path to an existing file, or user must call the 'create' method. We will attempt to `save` the file for you, but this behaviour will be removed in future releases.
warnings.warn(
Only receivers are needed to define the survey as MT uses the ambient electromagntic field of the Earth - no transmitters (source) required.
Metadata#
Along with the MTReceivers, the metadata contains all the necessary information to define the geophysical experiment.
mt_survey.metadata
{'EM Dataset': {'Channels': [],
'Input type': 'Rx only',
'Property groups': [],
'Receivers': UUID('2a974911-4f5d-4102-bb86-7da2dea3b365'),
'Survey type': 'Magnetotellurics',
'Unit': 'Hertz (Hz)'}}
Channels#
List of frequencies at which the data are provided.
mt_survey.channels = [1.0, 10.0, 100.0]
Input type#
Generic label used in the geoh5 standard for all EM survey entities. Restricted to Rx only in the case of natural sources methods.
Property groups#
List of PropertyGroups 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).
The class method add_components_data can help users add data from nested dictionaries. Below is an example using four components:
# Arbitrary data generator using sine functions
def data_fun(c, f):
return (c + 1.0) * np.sin(f * np.pi * (x_loc * y_loc).ravel() / 200.0)
# Create a nested dictionary of component and frequency data.
data = {
component: {
f"{component}_{freq}": {
"values": (ff + 1) * 1000.0
+ (cc + 1) * 100.0
+ np.arange(vertices.shape[0])
}
for ff, freq in enumerate(mt_survey.channels)
}
for cc, component in enumerate(
[
"Zxx (real)",
"Zxx (imaginary)",
"Zxy (real)",
"Zxy (imaginary)",
"Zyx (real)",
"Zyx (imaginary)",
"Zyy (real)",
"Zyy (imaginary)",
]
)
}
mt_survey.add_components_data(data)
[<geoh5py.groups.property_group.PropertyGroup at 0x7c7f8431a980>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c1d6a10>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c0d4520>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c0d4b80>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c1d7e80>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c0d4040>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c0d5990>,
<geoh5py.groups.property_group.PropertyGroup at 0x7c7f7c0d61d0>]
Metadata are updated immediately to reflect the addition of components:
mt_survey.metadata
{'EM Dataset': {'Channels': [1.0, 10.0, 100.0],
'Input type': 'Rx only',
'Property groups': ['Zxx (real)',
'Zxx (imaginary)',
'Zxy (real)',
'Zxy (imaginary)',
'Zyx (real)',
'Zyx (imaginary)',
'Zyy (real)',
'Zyy (imaginary)'],
'Receivers': UUID('2a974911-4f5d-4102-bb86-7da2dea3b365'),
'Survey type': 'Magnetotellurics',
'Unit': 'Hertz (Hz)'}}
Data channels associated with each component can be quickly accessed through the BaseEMSurvey.components property:
mt_survey.components
{'Zxx (real)': [<geoh5py.data.float_data.FloatData at 0x7c7f8431bb50>,
<geoh5py.data.float_data.FloatData at 0x7c7f84dee440>,
<geoh5py.data.float_data.FloatData at 0x7c7f8431b610>],
'Zxx (imaginary)': [<geoh5py.data.float_data.FloatData at 0x7c7f8431af80>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d7cd0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d67d0>],
'Zxy (real)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c1d69b0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d77f0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d69e0>],
'Zxy (imaginary)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c1d6800>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d4640>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d4c70>],
'Zyx (real)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c1d7790>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d6a70>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d6650>],
'Zyx (imaginary)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c1d7f10>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d7fa0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c1d6d70>],
'Zyy (real)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c1d7ca0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d4160>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d5870>],
'Zyy (imaginary)': [<geoh5py.data.float_data.FloatData at 0x7c7f7c0d4a00>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d5ab0>,
<geoh5py.data.float_data.FloatData at 0x7c7f7c0d60b0>]}
Receivers#
Generic label used in the geoh5 standard for EM survey to identify the receiver entity. Restricted to itself in the case of MTReceivers.
Survey type#
Label identifier for Magnetotellurics survey type.
Unit#
Units for frequency sampling of the data: Hertz (Hz), KiloHertz (kHz), MegaHertz (MHz) or Gigahertz (GHz).
workspace.close()