Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.25 KB

File metadata and controls

65 lines (47 loc) · 1.25 KB

PyModEM

A small collection of Python utilities to manipulate and plot ModEM Data and grid files.

Installation

PyModEM can be installed using pip. It's often easier to use a Python virtual enviorment for installations:

$ git clone https://github.com/magnetotellurics/ModEM-Tools
$ cd ModEM-Tools/python/PyModEM
$ python -m venv pymodem-venv
$ source pymodem-venv/bin/activate # For Unix/Mac
$ ./pymodem-venv/bin/activate # For Windows

Then, install the requirements and PyModEM:

$ pip install -r requirments.txt
$ pip install -e .

Usage

Activate your virtual environment, (if you created it above):

$ source ./pymodem-venv/bin/activate

You'll then be able to run the scripts that are found in ModEM-Tools/python/PyModEM/scirpts:

$ modem_data cascad_errfl5.dat list
11.63636
25.6
53.89474
102.4
215.5789
409.6
862.3158
1638.4
4681.143
18724.57

You can also create your own files and access PyModEM classes for your own manipulation:

from PyModEM import ModEMData

data = ModEMData.ModEMData('cascad_errfl5.dat')

print(data.periods)
data.remove_period(25.6)

For more examples, view the scripts in ModEM-Tools/python/PyModEM/scripts.