Title: | R Interface for the GPlates Web Service and Desktop Application |
---|---|
Description: | Query functions to the GPlates <https://www.gplates.org/> Desktop Application and the GPlates Web Service <https://gws.gplates.org/> allow users to reconstruct past positions of geographic entities based on user-selected rotation models without leaving the R running environment. The online method (GPlates Web Service) makes the rotation of static plates, coastlines, and a low number of geographic coordinates available using nothing but an internet connection. The offline method requires an external installation of the GPlates Desktop Application, but allows the efficient batch rotation of thousands of coordinates, Simple Features (sf) and Spatial (sp) objects with custom reconstruction trees and partitioning polygons. Examples of such plate tectonic models are accessible via the chronosphere <https://cran.r-project.org/package=chronosphere>. This R extension is developed under the umbrella of the DFG (Deutsche Forschungsgemeinschaft) Research Unit TERSANE2 (For 2332, TEmperature Related Stressors in ANcient Extinctions). |
Authors: | Adam T. Kocsis [cre, aut] , Nussaibah B. Raja [ctb] , Simon Williams [ctb] , Elizabeth M. Dowding [ctb] , Deutsche Forschungsgemeinschaft [fnd], FAU GeoZentrum Nordbayern [fnd] |
Maintainer: | Adam T. Kocsis <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.5.0 |
Built: | 2024-11-05 05:13:24 UTC |
Source: | https://github.com/gplates/rgplates |
This set of functions allows the configuration of the remote URL, so the R client package can be used with a different instance of the GPlates web service, including a local implementation (served on localhost).
The function will use the http get method to access the version number of the GPlates Web Service.
getgws() setgws(url = "", check = TRUE, reset = FALSE, silent = FALSE) checkgws(silent = FALSE)
getgws() setgws(url = "", check = TRUE, reset = FALSE, silent = FALSE) checkgws(silent = FALSE)
url |
( |
check |
( |
reset |
( |
silent |
Logical flag indicating wheth the output should be silent? |
The getws
function returns the current url of the GPLates Web Service (defaults to: https://gws.gplates.org/
).
The setws
function allows the setting of GPLates Web Service URL.
getws
returns a single character string with the URL of the GWS.
Invisible return, either FALSE, or a character string with the version number.
# Access currently set remote URL. getgws() # In case you have the GWS running on localhost (default port 18000): # At time of writing this, the local instance does not return version, checking # does not work! setgws("http://localhost:18000/", check=FALSE) # To reset factory defaults setgws(reset=TRUE, check=FALSE)
# Access currently set remote URL. getgws() # In case you have the GWS running on localhost (default port 18000): # At time of writing this, the local instance does not return version, checking # does not work! setgws("http://localhost:18000/", check=FALSE) # To reset factory defaults setgws(reset=TRUE, check=FALSE)
This is version 1.1. The object contains valid returns of GWS v0.2.1, as of 2024-09-03.
data(gws)
data(gws)
A data.frame
with 5 variables and 26 observations.
The valid return combinations for selected models and feature collections are copied from https://gwsdoc.gplates.org/models.
model
The name of the reconstruction model.
feature
The name of the feature collection.
from
The oldest reconstruction age accepted by the model to return the feature collection.
to
The youngest reconstruction age accepted by the model to return the feature collection.
description
The short description of the feature collection.
Function to plot the edge of a map with different projections.
mapedge( x = 360, y = 180, xmin = -180, xmax = 180, ymin = -90, ymax = 90, out = "sf" )
mapedge( x = 360, y = 180, xmin = -180, xmax = 180, ymin = -90, ymax = 90, out = "sf" )
x |
( |
y |
( |
xmin |
( |
xmax |
( |
ymin |
( |
ymax |
( |
out |
( |
An sfc
-, or SpatialPolygons
-class object.
# requires rgdal edge <- mapedge() molledge <- st_transform(edge, "ESRI:54009") plot(molledge)
# requires rgdal edge <- mapedge() molledge <- st_transform(edge, "ESRI:54009") plot(molledge)
Meta-object containing paths to a unique plate tectonic model
## S4 method for signature 'platemodel' initialize( .Object, rotation = NULL, features = NULL, name = NULL, polygons = NULL )
## S4 method for signature 'platemodel' initialize( .Object, rotation = NULL, features = NULL, name = NULL, polygons = NULL )
.Object |
Constructor argument (not needed). |
rotation |
( |
features |
( |
name |
( |
polygons |
( |
A platemodel
class object.
# path to provided archive archive <- file.path( system.file("extdata", package="rgplates"), "paleomap_v3.zip") # extract to temporary directory unzip(archive, exdir=tempdir()) # path to the rotation file rotPath <- file.path(tempdir(), "PALEOMAP_PlateModel.rot") # path to the polygons polPath <- file.path(tempdir(), "PALEOMAP_PlatePolygons.gpml") # register in R - to be used in reconstruct() model <- platemodel(rotation=rotPath, features=c("static_polygons"=polPath))
# path to provided archive archive <- file.path( system.file("extdata", package="rgplates"), "paleomap_v3.zip") # extract to temporary directory unzip(archive, exdir=tempdir()) # path to the rotation file rotPath <- file.path(tempdir(), "PALEOMAP_PlateModel.rot") # path to the polygons polPath <- file.path(tempdir(), "PALEOMAP_PlatePolygons.gpml") # register in R - to be used in reconstruct() model <- platemodel(rotation=rotPath, features=c("static_polygons"=polPath))
Reconstruct the geographic locations from present day coordinates and spatial objects back to their paleo-positions. Each location will be assigned a plate id and moved back in time using the chosen reconstruction model.
reconstruct(x, ...) ## S4 method for signature 'matrix' reconstruct( x, age = 0, model = "MERDITH2021", from = 0, listout = TRUE, verbose = FALSE, enumerate = TRUE, chunk = NULL, reverse = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, partitioning = "static_polygons", check = TRUE, warn = TRUE, anchor = 0, validtime = TRUE ) ## S4 method for signature 'data.frame' reconstruct(x, ...) ## S4 method for signature 'numeric' reconstruct(x, ...) ## S4 method for signature 'character' reconstruct( x, age, model = "MERDITH2021", listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, partitioning = "static_polygons", check = TRUE, anchor = 0 ) ## S4 method for signature 'Spatial' reconstruct( x, age, model, listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, partitioning = "static_polygons", check = TRUE, validtime = TRUE ) ## S4 method for signature 'sf' reconstruct( x, age, model, listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, gmeta = FALSE, partitioning = "static_polygons", check = TRUE, validtime = TRUE ) ## S4 method for signature 'SpatRaster' reconstruct( x, age, model, from = 0, listout = TRUE, verbose = FALSE, plateperiod = NULL, check = TRUE, validtime = TRUE )
reconstruct(x, ...) ## S4 method for signature 'matrix' reconstruct( x, age = 0, model = "MERDITH2021", from = 0, listout = TRUE, verbose = FALSE, enumerate = TRUE, chunk = NULL, reverse = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, partitioning = "static_polygons", check = TRUE, warn = TRUE, anchor = 0, validtime = TRUE ) ## S4 method for signature 'data.frame' reconstruct(x, ...) ## S4 method for signature 'numeric' reconstruct(x, ...) ## S4 method for signature 'character' reconstruct( x, age, model = "MERDITH2021", listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, partitioning = "static_polygons", check = TRUE, anchor = 0 ) ## S4 method for signature 'Spatial' reconstruct( x, age, model, listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, partitioning = "static_polygons", check = TRUE, validtime = TRUE ) ## S4 method for signature 'sf' reconstruct( x, age, model, listout = TRUE, verbose = FALSE, path.gplates = NULL, cleanup = TRUE, dir = NULL, plateperiod = NULL, gmeta = FALSE, partitioning = "static_polygons", check = TRUE, validtime = TRUE ) ## S4 method for signature 'SpatRaster' reconstruct( x, age, model, from = 0, listout = TRUE, verbose = FALSE, plateperiod = NULL, check = TRUE, validtime = TRUE )
x |
The features to be reconstructed. Can be a vector with longitude and latitude representing
a single point or a matrix/dataframe with the first column as longitude and second column as latitude.
For the online subroutine, the character strings |
... |
arguments passed to class-specific methods. |
age |
( |
model |
( |
from |
( |
listout |
( |
verbose |
( |
enumerate |
( |
chunk |
( |
reverse |
( |
path.gplates |
( |
cleanup |
( |
dir |
( |
plateperiod |
( |
partitioning |
( |
check |
( |
warn |
( |
anchor |
( |
validtime |
( |
gmeta |
( |
The function implements two reconstruction submodules, which are selected with the model
argument:
If model
is a character
entry, then the reconstruct()
function uses the GPlates Web Service (https://gwsdoc.gplates.org/, remote reconstruction submodule).
The available reconstruction models for this submodule are (as of 2024-02-02):
"TorsvikCocks2017" (Torsvik and Cocks, 2017) for coastlines (0-540 Ma). Uses a mantle reference frame by default. For climatically sensitive analyses use a paleomagnetic reference frame, which you can toggle by setting the anchor
parameter to 1
from the default 0
.
"SETON2012" (Seton et al., 2012) for coastlines and topological plate polygons (0-200 Ma).
"RODINIA2013" (Li et al., 2012) for coastlines (530-1100 Ma).
"MULLER2016" (Muller et al., 2016) for coastlines and topological plate polygons (0-230 Ma).
"GOLONKA" (Wright et al. 2013) for coastlines only (0-550 Ma).
"PALEOMAP" (Scotese, 2016) for coastlines only (0-1100 Ma).
"MATTHEWS2016_mantle_ref" (Matthews et al., 2016) for coastlines and topological plate polygons (0-410 Ma).
"MATTHEWS2016_pmag_ref" (Matthews et al., 2016) for coastlines and topological plate polygons (0-410 Ma).
"MULLER2019" (Müller et al., 2019) for coastlines and static plate polygons. (0-250 Ma).
"MERDITH2021" (Merdith et al., 2021, default) for coastlines and static plate polygons (0-1000 Ma).
"MULLER2022" (Müller et al., 2022) for coastlines and static plate polygons (0-1000 Ma).
If model
is a platemodel
class object, then the function will try to use the GPLates desktop application (https://www.gplates.org/) to reconstruct the coordinates (local reconstruction submodule).
Plate models are available in chronosphere with the fetch
function. See datasets
for the available models.
The function will try to find the main GPlates executable in its default installation directory. If this does not succeed, use path.gplates
to enter the full path to the GPlates executable as a character
string.
A numeric
matrix if x
is a numeric
, matrix
or data.frame
, or Spatial*
class objects, depending on input. NULL
in case no model is specified.
Matthews, K. J., Maloney, K. T., Zahirovic, S., Williams, S. E., Seton, M., & Müller, R. D. (2016). Global plate boundary evolution and kinematics since the late Paleozoic. Global and Planetary Change, 146, 226–250. https://doi.org/10.1016/j.gloplacha.2016.10.002
Andrew S. Merdith, Simon E. Williams, Alan S. Collins, Michael G. Tetley, Jacob A. Mulder, Morgan L. Blades, Alexander Young, Sheree E. Armistead, John Cannon, Sabin Zahirovic, R. Dietmar Müller, (2021). Extending full-plate tectonic models into deep time: Linking the Neoproterozoic and the Phanerozoic, Earth-Science Reviews, Volume 214, 2021, 103477, ISSN 0012-8252, https://doi.org/10.1016/j.earscirev.2020.103477.
Müller, R. D., Seton, M., Zahirovic, S., Williams, S. E., Matthews, K. J., Wright, N. M., … Cannon, J. (2016). Ocean Basin Evolution and Global-Scale Plate Reorganization Events Since Pangea Breakup. Annual Review of Earth and Planetary Sciences, 44(1), 107–138. https://doi.org/10.1146/annurev-earth-060115-012211
Müller, R. D., Zahirovic, S., Williams, S. E., Cannon, J., Seton, M., Bower, D. J., Tetley, M. G., Heine, C., Le Breton, E., Liu, S., Russell, S. H. J., Yang, T., Leonard, J., and Gurnis, M. (2019), A global plate model including lithospheric deformation along major rifts and orogens since the Triassic. Tectonics, vol. 38, https://doi.org/10.1029/2018TC005462.
Müller, R. D., Flament, N., Cannon, J., Tetley, M. G., Williams, S. E., Cao, X., Bodur, Ö. F., Zahirovic, S., and Merdith, A.: A tectonic-rules-based mantle reference frame since 1 billion years ago – implications for supercontinent cycles and plate–mantle system evolution, Solid Earth, 13, 1127–1159, https://doi.org/10.5194/se-13-1127-2022, 2022.
Scotese, C. R. (2016). PALEOMAP PaleoAtlas for GPlates and the PaleoData Plotter Program. http://www.earthbyte.org/paleomap‐ paleoatlas‐for‐gplates
Seton, M., Müller, R. D., Zahirovic, S., Gaina, C., Torsvik, T., Shephard, G., … Chandler, M. (2012). Global continental and ocean basin reconstructions since 200Ma. Earth-Science Reviews, 113(3–4), 212–270. https://doi.org/10.1016/j.earscirev.2012.03.002
Torsvik and Cocks (2017). Earth History and Palaeogeography. Cambridge University Press, 317 pp.
Wright, N., Zahirovic, S., Müller, R. D., & Seton, M. (2013). Towards community-driven paleogeographic reconstructions: integrating open-access paleogeographic and paleobiology data with plate tectonics. Biogeosciences, 10(3), 1529–1541. https://doi.org/10.5194/bg-10-1529-2013
# With the web service # simple matrices # replace model with desired choice reconstruct(matrix(c(95, 54), nrow=1), 140, model=NULL) # points reconstruction xy <-cbind(long=c(95,142), lat=c(54, -33)) reconstruct(xy, 140, model=NULL)
# With the web service # simple matrices # replace model with desired choice reconstruct(matrix(c(95, 54), nrow=1), 140, model=NULL) # points reconstruction xy <-cbind(long=c(95,142), lat=c(54, -33)) reconstruct(xy, 140, model=NULL)
Query functions to the GPlates <https://www.gplates.org/> Desktop Application and the GPlates Web Service <https://gws.gplates.org/> allow users to reconstruct coordinates, static plates, Simple Features and Spatial objects without leaving the R running environment. This R extension is developed under the umbrella of the DFG (Deutsche Forschungsgemeinschaft) Research Unit TERSANE2 (For 2332, TEmperature Related Stressors in ANcient Extinctions).
This is still the Beta version. As is R, this is free software and comes with ABSOLUTELY NO WARRANTY. Nevertheless, notes about found bugs and suggestions are more than welcome.
Adam T. Kocsis ([email protected]), Nussaibah B. Raja, Simon Williams and Elizabeth M. Dowding
Useful links:
Queries to return meshes of tectonic plate velocities.
velocities(x, ...) ## S4 method for signature 'missing' velocities(x, ...) ## S4 method for signature 'character' velocities( x, age, model, domain = "longLatGrid", type = "MagAzim", output = "data.frame", polecrop = TRUE, verbose = FALSE, check = TRUE )
velocities(x, ...) ## S4 method for signature 'missing' velocities(x, ...) ## S4 method for signature 'character' velocities( x, age, model, domain = "longLatGrid", type = "MagAzim", output = "data.frame", polecrop = TRUE, verbose = FALSE, check = TRUE )
x |
|
... |
Arguments of class-specific methods. |
age |
|
model |
|
domain |
|
type |
|
output |
|
polecrop |
|
verbose |
|
check |
( |
The function returns a mesh of velocities: two variables, either magnitude (mm/year) and azimuth (rad): type="MagAzim"
or easting and northing velocity vectors (mm/year): type="east_north"
.
Currently only the online method is supported using the GPlates Web Service (internet connection is required).
Available models are in the gws
object, and can be provided with arguments similar to reconstruct
.
Velocities of tectonic movements. If output="data.frame"
then the function returns a data.frame
with the longitude, latitude, the two velocity variables and the plate ids they belong to.
If output="SpatRaster"
then the output will be a multilayered SpatRaster
object.
# dummy example, # set model to the desired model string, e.g. model="MERDITH2021" velocities("static_polygons", age=45, model=NULL)
# dummy example, # set model to the desired model string, e.g. model="MERDITH2021" velocities("static_polygons", age=45, model=NULL)