This notebook demonstrate how to use the PlateModelManager to access plate models.
In [1]:
import os
from gplately import PlateModelManager, PresentDayRasterManager
from gplately.commands.list_models import get_model_names
pm_manager = PlateModelManager()
Get all available models(names) in the PlateModelManager
In [2]:
gplately_model_names = get_model_names()
for name in pm_manager.get_available_model_names():
# the pm_manager.get_available_model_names() returns a superset of GPlately models.
# we need to check the the model name agaist a list of GPlately officially supported models.
if name in gplately_model_names:
print(name)
shirmard2025 alfonso2024 cao2024 muller2022 zahirovic2022 merdith2021 clennett2020 clennett2020_m2019 clennett2020_s2013 muller2019 young2018 torsvikcocks2017 matthews2016 matthews2016_pmag_ref muller2016 scotese2016 zahirovic2016 gibbons2015 zahirovic2014 shephard2013 gurnis2012 seton2012 muller2008
Download model "Muller2019" and put the files in folder "plate-model-repo"
In [3]:
model = pm_manager.get_model("Muller2019")
assert model
model.set_data_dir("plate-model-repo")
for layer in model.get_avail_layers():
model.get_layer(layer)
# now let's see what are inside the "plate-model-repo/muller2019" folder
print(os.listdir("plate-model-repo/muller2019"))
['Johansson2018LIPs', 'Rotations', 'Hotspots', 'SeafloorFabric', 'COBs', 'Topologies', 'Coastlines', 'StaticPolygons', 'Whittaker2015LIPs', 'ContinentalPolygons', '.metadata.json', 'Rasters']
List all vailable layers in model Muller2019
In [4]:
for layer in model.get_avail_layers():
print(layer)
Coastlines StaticPolygons ContinentalPolygons Topologies COBs Hotspots SeafloorFabric Whittaker2015LIPs Johansson2018LIPs
Download rotation files
In [5]:
rotation_files = model.get_rotation_model()
print(rotation_files)
['plate-model-repo/muller2019//Rotations/Muller_etal_2019_CombinedRotations.rot']
Download static polygons
In [6]:
static_polygon_files = model.get_layer("StaticPolygons")
print(static_polygon_files)
['plate-model-repo/muller2019//StaticPolygons/Muller_etal_2019_Global_StaticPlatePolygons.gpmlz']
Download Coastlines
In [7]:
coasts_files = model.get_layer("Coastlines")
print(coasts_files)
['plate-model-repo/muller2019//Coastlines/Muller_etal_2019_Global_Coastlines.gpmlz']
Download all layers
In [8]:
for layer in model.get_avail_layers():
print(model.get_layer(layer))
['plate-model-repo/muller2019//Coastlines/Muller_etal_2019_Global_Coastlines.gpmlz'] ['plate-model-repo/muller2019//StaticPolygons/Muller_etal_2019_Global_StaticPlatePolygons.gpmlz'] ['plate-model-repo/muller2019//ContinentalPolygons/Global_PresentDay_ContPolygons_2019_v1.shp'] ['plate-model-repo/muller2019//Topologies/Muller_etal_2019_PlateBoundaries_DeformingNetworks.gpmlz'] ['plate-model-repo/muller2019//COBs/Global_COBLineSegments_2019_v1.gpmlz'] ['plate-model-repo/muller2019//Hotspots/Hotspots_Compilation_Whittaker_etal.gpmlz'] ['plate-model-repo/muller2019//SeafloorFabric/FZ_cookiecut.gpmlz', 'plate-model-repo/muller2019//SeafloorFabric/VANOM_cookiecut.gpmlz', 'plate-model-repo/muller2019//SeafloorFabric/DZ_cookiecut.gpmlz', 'plate-model-repo/muller2019//SeafloorFabric/FZLC_cookiecut.gpmlz', 'plate-model-repo/muller2019//SeafloorFabric/UNCV_cookiecut.gpmlz', 'plate-model-repo/muller2019//SeafloorFabric/ExtinctRidges_cookiecut.gpmlz'] ['plate-model-repo/muller2019//Whittaker2015LIPs/Whittaker_etal_2015_LIPs.gpmlz'] ['plate-model-repo/muller2019//Johansson2018LIPs/Johansson_etal_2018_VolcanicProvinces_v2.gpmlz']
Get a list of time dependent rasters
In [9]:
for raster in model.get_avail_time_dependent_raster_names():
print(raster)
AgeGrids SedimentThickness
Download AgeGrids rasters
In [10]:
import warnings
warnings.filterwarnings("ignore")
print(model.get_rasters("AgeGrids", times=[10, 20, 30]))
print(model.get_raster("AgeGrids", time=100))
['plate-model-repo/muller2019//Rasters/AgeGrids/Muller_etal_2019_Tectonics_v2.0_AgeGrid-10.nc', 'plate-model-repo/muller2019//Rasters/AgeGrids/Muller_etal_2019_Tectonics_v2.0_AgeGrid-20.nc', 'plate-model-repo/muller2019//Rasters/AgeGrids/Muller_etal_2019_Tectonics_v2.0_AgeGrid-30.nc'] plate-model-repo/muller2019//Rasters/AgeGrids/Muller_etal_2019_Tectonics_v2.0_AgeGrid-100.nc
Download AgeGrids rasters for all available times
This function will take a while to finish and download a large volume data. Uncomment the code in the code cell below to try it.
In [11]:
# model.download_time_dependent_rasters("AgeGrids")
List the names of all present-day rasters
In [12]:
print(PresentDayRasterManager().list_present_day_rasters())
['etopo1_grd', 'etopo1_tif', 'topography', 'agegrid', 'vgg']
Get "topography" present-day raster
In [13]:
print(PresentDayRasterManager().get_raster("topography"))
present-day-rasters/topography/topo15-3601x1801.nc