Stripy: A Python module for (constrained) triangulation in Cartesian coordinates and on a sphere

Louis Moresi, Ben Mather
2019 Journal of Open Source Software  
The triangulation of scattered points is a common problem in science and engineering when local neighbourhood information is required for computation. Typical applications include the calculation of neighbour relationships, interpolants, derivatives, and smoothly-fitting surfaces. A more specialised problem is the triangulation of points distributed on the surface of a sphere, nevertheless, this is important in most global geographical applications where data are registered in longitude and
more » ... tude and the Earth's ellipticity can be considered as a second order effect. Our package, stripy, is a python, numpy-based interface to the TRIPACK and STRIPACK Fortran code for (constrained) triangulation in Cartesian coordinates and on a sphere, respectively (Renka, 1996a (Renka, , 1997a and includes routines from SRFPACK and SSRFPACK for interpolation (nearest neighbour, linear, and hermite cubic) and to evaluate derivatives (Renka, 1996b (Renka, , 1997b . Our focus in developing an augmented set of wrappers for a venerable and widely used set of fortran subroutines has been on ease of use so that triangulated or scattered data on the sphere can be brought quickly into interactive jupyter notebooks for analysis and interrogation. stripy is an object-oriented package that extends the functionality of the original collection of subroutine by adding a number of useful tools such as the construction of regular meshes on the sphere (icosahedral and octahedral each with face-centre-point variants, a triangulated cube and a truncated icosahedron with face-centre points that produces a C60 / soccerball mesh). stripy also includes functionality to refine meshes globally and locally by triangle or edge subdivision. We have taken some care to ensure that queries on the triangulations are vectorised within numpy queries. stripy offers a consistent API between the two coordinate Figure 1: Samples meshes on the sphere produced by stripy based on the octahedron with added points at the face centroids (far left), and the icosahedron with with face points (left).
doi:10.21105/joss.01410 fatcat:dafyxauaavgyfmzozydnsaihby