開発版ドキュメント · 0.2.3 30c2f8ba · 入門例の検証対象 0.2.3 · 版情報 · 既知の制限

gwexpy.interop.mt_#

Interoperate with the MTH5 magnetotelluric HDF5 format.


Interoperability with MTH5 (Magnetotelluric HDF5) format.

Provides read/write functionality for magnetotelluric time series data. Requires the mth5 package.

Functions

from_mth5(mth5_obj, station, run, channel[, ...])

Read a channel from MTH5 to TimeSeries.

to_mth5(series, mth5_obj[, station, run, ...])

Write a TimeSeries to an MTH5 file.

gwexpy.interop.mt_.to_mth5(series, mth5_obj: str | Any, station: str | None = None, run: str | None = None, channel_type: str = 'electric') None#

Write a TimeSeries to an MTH5 file.

パラメータ:
  • series (TimeSeries) -- Data to write.

  • mth5_obj (str or mth5.mth5.MTH5) -- Open MTH5 object or path to HDF5 file.

  • station (str, optional) -- Station name. Defaults to 'Station01'.

  • run (str, optional) -- Run name. Defaults to 'Run01'.

  • channel_type ({'electric', 'magnetic', 'auxiliary'}, optional) -- Channel type for metadata. Default is 'electric'.

例外:

ImportError -- If mth5 package is not installed.

サンプル

>>> from gwexpy.timeseries import TimeSeries
>>> from gwexpy.interop.mt_ import to_mth5
>>> ts = TimeSeries([1, 2, 3], dt=0.001, name="Ex")
>>> to_mth5(ts, "data.h5", station="Site01", run="Run01")
gwexpy.interop.mt_.from_mth5(mth5_obj: str | Any, station: str, run: str, channel: str, survey: str | None = None)#

Read a channel from MTH5 to TimeSeries.

パラメータ:
  • mth5_obj (str or mth5.mth5.MTH5) -- Open MTH5 object or path to HDF5 file.

  • station (str) -- Station name.

  • run (str) -- Run name.

  • channel (str) -- Channel name to read.

  • survey (str, optional) -- Survey name for MTH5 v0.2.0 files. If omitted, available surveys are searched.

戻り値:

The loaded time series data.

戻り値の型:

TimeSeries

例外:
  • ImportError -- If mth5 package is not installed.

  • KeyError -- If station, run, or channel is not found.

サンプル

>>> from gwexpy.interop.mt_ import from_mth5
>>> ts = from_mth5("data.h5", "Site01", "Run01", "Ex")