FTeikPy is a Python module that computes accurate first arrival traveltimes in 2-D and 3-D heterogeneous isotropic velocity model.
Project description
Summary
The algorithm handles properly the curvature of wavefronts close to the source. The source can be placed without any problem between grid points.
- Version:
1.0.0
- Author:
Mark Noble
- Maintainer:
Keurfon Luu
- Web site:
- Copyright:
This document has been placed in the public domain.
- License:
FTeikPy is released under the MIT License.
NOTE: the 2-D and 3-D Eikonal solvers included in FTeikPy are written in Fortran. The original source codes can be found here. Detailed implementation of local operators and global propagation scheme implemented in this package are inspired from [1]. If you find this algorithm and/or package useful, citing this paper would be appreciated.
Installation
Download and extract the package, then run:
python setup.py install
Usage
First, import FTeikPy and define (or import) your velocity model (here in 2-D):
import numpy as np
from fteikpy import Eikonal
nz, nx = 351, 1000
dz, dx = 10., 10.
vel2d = np.full((nz, nx), 1500.)
Then, initialize the Eikonal solver:
eik = Eikonal(vel2d, grid_size = (dz, dx), n_sweep = 2)
Finally, for a given source point with coordinate (x,z), run the method solve:
source = (5000., 0.)
tt = eik.solve(source)
The same can be done on a 3-D velocity model (just a bit slower…).
Troubleshooting on Windows
A Fortran compiler is required to install this package. While it is straightforward on Unix systems, it can be quite a pain on Windows. We recommend installing Anaconda that contains all the required packages to install FTeikPy on Windows systems.
Download MinGW 64 bits (choose x86_64-posix-sjlj) and extract the archive in your drive root.
Add MinGW to your system path:
C:\<Your MinGW directory>\bin
Create the file distutils.cfg in <Your Python directory path>\Lib\distutils with the following content to use MinGW compiler:
[build]
compiler=mingw32
Open a terminal and install libpython:
conda install libpython
If you got the error:
Error: ValueError: Unknown MS Compiler version 1900
You may need to manually patch the file cygwinccompiler.py located in:
<Your Python directory path>\Lib\distutils
by replacing:
self.dll_libraries = get_msvcr()
in lines 157 and 318 by (be careful with indentation):
pass
You should also patch the file mingw32compiler.py located in:
<Your Python directory path>\Lib\site-packages\numpy\distutils
by commenting out from lines 96 to 104:
# msvcr_success = build_msvcr_library()
# msvcr_dbg_success = build_msvcr_library(debug=True)
# if msvcr_success or msvcr_dbg_success:
# # add preprocessor statement for using customized msvcr lib
# self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR')
#
# # Define the MSVC version as hint for MinGW
# msvcr_version = '0x%03i0' % int(msvc_runtime_library().lstrip('msvcr'))
# self.define_macro('__MSVCRT_VERSION__', msvcr_version)
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.