GithubHelp home page GithubHelp logo

volkerrath / py4mt2 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 701.44 MB

This repository contains simple scripts for EM imaging, allowing easy access to mtpy, empymod, simpeg, fenics and other electromagnetic toolboxes.

Python 23.94% Jupyter Notebook 75.17% Shell 0.56% TeX 0.32%
magnetotellurics tdem processing visualization modeling inversion

py4mt2's Introduction

Py4MT (version 2)

This repo is in a state of reorganization and adaption to Python 3.9+ and mtpy-v2. Not ready for production use!

This repository contains simple scripts useful for EM imaging, modelling, and inversion, partly using mtpy (https://github.com/MTgeophysics/mtpy). In particular there are helper scripts for manipulating edi files, ModEM input data, and model files.

Please keep in mind that this is experimental software, and will contain errors. Use at your own risk! However, we will frequently update the repository correcting bugs, and (re)adding additional functionality.

This repository contains the following subdirectories:

  • py4mt/info Doumentation for the toolbox, and some useful documentation for python, including the most important extensions, numpy, scipy, and matplotlib

  • py4mt/modules Contains the modules distortion.py, jacproc.py, mimdas.py, modem.py mtplots.py, plot.py,
    plotrjmcmc.py, and util.py, called from the Python scripts run for different tasks of MT interprretation.

  • py4mt/scripts and py4mt/scripts2 Contains the scripts for preprocessing, visualization, and preparing the inversion of MT data. The scripts in the former directory will move to the latter in the process of adaption. The workflow for reading and processing Jacobians from ModEM outputs (original & new) has been moved to https://github.com/volkerrath/JacoPyAN.

  • py4mt/notebooks Contains jupyter notebooks for the most important scripts using the toolbox.

  • modem Modified and original ModEM source code files including corresponding Makefiles, useful for sensitivity output.

  • environment Contains conda environment description files, and some useful helper files for working within the conda environment. The current Py4MT environments contain a lot of packages which are not strictly necessary for running aempy, but useful for related geoscientific work.

Get your working copy via git from the command line:

git clone https://github.com/volkerrath/Py4MT2/

This version will run under Python 3.9+ (3.11 being the current development platform). To install it in an Linux environment (e.g. Ubuntu, SuSE), you need to do the following:

(1) Download the latest Anaconda or Miniconda version (https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html), and install by running the downloaded bash script. In order to make updates secure and avoid inconsistencies, copy .condarc to your home directory. As the Miniconda installer is not updated very frequently, it is useful to run the following within the Miniconda base environment:

conda update conda

conda update --all

Do this regularly to keep everything consistent!

(2) Create an appropriate conda environment (including the necessary prerequisites) from the files Py4MT.yml or Py4MT.txt found in the Py4MT base directory by:

conda env create -f Py4MT.yml

or:

conda create --name Py4MT --file Py4MT.txt

This will set up a Python 3.11 environment with all dependencies for aempy. Don't forget to update also Py4MT regularly, using conda update --name Py4MT --all!

(3) Activate this environment by: conda activate Py4MT_ (4) In order to reproduce the identical behavior of matplotlib, you should copy the included matplotlibrc file to the appropriate directory. Under Linux (Ubuntu), this should be : $HOME/.config/matplotlib/matplotlibrc. Pertinent changes should be made there, or have to be made within the scripts/modules using the mpl.rcParams[name]=value mechanism.

(6) Currently we have defined two environmental variable, PY4MT_ROOT and PY4MT_DATA. These need to be set in your .bashrc file pointing to the place where Py4MT is installed, and where you keep your MT data, respectively. Keeping to this scheme makes life much easier when different persons work on the tools.

Example:

export PY4MT_ROOT='${HOME}/Py4MT/'

export PY4MT_DATA='${HOME}/Py4MT/data/'

Easiest way to run scripts is using spyder. Enjoy!

py4mt2's People

Contributors

rathv avatar volkerrath avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.