Skip to main content

Accurate Eikonal solver for Python

Project description

License Stars Pyversions Version Downloads Code style: black Codacy Badge Codecov Build Docs DOI

fteikpy is a Python library that computes accurate first arrival traveltimes in 2D and 3D heterogeneous isotropic velocity models. The algorithm handles properly the curvature of wavefronts close to the source which can be placed without any problem between grid points.

The code is based on FTeik implemented in Python and compiled just-in-time with numba.

sample-marmousi

Computation of traveltimes and ray-tracing on smoothed Marmousi velocity model.

Features

Forward modeling:

  • Compute traveltimes in 2D and 3D Cartesian grids with the possibility to use a different grid spacing in Z, X and Y directions,

  • Compute traveltime gradients at runtime or a posteriori,

  • A posteriori 2D and 3D ray-tracing.

Parallel:

  • Traveltime grids are seemlessly computed in parallel for different sources,

  • Raypaths from a given source to different locations are also evaluated in parallel.

Installation

The recommended way to install fteikpy and all its dependencies is through the Python Package Index:

pip install fteikpy --user

Otherwise, clone and extract the package, then run from the package location:

pip install . --user

To test the integrity of the installed package, check out this repository and run:

pytest

Documentation

Refer to the online documentation for detailed description of the API and examples.

Alternatively, the documentation can be built using Sphinx:

pip install -r doc/requirements.txt
sphinx-build -b html doc/source doc/build

Usage

The following example computes the traveltime grid in a 3D homogeneous velocity model:

import numpy as np
from fteikpy import Eikonal3D

# Velocity model
velocity_model = np.ones((8, 8, 8))
dz, dx, dy = 1.0, 1.0, 1.0

# Solve Eikonal at source
eik = Eikonal3D(velocity_model, gridsize=(dz, dx, dy))
tt = eik.solve((0.0, 0.0, 0.0))

# Get traveltime at specific grid point
t1 = tt[0, 1, 2]

# Or get traveltime at any point in the grid
t2 = tt(np.random.rand(3) * 7.0)

Contributing

Please refer to the Contributing Guidelines to see how you can help. This project is released with a Code of Conduct which you agree to abide by when contributing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fteikpy-2.4.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

fteikpy-2.4.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file fteikpy-2.4.0.tar.gz.

File metadata

  • Download URL: fteikpy-2.4.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for fteikpy-2.4.0.tar.gz
Algorithm Hash digest
SHA256 f934669ea6487cfcea1a2f9b72b6fad2f526ab62e395aee2805e527a5ad57146
MD5 7ed854ab405199e57fc569c1b4fc809e
BLAKE2b-256 5f8caaa3f5cf335e4319b422e3e6e0177f3435c4dd140fa99a17c4a52680b985

See more details on using hashes here.

File details

Details for the file fteikpy-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: fteikpy-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for fteikpy-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0bad0ead35d9e76a20691a1b2e1b52f7af53b4adb4c75ed1ccc119b8191c88
MD5 5d9f0193616a52e49cde177b4781bb52
BLAKE2b-256 1af32b9dab616e9a22bc1c9ab08608165a93b96f8f5be211552f1c645a91b95b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page