Python interface to TRIPACK and STRIPACK fortran code for triangulation/interpolation in Cartesian coordinates and on a sphere
Project description
Stripy
A Python interface to TRIPACK and STRIPACK Fortran code for (constrained) triangulation in Cartesian coordinates and on a sphere. Stripy is an object-oriented package and includes routines from SRFPACK and SSRFPACK for interpolation (nearest neighbor, linear and hermite cubic) and to evaluate derivatives (Renka 1996a,b and 1997a,b).
stripy
is bundled with litho1pt0
which is a python interface to the crust 1.0 dataset and the lithospheric part of the litho 1.0 dataset (Laske et al, 2013 and Pasyanos et al, 2014) which both requires and demonstrates the triangulation / searching and interpolation on the sphere that is provided by stripy
.
Sample images created with stripy
illustrating the meshing capability: ocean age data can be triangulated on the sphere with no need for points on land. Once stripy
ingests your data points, you can sample another dataset to your grid (bathymetry on the right), smooth, find the derivatives of your data, or interpolate to another set of points.
Documentation
There are two matching sets of stripy
notebooks - one set for Cartesian Triangulations and one for Spherical Triangulations. For most geographical applications, the spherical triangulations are the natural choice as they expect longitude and latitude coordinates (admittedly in radians). There are some worked examples
which use the companion package litho1pt0
Stable code
- Documentation / Notebooks https://underworldcode.github.io/stripy/2.0.5b2
- API documentation https://underworldcode.github.io/stripy/2.0.5b2_api
Bleeding edge code
- Documentation / Notebooks https://underworldcode.github.io/stripy/2.1.0b1
- API documentation https://underworldcode.github.io/stripy/2.1.0b1_api
For previous versions, see the changelog
Installation & Running in the cloud
Binder
Launch the demonstration
(This is the development branch)
Citation
Moresi, L. and Mather, B.R., (2019). Stripy: A Python module for (constrained) triangulation in Cartesian coordinates and on a sphere.. Journal of Open Source Software, 4(38), 1410, https://doi.org/10.21105/joss.01410
Navigation / Notebooks
There are two matching sets of stripy
notebooks - one set for Cartesian Triangulations and one for Spherical Triangulations. For most geographical applications, the spherical triangulations are the natural choice as they expect longitude and latitude coordinates (admittedly in radians).
Note: the Cartesian and Spherical notebooks can be obtained / installed from stripy
itself as follows:
python -c 'import stripy; stripy.documentation.install_documentation(path="Notebooks")'
Cartesian
- Ex1-Cartesian-Triangulations.ipynb
- Ex2-CartesianGrids.ipynb
- Ex3-Interpolation.ipynb
- Ex4-Gradients.ipynb
- Ex5-Smoothing.ipynb
- Ex6-Scattered-Data.ipynb
- Ex7-Refinement-of-Triangulations.ipynb
- Ex8-Spline-Tension.ipynb
- Ex9-Voronoi-Diagram.ipynb
Spherical
- Ex1-Spherical-Triangulations.ipynb
- Ex2-SphericalGrids.ipynb
- Ex3-Interpolation.ipynb
- Ex4-Gradients.ipynb
- Ex5-Smoothing.ipynb
- Ex6-Scattered-Data.ipynb
- Ex7-Refinement-of-Triangulations.ipynb
- Ex8-Spline-Tension.ipynb
- Ex9-Voronoi-Diagram.ipynb
Examples
Note, these examples are the notebooks from litho1pt0
which are installed from the
package itself:
python -c 'import litho1pt0; litho1pt0.documentation.install_documentation(path="Notebooks")'
The first three notebooks are an introduction to litho1pt0
that does not explicitly mention stripy
but
the next two worked examples show how to search, interpolate and plot with the help of stripy
routines.
- Ex1-Litho1Layers.ipynb
- Ex2-Litho1Properties.ipynb
- Ex3-CrustalRegionalisation.ipynb
- WorkEx1-CratonAverageProperties.ipynb
- WorkEx2-OceanDepthAge.ipynb
Installation
Dependencies
You will need Python 3.6+. Also, the following packages are required:
Recommended Packages for running the notebooks:
All of which should be available from pip or anaconda (conda-forge) for most platforms.
Installing using pip
You can install stripy
using the
pip package manager
with either version of Python:
python3 -m pip install stripy
All the dependencies will be automatically installed by pip
, except for gfortran
(or any Fortran compiler). It must be installed in your system before installing
stripy
with pip
.
If you change the Fortran compiler, you may have to add the
flags config_fc --fcompiler=<compiler name>
when setup.py
is run
(see docs for numpy.distutils).
Installing with conda
If you use the anaconda packaging system, then you should be able to
conda install -c geo-down-under stripy
Usage
Two classes are included as part of the Stripy package:
sTriangulation
(Spherical coordinates)Triangulation
(Cartesian coordinates)
These classes share similar methods and can be easily interchanged. In addition, there are many helper functions provided for building meshes.
A series of tests are located in the tests subdirectory.
In order to perform these tests clone the repository and run pytest
:
git checkout https://github.com/underworldcode/stripy.git
cd stripy
pytest -v
References
-
Laske, G., G. Masters, and Z. Ma (2013), Update on CRUST1. 0—A 1-degree global model of Earth's crust, Geophys Research Abstracts, 15, EGU2013–2658.
-
Pasyanos, M. E., T. G. Masters, G. Laske, and Z. Ma (2014), LITHO1.0: An updated crust and lithospheric model of the Earth, Journal of Geophysical Research-Solid Earth, 119(3), 2153–2173, doi:10.1002/2013JB010626.
-
R. J. Renka, "ALGORITHM 751: TRIPACK: A Constrained Two- Dimensional Delaunay Triangulation Package" ACM Trans. Math. Software, Vol. 22, No. 1, 1996, pp. 1-8.
-
R. J. Renka, "ALGORITHM 752: SRFPACK: Software for Scattered Data Fitting with a Constrained Surface under Tension", ACM Trans. Math. Software, Vol. 22, No. 1, 1996, pp. 9-17.
-
R. J. Renka, "ALGORITHM 772: STRIPACK: Delaunay Triangulation and Voronoi Diagram on the Surface of a Sphere" ACM Trans. Math. Software, Vol. 23, No. 3, 1997, pp. 416-434.
-
R. J. Renka, "ALGORITHM 773: SSRFPACK: Interpolation of Scattered Data on the Surface of a Sphere with a Surface under Tension", ACM Trans. Math. Software, Vol. 23, No. 3, 1997, pp. 437-439.
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.
Source Distribution
Built Distributions
Hashes for stripy-2.3.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51154eb92b99ec707ab6f2830d3a1f9e6005ae09e5e7527856346df8c5d476ba |
|
MD5 | db16bb6162696a901a612115ab19954a |
|
BLAKE2b-256 | c23bc1cece717a53c8d6168d0cc3db058ab7a7618e8bd15cb366e846c21d4fe9 |
Hashes for stripy-2.3.3-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7587c8732062b8c6e0651a697e593305a9c09bf379153e32b61d6390aa2dffda |
|
MD5 | 5f2d6b6614ff562956bc0716ab582601 |
|
BLAKE2b-256 | 87304d018fc2b349b2b0db1480fc23f21519be74b1d8ca106d0abfadd779bd9b |
Hashes for stripy-2.3.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2b37036477fc557b299376da1a805a24b2d2dec10e50f7a0bcc91175d0933f |
|
MD5 | ebb8d32daeac8859f636da916d953efa |
|
BLAKE2b-256 | 1e4467854e195c4c3b078ad2c149fb868057cf0a2cff3f069c308a5898c6ab50 |
Hashes for stripy-2.3.3-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2130ae51904acd435382dfbfc65cf1224b1d69f050f855846ce0988111e5d649 |
|
MD5 | 1af9940919bcebba13e518063385d4f8 |
|
BLAKE2b-256 | 13f350b82093f03af2b468de972994722205fdb60e4731f740c568b71294b181 |
Hashes for stripy-2.3.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c316176b9a5bf066b7b5592d18b0be795cd9781c82b889d380893ab74636360e |
|
MD5 | 14b86559f1216ff4fa7165ed2d538f14 |
|
BLAKE2b-256 | 9d122c3df03fc8cb3615507208c26983e4cb3fa5d897ed192fe6539acf41e6a0 |
Hashes for stripy-2.3.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8196dcf2383b33d0d45c0e45542795fe9597cefd7c7b41c7d44d71f2cfd43ed5 |
|
MD5 | cab852bd6a89fb91a591b7b1de284884 |
|
BLAKE2b-256 | fb0a7e018511b584ad7d8da541bfa31d341cf85af823702424a604c2a04bdc4e |
Hashes for stripy-2.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3afe76a08fa4f049c7b45b5e0de88cd8fbb62be4bad80293c291c2a432c9431 |
|
MD5 | 54037e48599b4fc041fcc4275fc76817 |
|
BLAKE2b-256 | 6a9285bc5724a61c7fa61cedfb247e8b5a04105e6ae6bfd93da9f60a7ac23bef |
Hashes for stripy-2.3.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df655bdc5f9fb7adf6ec99109a72f83654de19c9ab1c9e56095ffe6c6a753fd6 |
|
MD5 | 8eabf8619d20bead27b3722ac532d0fe |
|
BLAKE2b-256 | 558b4dca3cccb9e63844e1d334b5d769cb2437b83525e176597e7d5c91fdfff8 |
Hashes for stripy-2.3.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe27809d6fb0eada1e3887c50c96d6bec64044735c7ad077e0d5a8c3c748a072 |
|
MD5 | e28b8cdb8dde291c849d8a789dea1da5 |
|
BLAKE2b-256 | 5121d3fcb86a5f0b934e696868688732d6754ecb671853d7f3cc8fea997b6990 |
Hashes for stripy-2.3.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120fc07bcb155891e48f04573afd4e3d3542034116913c2eebc4d9125e727dd7 |
|
MD5 | 30bf403be7a373d8ef1acfbecca59b2d |
|
BLAKE2b-256 | b8e4f38b1146d45ca8b93f55e2a69fea28c96962b694c663491b526a54fe8dc5 |
Hashes for stripy-2.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 169e9489d9f5f0d873bc8cdf6b70fc1bc8974855df70c8d78d151679705cd53a |
|
MD5 | f8e455b6f8e47cbcffa84bb3c9032ab4 |
|
BLAKE2b-256 | 8ef55d89c5d82e081b58b78b0ccc0b10fb2c390fd2af9ca5a65e540433fc186d |
Hashes for stripy-2.3.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 616ce0094f037bada4b927053bf559cd838be23534fde84542022c8f2fcc360b |
|
MD5 | 42f8fc7d157f4c7d67e904979af3a043 |
|
BLAKE2b-256 | 7e547570741028a034fde7a8e515909ba936577eb592f612e673a975734d9317 |
Hashes for stripy-2.3.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1049be2721253eaf8bc74e201bdfb261e31a9cef3928271ea2d2437d15c68d6e |
|
MD5 | c03cd5594145205bf57d1e727d3e5252 |
|
BLAKE2b-256 | 50b8c4bca244c329423227e412cf84703e4ee72ad9204423e752c1a6ca40c481 |
Hashes for stripy-2.3.3-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 277d7f1cac668bd54a5aad87e661c8ca83d872e54f88b90a3c6111ca718e0187 |
|
MD5 | 073fccce19b651baa35c9dffc25e58c7 |
|
BLAKE2b-256 | ce549c2dfc1d00672908570ccee574f785c168b1dea0141dfdc05410dc55e060 |
Hashes for stripy-2.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae5f4642ab4a9e7797d3ab6a67a3d3d597c6a1d990edc0e76e24df51c9c93476 |
|
MD5 | d89220235ee8d777ff837fb05b5c1e3f |
|
BLAKE2b-256 | 4a29cbf8b5663113030070143dd41002c3b11d4fd7ff8ca3154f80634f5551a3 |
Hashes for stripy-2.3.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d686e1f5bdf22f48998923269573fa6bceb5df06e52b5699c929598f39a39294 |
|
MD5 | 1e7e711bc3eb2096439656f0542a6a24 |
|
BLAKE2b-256 | 785769b201e10add6462524d1dd70a7d392496cf73d4207813daf654beed1391 |
Hashes for stripy-2.3.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe8797bd83f22ddf2eef14a9498d752b63de170583d27d307c07ff38cadb6a44 |
|
MD5 | 38163488e942b3b32628dc7c2585efc9 |
|
BLAKE2b-256 | 665425422e90c29198db4730136998e6cf0dcd8d5e881b94d3523582d17cf421 |
Hashes for stripy-2.3.3-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53fb7d7e04f2a4fd6f13b35bd0838c55236e457fad962c80ab9da79df0864666 |
|
MD5 | 3dc003aef11a1e161d41530cd69b72b2 |
|
BLAKE2b-256 | 1e87e5b94b0222a057c1b8c357afba05ccb5e745caa517265699583dd2c2d9eb |
Hashes for stripy-2.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4111cd5cb67452cc0bf9bb17cff2f4a49b7d5b8b6681c18719444275fe1bc39f |
|
MD5 | dc8508a34c45492b9ee82fc7826fa019 |
|
BLAKE2b-256 | 0e6c865e5dcba346b860f9ca7b3b933202ff056883b5fadf32885f484410325a |
Hashes for stripy-2.3.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce36738a2726c063464b50ea2dfd055c8e6bf140090cc6f0f681a0feddad81fc |
|
MD5 | 481c8ea1b29e534583005b7fb1ef4f70 |
|
BLAKE2b-256 | 91d349377beccacc86b655a1c1f40c3cdda654818edaf124987c600dce9a215e |
Hashes for stripy-2.3.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed6a0178c00d56e5715743d46be343baf8ac574a9c9a527834b646e740a163fa |
|
MD5 | c163cf1850dfa8fc56d9b944aec2a8d3 |
|
BLAKE2b-256 | 4ce7db1fd0ded80ec1d1266171adec242a63eeac450288b507dfb9fc538e12e8 |
Hashes for stripy-2.3.3-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d9a2c42d42bc78e16c0c3ea27cd82d907172025054803ead9d892c99fb339d0 |
|
MD5 | ffbf167b4798fc82d54277ae8e3042ce |
|
BLAKE2b-256 | 5c2bc437de6fecb36363ccebb85363de1a237430451ff96505ec5fd31a92dc29 |
Hashes for stripy-2.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8b8bdaac540afd75e1e8496f44df2c5e9214aa7329c02f1056acbb5cafe393 |
|
MD5 | fc8b89f4400e41b3bc6b0dc2de8b843f |
|
BLAKE2b-256 | 5e0376befb8e018e15926b517343ab12b3570c7592ede443c17e7d5dea39056b |
Hashes for stripy-2.3.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d88c8581a0451e8f5d3601dafae6ddc23003da9e6fd9394e711601f35f5d5931 |
|
MD5 | 67cddb11fff765aebfff0c76f92f3409 |
|
BLAKE2b-256 | 5b82a17eebabd2800b658adda7fdbd671ba4ec6fe10309a3d78f6334b09f7057 |