Python toolkit for standard magnetotelluric data processing.
Project description
MTpy-v2: A Python Toolbox for working with Magnetotelluric (MT) Data
Version 2.0.8
Description
mtpy
provides tools for working with magnetotelluric (MT) data. MTpy-v2 is an updated version of mtpy. Many things have changed under the hood and usage is different from mtpy v1. The main difference is that there is a central data type that can hold transfer functions and then read/write to your modeling program, plot, and analyze your data. No longer will you need a directory of EDI files and then read them in everytime you want to do something. You only need to build a project once and save it to an MTH5 file and you are ready to go. All metadata uses mt-metadata.
Installation
Using Pip
> pip install mtpy-v2
Using conda
> conda install -c conda-forge mtpy-v2
Functionality
- Read/write transfer function files (EDI, EMTFXML, J-file, Z-file, AVG-file) using mt-metadata
- Read/write MTH5 files for full surveys/project in a single file
- Utility functions for GIS
Plotting
- Single transfer function
- apparent resistivity and phase
- induction vectors
- phase tensors
- strike
- depth of investigation
- Survey of transfer functions
- station map
- phase tensor and induction vector map and pseudosection
- apparent resistivity and phase maps and pseudosections
- depth of investigation map
Processing
- Read/write files for time series processing
- BIRRP
- Aurora
Modeling
- Read/Write files for modeling programs
- ModEM
- Occam 1D and 2D
- Mare2DEM (?)
- Pek 1D and 2D
What's been Updated in version 2
The main updates in mtpy-v2
are:
- Remove dependence on EDI files, can be any type of transfer function file
- Supports (or will support) to/from:
- EDI (most common format)
- ZMM (Egberts EMTF output)
- JFILE (BIRRP output)
- EMTFXML (Kelbert's format)
- AVG (Zonge output)
- Supports (or will support) to/from:
- Uses mt-metadata to read and write transfer function files where the transfer function data are stored in an xarray
- The workflow is more centralized by introducing
MTCollection
andMTData
objects which are the databases to hold a collection of transfer functions and manipulate them- Includes plotting methods,
to/from
data file types for modeling, rotations, interpolations, static shifts, etc. - Can store a collection as an MTH5 using mth5
- Includes plotting methods,
Quick Example
Typically MT data are collected as surveys and each station produces a single transfer function. These are provided in various formats like EDI, EMTF XML, etc.
One benefit of mtpy-v2 is reading all these in only needs to be done once and places them in a single MTH5 file.
from pathlib import Path
from mtpy import MTCollection
transfer_function_path = Path("/home/survey_00/transfer_functions")
# write directly to an MTH5 file and close when finished loading TFs
with MTCollection() as mc:
mc.open_collection(transfer_function_path.joinpath("tf_collection.h5"))
mc.add_tf(
mc.make_file_list(
transfer_function_path,
file_types=["edi", "xml", "j", "zmm", "zss", "avg"],
)
)
Now when you want to access your data again, you just need to open a single file.
mc = MTCollection()
mc.open_collection(r"/home/survey_00/transfer_functions/tf_collection.h5")
# plot station locations
station_locations = mc.plot_stations()
How to Cite
If you use this software in a scientific publication, we'd very much appreciate if you could cite the following papers:
-
Kirkby, A.L., Zhang, F., Peacock, J., Hassan, R., Duan, J., 2019. The MTPy software package for magnetotelluric data analysis and visualisation. Journal of Open Source Software, 4(37), 1358. https://doi.org/10.21105/joss.01358
-
Krieger, L., and Peacock, J., 2014. MTpy: A Python toolbox for magnetotellurics. Computers and Geosciences, 72, p167-175. https://doi.org/10.1016/j.cageo.2014.07.013
Contacts
| Jared Peacock | peacock.jared@gmail.com
| Alison Kirkby | alkirkby@gmail.com
System Requirements
- Python 3.8+
License
MTpy is licensed under the MIT license
The license agreement is contained in the repository and should be kept together with the code.
History
2.0.0 (2022-10-20)
- major changes under the hood.
- Now using
mt_metadata
to read/write transfer function files - Now using
mth5
to store the transfer functions - Introduced
MT
,MTCollection
, andMTData
such that operations are more centralized. Now most methods can be called fromMT
andMTData
- Removing older modules and group specific modules
- Added GitActions for testing
- Updating tests (still lots of work to do)
- Updated documentation to upload to ReadTheDocs
- Now using
2.0.5 (2023-11-09)
- bug fixes
- now install simpeg for inversions, 1D implemented so far
2.0.8 (2024-08-30)
- Shapefiles by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/28
- Added to ModEM module docs by @oaazeved in https://github.com/MTgeophysics/mtpy-v2/pull/32
- Add tf quality by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/37
- Updates by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/29
- adding ability to just plot tipper by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/35
- Updated default tippers to point towards a good conductor by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/41
- Ak2 by @alkirkby in https://github.com/MTgeophysics/mtpy-v2/pull/43
- Porting Aurora objects by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/45
- Updates by @kujaku11 in https://github.com/MTgeophysics/mtpy-v2/pull/40
New Contributors
- @oaazeved made their first contribution in https://github.com/MTgeophysics/mtpy-v2/pull/32
Full Changelog: https://github.com/MTgeophysics/mtpy-v2/compare/v2.0.7...v2.0.8
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mtpy-v2-2.0.8.tar.gz
.
File metadata
- Download URL: mtpy-v2-2.0.8.tar.gz
- Upload date:
- Size: 21.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb6a6a2703ff376ca95b83d65a8c19e4636d092deef356cf72cf9075a920e0e6 |
|
MD5 | 59f1dfcd78622c5cf68e252630c14bbd |
|
BLAKE2b-256 | c49281e98a81395d559abbc9109e057ce37c8d921062492226da437352c47807 |
File details
Details for the file mtpy_v2-2.0.8-py3-none-any.whl
.
File metadata
- Download URL: mtpy_v2-2.0.8-py3-none-any.whl
- Upload date:
- Size: 474.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6660ad2624196314059ae2c012494f209889db1a4dc767da4b75b8532b0df770 |
|
MD5 | 6bf32814d0e5e6b0b29330c99808b886 |
|
BLAKE2b-256 | b19602f2d609dfea9d1e87b864ed001c4d910cb3b3ba58ae0269457d8bebb2b4 |