Skip to main content

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 developed with geophysical applications in mind, e.g. ray-based seismic/GPR tomography and microseismic 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}
}

Release files for ttcrpy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ttcrpy 1.0.0
File Size Uploaded
ttcrpy-1.0.0.tar.gz 19.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for ttcrpy 1.0.0
File
ttcrpy-1.0.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
ttcrpy-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
ttcrpy-1.0.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
ttcrpy-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details
ttcrpy-1.0.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
ttcrpy-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 Details

Total release size:27.8 MB

Release files / ttcrpy-1.0.0.tar.gz

Download URL ttcrpy-1.0.0.tar.gz
Size 19.1 MB
Tags Source
SHA-256 checksum
How to use checksums
06326d1b8f09fef2be0d2a5ad94d1cbffc4d1e78a2e23da0b60197935c7f5379
BLAKE2b-256 checksum
How to use checksums
491aa0059771734194cbb777828dc966ee82874a2daf5c09f34a84e50037f801
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / ttcrpy-1.0.0-cp38-cp38-win_amd64.whl

Download URL ttcrpy-1.0.0-cp38-cp38-win_amd64.whl
Size 1.0 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b40272f3ed1739f48b10f0437013c8891195f9fd282518706bc7f4c336c566de
BLAKE2b-256 checksum
How to use checksums
9a4217b894328c3d37cbb180d320b462c92765cffd6fe1598130a400d3229786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Release files / ttcrpy-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl

Download URL ttcrpy-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.9 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a015644b11afe7887eeb3b3c4d53e8d061ecf64ec02e80824ebe15c3a65fbe01
BLAKE2b-256 checksum
How to use checksums
40d6ad057048fff059025f837f77cfad76868677a009ce0bd38b424182537a2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

Release files / ttcrpy-1.0.0-cp37-cp37m-win_amd64.whl

Download URL ttcrpy-1.0.0-cp37-cp37m-win_amd64.whl
Size 1.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
1050dbfebbb028daf112df4494db84f32ea452864858a85867d14988db35042b
BLAKE2b-256 checksum
How to use checksums
2fef2ff2407a757d742567da6fbf1e12f1c231d26b2b9ccd1a9ef851dc20ca9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Release files / ttcrpy-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL ttcrpy-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Size 1.9 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d14675112df0efd97f33d8d399f4f6fb2e8e9944f62500635f0c18e2c8decd04
BLAKE2b-256 checksum
How to use checksums
d445f1f63d1bd1fe36b0821eb4cb96456f3a9e8ff8ea37d0de6a1abc8b59eaff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

Release files / ttcrpy-1.0.0-cp36-cp36m-win_amd64.whl

Download URL ttcrpy-1.0.0-cp36-cp36m-win_amd64.whl
Size 1.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
689e5eff9212f59e6bba0112df1ad82a8896313eb5623243ba5a509891a53b76
BLAKE2b-256 checksum
How to use checksums
39ff009ddc96e4466ca5fe34779bccdb196fa6e9ed3a48724f5c69527ea69355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

Release files / ttcrpy-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl

Download URL ttcrpy-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Size 1.9 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
41a441b53f3c9791c5ab68244d2ca64f2771f8bc2bdd2d1a90e827da2c0c760b
BLAKE2b-256 checksum
How to use checksums
73b6fc5570a47d7dbe4fda0d0b0c516729f1ce44c96feea41521b30c7ba84211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

Release history Release notifications | RSS feed

1.5.3

22 release files

1.5.2

22 release files

1.4.2

22 release files

1.4.1

22 release files

1.4.0

22 release files

1.3.9

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.3

21 release files

1.3.1

17 release files

1.3.0

17 release files

1.2.2

17 release files

1.2.1

17 release files

1.2.0

9 release files

1.1.8

9 release files

1.1.7

7 release files

1.1.6

7 release files

1.1.5

7 release files

1.1.3

7 release files

1.1.2

7 release files

1.1.1

7 release files

1.1.0

7 release files

1.0.9

5 release files

1.0.8

5 release files

1.0.7

7 release files

1.0.6

7 release files

1.0.5

10 release files

1.0.3

10 release files

1.0.2

7 release files

1.0.1

7 release files

This release

1.0.0 This release

7 release files

0.4.8

10 release files

0.4.7

9 release files

0.4.6

10 release files

0.4.5

10 release files

0.4.4

10 release files

0.4.3

6 release files

0.4.2

3 release files

0.4.0

10 release files

0.3.6

9 release files

0.3.5

9 release files

0.3.4

9 release files

0.3.3

5 release files

0.3.2

3 release files

0.3.1

3 release files

0.1.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page