Giter VIP home page Giter VIP logo

fteikpy's Introduction

fteikpy

License Stars Pyversions Version Downloads Code style: black Codacy Badge Codecov Build Travis 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.

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

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
from fteikpy import Eikonal3D

# Velocity model
velocity_model = numpy.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(numpy.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.

fteikpy's People

Contributors

keurfonluu 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.