Examples

Use with pyGPlates

 1import pygplates
 2
 3from plate_model_manager import PlateModelManager
 4
 5pm_manager = PlateModelManager()
 6model = pm_manager.get_model("Muller2019")
 7
 8# create a point feature at (0,0)
 9point_feature = pygplates.Feature()
10point_feature.set_geometry(pygplates.PointOnSphere(0, 0))
11
12# assign plate ID
13point_feature_with_PID = pygplates.partition_into_plates(
14    model.get_static_polygons(),  # 👈👀 LOOK HERE
15    model.get_rotation_model(),  # 👈👀 LOOK HERE
16    [point_feature],
17)
18
19# Reconstruct the point features.
20reconstructed_feature_geometries = []
21time = 140
22pygplates.reconstruct(
23    point_feature_with_PID,
24    model.get_rotation_model(),  # 👈👀 LOOK HERE
25    reconstructed_feature_geometries,
26    time,
27)
28print(reconstructed_feature_geometries[0].get_reconstructed_geometry().to_lat_lon())

See also

Example notebook of using PMM with pyGPlates:

Use with GPlately

 1from gplately import (
 2    PlateModelManager,
 3    PlateReconstruction,
 4    PlotTopologies,
 5    PresentDayRasterManager,
 6    Raster,
 7)
 8
 9model = PlateModelManager().get_model(
10    "Muller2019",  # model name
11    data_dir="plate-model-repo",  # the folder to save the model files
12)
13
14recon_model = PlateReconstruction(
15    model.get_rotation_model(),
16    topology_features=model.get_layer("Topologies"),
17    static_polygons=model.get_layer("StaticPolygons"),
18)
19gplot = PlotTopologies(
20    recon_model,
21    coastlines=model.get_layer("Coastlines"),
22    COBs=model.get_layer("COBs"),
23    time=55,
24)
25# get present-day topography raster
26raster = Raster(PresentDayRasterManager().get_raster("topography"))
27# get paleo-agegrid raster at 100Ma from Muller2019 model
28agegrid = Raster(model.get_raster("AgeGrids", time=100))

See also

Examples of using PMM with GPlately:

Use without Internet

Assume you had downloaded zahirovic2022 model in the folder plate-model-repo previously when you had Internet connection.

 1from plate_model_manager import PlateModel
 2
 3try:
 4    model = PlateModelManager().get_model("zahirovic2022", data_dir="plate-model-repo")
 5except:
 6    # if unable to connect to the servers, try to use the local files
 7    model = PlateModel(
 8        model_name="zahirovic2022", data_dir="plate-model-repo", readonly=True
 9    )
10    print("Unable to connect to the servers. Using local files in readonly mode.")
11
12for layer in model.get_avail_layers():
13    print(model.get_layer(layer))