Deep time spatio‐temporal data analysis using pyGPlates with PlateTectonicTools and GPlately

PyGPlates is an open‐source Python library to visualize and edit plate tectonic reconstructions created using GPlates. The Python API affords a greater level of flexibility than GPlates to interrogate plate reconstructions and integrate with other Python workflows. GPlately was created to accelerate spatio‐temporal data analysis leveraging pyGPlates and PlateTectonicTools within a simplified Python interface. This object‐oriented package enables the reconstruction of data through deep geologic time (points, lines, polygons and rasters), the interrogation of plate kinematic information (plate velocities, rates of subduction and seafloor spreading), the rapid comparison between multiple plate motion models, and the plotting of reconstructed output data on maps. All tools are designed to be parallel‐safe to accelerate spatio‐temporal analysis over multiple CPU processors.


| INTRODUCTION
Over the last two decades, the open-source and crossplatform GPlates (www.gplates.org) software has been powering global tectonic reconstructions of the motions of tectonic plates through time (Dietmar Müller et al., 2018).The synthesis of disparate geological and geophysical data to build and test past configurations of tectonic plates has resulted in numerous tectonic plate reconstructions being built by scientists from around the globe.Using seafloor magnetic reversals, hotspot trails and other geological data to constrain plate motions, initial tectonic reconstructions used rigid plate geometries (Seton et al., 2012) and have been iteratively refined to accommodate deforming zones at plate margins (Dietmar Müller et al., 2019).The traditional geographic information systems (GIS) interface of GPlates to build and visualize reconstructions has led to wide community adoption, however, the extraction of tectonic information from the graphical user interface (GUI) can be cumbersome or incomplete for spatio-temporal data analysis.The emergence of Python as a widely used scientific programming language brings with it new opportunities to use and interrogate different plate reconstructions.PyGPlates was created to facilitate such spatio-temporal data analysis.PyGPlates is a fine-grained Python interface aimed at exposing the essential plate reconstruction functionality of GPlates to researchers.However, this can be challenging for geoscientists with minimal grounding in Python programming.Even researchers experienced in pyGPlates may find the low-level details cumbersome.Here, we introduce a highlevel interface to pyGPlates, which streamlines many of the low-level functions within pyGPlates into a simplified object-oriented package called 'GPlately'.In this study, we demonstrate the use of GPlately in extracting plate kinematic properties from plate boundaries, such as seafloor spreading rates, trench convergence rates and hotspot trails on oceanic crust.

