Skip to main content

Code to perform raytracing for geophysical applications

Project description

Logo

pypi License: GPL v3 DOI Build Status Documentation Status

This repo contains C++ and python codes for raytracing on regular and unstructured meshes. Matlab wrappers are provided as well.

Python package

ttcrpy is a package for computing traveltimes and raytracing that was developped with geophysical applications in mind, e.g. ray-based seismic/GPR tomography and microseismc event location (joint hypocenter-velocity inversion). The package contains code to perform computation on 2D and 3D rectilinear grids, as well as 2D triangular and 3D tetrahedral meshes. Three different algorithms have been implemented: the Fast-Sweeping Method, the Shortest-Path Method, and the Dynamic Shortest-Path Method. Calculations can be run in parallel on a multi-core machine.

The core computing code is written in C++, and has been wrapped with cython.

Documentation can be found on Read The Docs

Stand-alone command-line programs

There are three programs that can be called from the command line:

  • ttcr2d : raytracing on planar 2D meshes
  • ttcr2ds : raytracing on undulated surfaces
  • ttcr3d : raytracing in 3D

See documentation for command-line programs options and file formats.

Examples

Look at the files in the examples directory for some samples.

Compiling

The programs are coded in C++ and follow the C++11 standard. You must have VTK (http://vtk.org) installed on your system, to benefit from full functionalities. Files from the eigen3 (http://eigen.tuxfamily.org) and boost (http://www.boost.org) libraries are distributed with the source to facilitate compilation. These codes were compiled and tested on macs with the default compiler (clang). They were also tested to some extent under linux with g++ version 4.8.

Matlab wrappers

To compile the mexfiles, you will need:

  • a C++ compiler that conforms to the C++11 standard
  • the source codes of the ttcr package

On my OS X machine, I use this command to compile from a terminal:

MATLAB=/Applications/MATLAB_R2014a.app

$MATLAB/bin/mex -O CXXFLAGS='$CXXFLAGS -std=c++11 -stdlib=libc++' \
LDFLAGS='$LDFLAGS -std=c++11 -stdlib=libc++' -largeArrayDims -v \
-I$HOME/src/ttcr/ttcr -I$HOME/src/ttcr/boost_1_72_0 \
-I$HOME/src/ttcr/eigen-3.3.7 grid2dunsp_mex.cpp

3D classes must be compiled with verbose.cpp in the list of source files, i.e.

$MATLAB/bin/mex -O CXXFLAGS='$CXXFLAGS -std=c++11 -stdlib=libc++' \
LDFLAGS='$LDFLAGS -std=c++11 -stdlib=libc++' -largeArrayDims -v \
-I$HOME/src/ttcr/ttcr -I$HOME/src/ttcr/boost_1_72_0 \
-I$HOME/src/ttcr/eigen-3.3.7 grid3dunfs_mex.cpp verbose.cpp

On a windows machine with intel compiler installed, I could compile it from the matlab prompt with:

mex -v -O COMPFLAGS='$COMPFLAGS /Qstd=c++11' -largeArrayDims -I../ttcr -I../boost_1_72_0 -I../eigen-3.3.7 grid2dunsp_mex.cpp

Unfortunately, I cannot offer extensive support for compiling on other platforms, especially windows variants.

Please report bugs to bernard dot giroux at ete.inrs.ca

References


@article{doi:10.1111/1365-2478.12930,
  author = {Nasr, Maher and Giroux, Bernard and Dupuis, J. Christian},
  title = {A hybrid approach to compute seismic travel times in three-dimensional tetrahedral meshes},
  journal = {Geophysical Prospecting},
  volume = {n/a},
  number = {n/a},
  pages = {},
  keywords = {Travel time, Seismic modelling, Ray tracing, Seismics, Computing aspects},
  doi = {10.1111/1365-2478.12930},
  url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/1365-2478.12930},
  eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/1365-2478.12930},
}

