The ModEM-Tools repository contains a collection of MatLab and Python tools for manipulating ModEM data and model files.
The MatLab code is an extensive collection of functions and classes that have been used for many years, while the Python code is a newer, less functional code base.
Some of these tools may be incomplete, contain errors or bugs, or may not work at all. We are providing these tools as a starting point or reference for derivative or future work.
However, we have done work to ensure that some basic functionality is working. This functionality can be found in the MatLab Examples section of this README.
- ModEM-Model - The ModEM Model itself
- ModEM-Examples - A collection of MT and CSEM examples for ModEM
NOTE: Some MatLab code requires the MatLab Mapping Toolbox.
The collection of MatLab code in this repository contain a number of functions and classes that have been used for many years and have a plethora of functionality. It is the best resource for tools for manipulating ModEM data, model files or performing other actions.
We have provided a few examples using MatLab code which should help anyone getting started with ModEM datatypes or model files.
- Read/Write ModEM Data Using readZ_3D and writeZ_3D - A
basic example using the low-level
readZ_3DandwriteZ_3Dfunctions to read and write a data file - Read/Write ModEM Model Example - A basic example using the low-level to read and write a model file
- Using MatLab classes to create a synthetic example - An example that uses the higher level matlab classes to create synthetic data and a synthetic model as well as an example using the classes to plot a model.
The MatLab classes provide the greatest functionality and are very flexible. They will most likely be the best option to meet your needs.
Some of these classes are used
- xygrid and llgrid - Classes for manipulating (or creating) a grid
- xymodel and llmodel - Class for manipulating a gird and it's conductivity field
- mtdata - Class for manipulating a ModEM data file (contains a collection of
mtperiods) - mtperiod - Class for manipulating and defining a period, including station data.
- mttf - Read in either Z, XML, EDI or BIRRP files
If you want to use these classes to read in an existing file, make sure you check out their static methods. For instance:
>>> data = mtdata.read('datafile.dat');
>>> model = xymodel.read('example.rho');The Python Code is a newer tool with significantly less functionality then the MatLab code. The MatLab code should be used in favor of it, but we are providing it here as reference and as a starting point for future tools.
Currently it has some basic functionality that allow for the creation of synthetic data, model files and covariance files as well as some terse plotting functionality.
Some of the scripts require the MtPy Python tool. MtPy is a great resource and we recommend using it as well.
For more information on the PyModEM please see it's README.