| GETTING STARTED
GPlately requires a working installation of pyGPlates, which is freely available online.All major system architectures (e.g.Linux, MacOS, Windows) are supported and installation instructions are well documented.Sample data are also available from EarthByte servers (https:// www.earth byte.org/category/resou rces/), which includes rasters, seafloor age grids, rotation files and more to get started with plate reconstructions.Several other software dependencies are required to instal GPlately, including NumPy (Harris et al., 2020), SciPy (Virtanen et al., 2020), Stripy (Moresi & Mather, 2019), GeoPandas (Jordahl et al., 2019), Cartopy (Met Office, 2010-2015), Shapely (Gillies et al., 2021), PlateTectonicTools and RasterIO (Gillies, 2013) which uses GDAL (Rouault et al., 2022).All of the workflows documented here and online require a plate motion model to function.These comprise of (i) plate rotations (inside one or more .rotfiles), which describe the kinematic evolution of features within the model; (ii) topology features (inside .gpmlfiles), which hold point, polyline and polygon geometries describing the location and evolution of plate boundaries; and (iii) static polygons, which are polygons describing discrete and coherent areas of Earth's lithosphere (e.g.continents, also inside .gpmlfiles).The user has the flexibility to use their own reconstructions, or choose a published plate model packaged by GPlately, which can be retrieved from EarthByte servers using the DataServer object: A full list of available plate models can be obtained by running help(DataServer).Multiple plate models can be defined at the same time, which allows the user to easily compare plate reconstructions.The GPlately GitHub repository (github.com/GPlates/gplately) provides several example Jupyter notebooks for the user to get started.All of the functionality described in following sections are accompanied by Python code using the GPlately API and assume the model and gplot objects have been created using a preferred plate model.An introduction to defining these objects are provided in Notebook 1.The code to produce the figures are not described in detail here, for the sake of brevity, however all figures can be reproduced in the example Jupyter notebooks provided in the GPlately GitHub repository and in the Zenodo archive linked to this paper.

| PLATE RECONSTRUCTIONS
In this example, we compare the motion of India as it collides with Asia (Figure 1).Here, we encapsulate multiple GPlately plotting features including (i) plate motion streamlines with velocity components, (ii) continents and coastlines, (iii) plate boundaries-including convergent margins with subduction teeth symbology.The gplot object simplifies the reconstruction and plotting of geological lines and polygons.To update the plate topologies, the user simply updates the time attribute, for example, which automatically assigns plate IDs to each of the points based on the static polygons (a list of plate IDs may also be manually assigned).The Points object handles the reconstruction of point data back through geological time and is documented in Notebook 3 of the GPlately GitHub repository.We used a 5-times refined icosahedral mesh generated by stripy to cluster data for visual clarity (Moresi & Mather, 2019).The ordering of reconstructed latitudes and longitudes remain identical to the input coordinates, which preserves the relationship between them and other attributes which may be stored in a pandas dataframe or ESRI shapefile.

BOUNDARIES
GPlately leverages another Python package 'Plate Tecto nicTools' which is a collection of high-level functions to interrogate plate models.Notably, PlateTectonicTools has the ability to extract ridge spreading rates and subduction convergence information.Here, mid-ocean ridges and subduction zones are tessellated from a user-defined spacing and appended to a list for each time step.In this example, we plot the rate of crustal production (area of new seafloor that is formed at mid-ocean ridges) compared to the rate of crustal destruction (area of seafloor that is recycled at subduction zones) for three plate models: (Dietmar Müller et al., 2016, 2019;Merdith et al., 2021).This example is documented in Notebook 7 of the GPlately GitHub repository.

| Mid-ocean ridges
The rate of spreading is calculated at ridge segments tessellated across the globe.Integrating the area of seafloor created at mid-ocean ridges over a time span results in the rate of seafloor production which can be compared with the rate of seafloor destruction calculated at trenches (Figure 3).These remain mostly in harmony with each other for a given plate model, but differences arise when comparing plate models.This is to be expected due to differences in plate topologies and rotation models resolved in each plate model, resulting in different divergence and convergence rates.Care must be taken by the user to ensure subduction zones and spreading ridges are properly tagged when creating or modifying plate reconstructions, so that non-subduction boundaries are not accommodating convergence.Comparing rates of crustal production to destruction is a useful first-order test to ensure the surface area of the Earth remains in balance through geological time.This highlights the power of GPlately to easily produce these metrics and compare them against various plate models.

| Subduction zones
The rate of subduction is calculated at trench segments tessellated across the globe.At each segment the relative motion of the down-going plate relative to the overriding plate provides the following analytics: subduction convergence rate, subduction obliquity and the trench migration rate.The rate at which oceanic lithosphere is consumed at subduction zones (termed 'slab flux') can be computed using the subduction convergence rate and the thickness of oceanic lithosphere estimated from plate models of oceanic lithosphere cooling (Grose, 2012).

| Motion paths
Another way to interrogate point data is to create motion paths which track the motion of a plate over a single point.This is commonly used to compare hotspot trails predicted from the plate model (assuming a fixed plume reference frame) against age-progressive volcanic trails.In this example we use the present-day location of the Hawaiian mantle plume to reconstruct a motion path of the Pacific Plate over 100 million years (Wessel & Kroenke, 2008; Figure 4).lons, lats, time_array, plate_ID, anchor_plate_ID, return_rate_of_motion=True) While some plumes are known to wander by several degrees over tens of millions of years (Koppers et al., 2021;Steinberger & Antretter, 2006), the majority of plumes are relatively stationary compared to the overriding plates.Nevertheless, several motion paths can be constructed assuming different rates of plume motion.Motion paths can be created by seeding one or multiple points of present-day

| Flowlines
Flowlines are lines that trace the movement of tectonic plates away from a spreading centre.They are useful to track the divergent motion of two plates separated by a mid-ocean ridge.In this example, we show how to produce flowlines along the South Atlantic ridge, which illustrates the seafloor spreading between Africa and South America over the last 120 million years (Figure 5).The flowlines reconstructed at four points along the ridge produce a good alignment to the seafloor fabric, namely fracture zones.Flowlines are useful to reconstruct the direction and asymmetry of seafloor spreading rates at mid-ocean ridges globally.Multiple flowlines can be reconstructed using the plate ID on either side of the ridge.Notebook 9 in the GPlately GitHub repository documents how to construct flowlines from seed points along mid-ocean ridge segments.

| FUTURE OUTLOOK
The extraction of spatio-temporal data from plate reconstructions using GPlately presents exciting new opportunities in machine learning.Training neural networks on a range of plate kinematic parameters can be used to predict the formation of certain types of mineral deposits such as porphyry copper (Julian Diaz-Rodriguez et al., 2021).In addition, integrating recycled oceanic lithosphere at subduction zones through deep geological time using GPlately can bring context to intraplate volcanism (Mather et al., 2020), among many other future applications.
The ability to integrate geological history to make inferences on various data is very important in the Earth Sciences.PyGPlates are continuously being improved to add more functionality, particularly to improve support for deforming plate models where strain rates can be calculated close to plate margins through time.GPlately is continually being developed to adopt the latest improvements in pyGPlates and present them as a convenient high-level interface to the user.

F
Reconstructed motion path of the Hawaiian-Emperor Chain over 100 million years using GPlately.The rate of Pacific Plate motion is calculated relative to a fixed point.This figure can be reproduced in Notebook 9 of the GPlately GitHub repository F I G U R E 5 Tectonic flowlines of four points along the South Atlantic ridge that track the opening of the South Atlantic ocean.This figure can be reproduced in Notebook 9 of the GPlately GitHub repository geographic coordinates using the Points interface in GPlately.The trajectory of the anchor plate ID is then calculated relative to the reference plate ID for different geological times inputted by the user.Notebook 9 of the GPlately GitHub repository provides various approaches to construct motion paths.