@inbook{nasr18,
  author = { Maher Nasr  and  Bernard Giroux  and  J. Christian Dupuis },
  title = {An optimized approach to compute traveltimes in 3D unstructured meshes},
  booktitle = {SEG Technical Program Expanded Abstracts 2018},
  chapter = {},
  pages = {5073-5077},
  year = {2018},
  doi = {10.1190/segam2018-2997918.1},
  URL = {https://library.seg.org/doi/abs/10.1190/segam2018-2997918.1},
  eprint = {https://library.seg.org/doi/pdf/10.1190/segam2018-2997918.1}
}

@InProceedings{giroux14,
  Title = {Comparison of grid-based methods for raytracing on unstructured meshes},
  Author = {Bernard Giroux},
  Booktitle = {SEG Technical Program Expanded Abstracts},
  Year = {2014},
  Pages = {3388-3392},
  Chapter = {649},
  DOI = {10.1190/segam2014-1197.1},
  Eprint = {http://library.seg.org/doi/pdf/10.1190/segam2014-1197.1},
  URL = {http://dx.doi.org/10.1190/segam2014-1197.1}
}


@ARTICLE{giroux13,
  author = {Bernard Giroux and Beno\^{\i}t Larouche},
  title = {Task-parallel implementation of {3D} shortest path raytracing for
	geophysical applications},
  journal = {Computers & Geosciences},
  year = {2013},
  volume = {54},
  pages = {130--141},
  number = {0},
  doi = {10.1016/j.cageo.2012.12.005}
  url = {http://dx.doi.org/10.1016/j.cageo.2012.12.005}
}

@INPROCEEDINGS{giroux13b,
  author = {Bernard Giroux},
  title = {Shortest path raytracing on tetrahedral meshes},
  booktitle = {75$^{th}$ EAGE Conference \& Exhibition},
  year = {2013},
  address = {London},
  organization = {EAGE},
  doi = {10.3997/2214-4609.20130236}
  url = {http://dx.doi.org/10.3997/2214-4609.20130236}
}

@ARTICLE{lelievre11,
  author = {Leli\`evre, Peter G. and Farquharson, Colin G. and Hurich, Charles A.},
  title = {Computing first-arrival seismic traveltimes on unstructured 3-{D}
	tetrahedral grids using the Fast Marching Method},
  journal = {Geophysical Journal International},
  year = {2011},
  volume = {184},
  pages = {885-896},
  number = {2},
  doi = {10.1111/j.1365-246X.2010.04880.x}
  url = {http://dx.doi.org/10.1111/j.1365-246X.2010.04880.x}
}

@ARTICLE{qian07,
  author = {Qian, Jianliang and Zhang, Yong-Tao and Zhao, Hong-Kai},
  title = {Fast Sweeping Methods for Eikonal Equations on Triangular Meshes},
  journal = {SIAM Journal on Numerical Analysis},
  year = {2007},
  volume = {45},
  pages = {83--107},
  number = {1},
  doi = {10.1137/050627083},
  publisher = {Society for Industrial and Applied Mathematics},
  url = {http://www.jstor.org/stable/40232919}
}

@Article{zhang06,
  Title                    = {High Order Fast Sweeping Methods for Static {H}amilton–{J}acobi Equations},
  Author                   = {Yong-Tao Zhang and Hong-Kai Zhao and Jianliang Qian},
  Journal                  = {Journal of Scientific Computing},
  Year                     = {2006},
  Number                   = {1},
  Pages                    = {25--56},
  Volume                   = {29},
  DOI                      = {10.1007/s10915-005-9014-3},
  URL                      = {http://dx.doi.org/10.1007/s10915-005-9014-3}
}

@Article{zhao05,
  Title                    = {A Fast Sweeping Method for Eikonal Equations},
  Author                   = {Zhao, Hongkai},
  Journal                  = {Mathematics of Computation},
  Year                     = {2005},
  Month                    = apr,
  Number                   = {250},
  Pages                    = {603--627},
  Volume                   = {74},
  Publisher                = {American Mathematical Society},
  URL                      = {http://www.jstor.org/stable/4100081}
}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ttcrpy-0.4.3-cp38-cp38-manylinux2010_x86_64.whl (47.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

ttcrpy-0.4.3-cp38-cp38-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

ttcrpy-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl (46.8 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

ttcrpy-0.4.3-cp37-cp37m-macosx_10_15_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

ttcrpy-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl (46.8 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

ttcrpy-0.4.3-cp36-cp36m-macosx_10_15_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

Details for the file ttcrpy-0.4.3-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 47.7 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/2.7.12

File hashes

Hashes for ttcrpy-0.4.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1a3bcf0a74222486bbd19829bb83a05ef8b1c3ce330b8abdd6693f28c390c6a3
MD5 bf172f962c043e56113e532c0f7d7bf9
BLAKE2b-256 1b7ee6ee53c86086bf9bc9a4966dce9edc7bc6ef85e977f04724cc347ebcd061

See more details on using hashes here.

File details

Details for the file ttcrpy-0.4.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for ttcrpy-0.4.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 67add31d2cfd2896ff07e4ad957f7be0e95128e0592f91b11e51f4bf03621ce8
MD5 0a77ac1d36fbd22ccaaf3501b45f0cd8
BLAKE2b-256 2e71ab54e5805ee4778d2df73b253d69c9254f5b6d0c36e079adfcfaf68ee186

See more details on using hashes here.

File details

Details for the file ttcrpy-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 46.8 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/2.7.12

File hashes

Hashes for ttcrpy-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f7d853c26aa485bf546386e029ab7b279698ea3ae54f11ad418ec8633cfe4a22
MD5 56fe45132acd214f177c2b5eb1e0c464
BLAKE2b-256 1236092ab738095419b8ef331b04394378371bb44e071ffd629db2f7b9b9af1a

See more details on using hashes here.

File details

Details for the file ttcrpy-0.4.3-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for ttcrpy-0.4.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fc0299a83d9ed34becb1bc36b6cecc3fca35bd8c7470e919f5b2ba97a69fdb98
MD5 7f983e74f14bf178cd2cf03d67ec92b4
BLAKE2b-256 e6ffe7b3ba4647e3db1ddc009c26e9f72ffe7f7e332081ea49556f347321de65

See more details on using hashes here.

File details

Details for the file ttcrpy-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 46.8 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/2.7.12

File hashes

Hashes for ttcrpy-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 68951c013016d8cb810853d4ab22da4d217522de4c091f3c55b3f4c5bb5b8962
MD5 eecd820cb9781f7b87c161b02f4eb296
BLAKE2b-256 74e2aba481f1cc309758562cbdf2cb07dcf2e70b1a056d2be71fe6b491b933be

See more details on using hashes here.

File details

Details for the file ttcrpy-0.4.3-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: ttcrpy-0.4.3-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.3

File hashes

Hashes for ttcrpy-0.4.3-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 321d79a48cbea70b4b21d18b453ac4bb151983375740a896744ce4d33d7be481
MD5 3f39639c34f506e416faf15f2008bdec
BLAKE2b-256 ba9d311bb260b63b64f252cc3cebdce18e062b0c7529cb91f18527f279dc0a59

See more details on using hashes here.

Supported by

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