1 - Getting Started¶
Welcome to GPlately!
GPlately uses object-oriented programming to make life simple. In this notebook we will explore some of the main objects you will use:
PlateReconstruction
- reconstruct features, tessellate mid ocean ridges, subduction zonesPoints
- partition points onto plates, rotate back through timeRaster
- read in NetCDF grids, interpolation, resampling.PlotTopologies
- plotting topologies e.g. ridges, trenches, subduction teeth on mapsPlateModelManager
- downloading plate models, features, and rasters e.g. .rot, .gpml, .shp and .nc files
import cartopy.crs as ccrs
import gplately
import matplotlib.pyplot as plt
import numpy as np
from plate_model_manager import PlateModelManager
Tectonic plate reconstructions¶
We simply supply a rotation model, plate topologies, and static polygons to initialise a plate reconstruction model. You can download these files into your machine's cache using GPlately's PlateModelManager
object.
# Call GPlately's PlateModelManager object and request data from the Müller et al. 2019 study
pm_manager = PlateModelManager()
muller2019_model = pm_manager.get_model("Muller2019", data_dir="plate-model-repo")
rotation_model = muller2019_model.get_rotation_model()
topology_features = muller2019_model.get_topologies()
static_polygons = muller2019_model.get_static_polygons()
# Tessellate the subduction zones to 0.5 degrees.
tessellation_threshold_radians = np.radians(0.05)
model = gplately.PlateReconstruction(rotation_model, topology_features, static_polygons)
downloading https://repo.gplates.org/webdav/pmm/muller2019/Rotations.zip downloading https://repo.gplates.org/webdav/pmm/muller2019/Topologies.zip downloading https://repo.gplates.org/webdav/pmm/muller2019/StaticPolygons.zip
Now let's find the subduction zones and mid-ocean ridges at 10 Ma.
time = 10
# these bundle a lot of information - check PTT docs for more info
subduction_data = model.tessellate_subduction_zones(time, ignore_warnings=True)
ridge_data = model.tessellate_mid_ocean_ridges(time, ignore_warnings=True)
Mapping¶
The PlotTopologies
function injests the plate model we have defined as well as the coastlines, continents, and COB. It computes all of the plate topologies for a given reconstruction time.
This object has been designed to work specifically with cartopy
. Define your figure and supply your axes to these plotting routines. Some common favourites include:
- coastlines
- continents
- ridges and transforms
- trenches
- subduction teeth (!!)
- netCDF grids
- plate motion vectors
You can still supply optional keywords as you normally would.
# Obtain features for the PlotTopologies object with PlateModelManager
coastlines = muller2019_model.get_layer('Coastlines')
continents = muller2019_model.get_layer('ContinentalPolygons')
COBs = muller2019_model.get_layer('COBs')
# Call the PlotTopologies object
gplot = gplately.plot.PlotTopologies(model, coastlines=coastlines, continents=continents, COBs=COBs)
# Download all Muller et al. 2019 netCDF age grids with PlateModelManager. This is returned as a Raster object.
agegrid = gplately.Raster(data=muller2019_model.get_raster("AgeGrids",time))
downloading https://repo.gplates.org/webdav/pmm/muller2019/Coastlines.zip downloading https://repo.gplates.org/webdav/pmm/muller2019/ContinentalPolygons.zip downloading https://repo.gplates.org/webdav/pmm/muller2019/COBs.zip downloading https://www.earthbyte.org/webdav/ftp/Data_Collections/Muller_etal_2019_Tectonics/Muller_etal_2019_Agegrids/Muller_etal_2019_Tectonics_v2.0_netCDF/Muller_etal_2019_Tectonics_v2.0_AgeGrid-10.nc
Set the time
attribute to reconstruct all topologies to the specified time.
IMPORTANT: You must set
gplot.time
or provide atime
at initialisation before plotting anything.
gplot.time = 10 # Ma
Create a map with some useful geological information
fig = plt.figure(figsize=(16,12))
ax1 = fig.add_subplot(111, projection=ccrs.Mollweide(190))
gplot.plot_continents(ax1, facecolor='0.8')
gplot.plot_coastlines(ax1, color='0.5')
gplot.plot_ridges_and_transforms(ax1, color='red')
gplot.plot_trenches(ax1, color='k')
gplot.plot_subduction_teeth(ax1, color='k')
im = gplot.plot_grid(ax1, agegrid.data, cmap='YlGnBu', vmin=0, vmax=200)
gplot.plot_plate_motion_vectors(ax1, spacingX=10, spacingY=10, normalise=True, zorder=10, alpha=0.5)
fig.colorbar(im, orientation='horizontal', shrink=0.4, pad=0.05, label='Age (Ma)')
<matplotlib.colorbar.Colorbar at 0x13d99e150>