Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.99 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.99 KB

GA-AEM Python forward modelling interface

Description

The Python (>=v3.5) interface consists of a C/C++ shared library (.so on Linux or .dll on Windows) called gatdaem1d which contains time-domain forward modelling and derivative functions which are called by the Python interpreter.

Compiling and installing the C/C++ shared libraries

Ensure that the GNU C++ compiler is available, and FFTW has been installed.

Mac OSX currently has issues using cmake and brew installed gcc compilers. So we are stuck using a Makefile. Simply type "make" in the python folder. On Linux, the easiest option is to use "make" also.

Two environment variables need to be set before compilation using "export cxx=g++" and "export FFTW_ROOT=".

On Windows, follow the documentation in the root folder. Once the library is compiled, go ahead and pip install.

PIP install of the Python package

  • To install as a python package you can then,
	pip install .
  • Note 1: You may need to update pip with pip install --upgrade pip before running the pip install . command. This is particularly the case if the pip install . command reports "...Building wheels for collected packages: UNKNOWN...".
  • Note 2: The python command may need to be python3 on your system.
  • Note 3: Make sure the correct environment is activated/sourced.

Examples

  • The directory [ga-aem-install-dir]/python/examples contains an example of how to use the gatdaem1d package.
  • To run the example
	cd [ga-aem-install-dir]/python/examples
	python skytem_example.py

Dependencies

Python dependencies

  • The gatdaem1d package itself requires the numpy Python package.
  • The example additionally requires the matplotlib Python package.
  • Numpy and matplotlib can usually be installed as follows:
	python -m pip install numpy
	python -m pip install matplotlib

FFTW dependency

  • Before running the examples make sure the FFTW libraries are in your system's search path