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.
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.
- 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 thepip install .
command. This is particularly the case if thepip install .
command reports "...Building wheels for collected packages: UNKNOWN...". - Note 2: The
python
command may need to bepython3
on your system. - Note 3: Make sure the correct environment is activated/sourced.
- 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
- 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
- Before running the examples make sure the FFTW libraries are in your system's search path