Ben Mather PRO
Computational Geophysicist at the Sydney Informatics Hub, University of Sydney
docker pull brmather/pygplates-course
docker run --name pygplates -p 8888:8888 brmather/pygplates-course
# Names of input files
input_feature_filename = './Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz'
input_rotation_filename = './Data/Seton_etal_ESR2012_2012.1.rot'
# Input parameters to define how the reconstruction is made
reconstruction_time = 120.6
anchor_plate = 0
# Name of ouput file
output_reconstructed_feature_filename = './tmp/tmp.shp'
# Use pygplates to carry out the reconstruction
pygplates.reconstruct(input_feature_filename,
input_rotation_filename,
output_reconstructed_feature_filename,
reconstruction_time,
anchor_plate)
Code snippet for making a reconstruction
# Plot curves for three seed points on Africa
rotation_filename = 'Data/Seton_etal_ESR2012_2012.1.rot'
MovingPlate = 701
RelativePlate = 0
times = np.arange(0,130,10)
# get motion paths for three different points in Africa, at the same latitude but
# different longitudes
trail_1 = get_motion_path(rotation_filename,
(-20,0),
MovingPlate,
RelativePlate,
times)
Retrieving a motion path
import pygplates
fossil_point_features = []
for index,row in df.iterrows():
point = pygplates.PointOnSphere(float(row.lat),float(row.lng))
point_feature = pygplates.Feature()
point_feature.set_geometry(point)
fossil_point_features.append(point_feature)
# Save a feature collection to file
# can be *.gpml, *.gmt or *.shp
output_feature_collection = pygplates.FeatureCollection(fossil_point_features)
output_feature_collection.write('my_fossils.gpml')
Exporting feature collections
By Ben Mather
13th February 2019
Computational Geophysicist at the Sydney Informatics Hub, University of Sydney