pygplates专栏——Reonstruct features——Reconstruct flowline features
- Reconstruct flowline features
-
- 导出flowlines重建到文件中
-
- 查询重建的flowline
-
Reconstruct flowline features
导出flowlines重建到文件中
示例代码
import pygplates
rotation_model = pygplates.RotationModel("Muller2019-Young2019-Cao2020_CombinedRotations.rot")
flowline_features = pygplates.FeatureCollection("4-output_flowline.gpml")
reconstruction_time = 50
export_filename = "6-Exported_reconstructed_flowlines_output_{0}Ma.shp".format(reconstruction_time)
pygplates.reconstruct(flowline_features, rotation_model, export_filename, reconstruction_time,
reconstruct_type=pygplates.ReconstructType.flowline)
查询重建的flowline
示例代码
import pygplates
seed_points = pygplates.MultiPointOnSphere(
[
(-35.547600, -17.873000),
(-46.208000, -13.623000)
])
times = range(0, 91, 5)
flowline_feature = pygplates.Feature.create_flowline(
seed_points,
times,
valid_time=(max(times), min(times)),
left_plate=201,
right_plate=701)
rotation_model = pygplates.RotationModel("Muller2019-Young2019-Cao2020_CombinedRotations.rot")
reconstruction_time = 50
reconstructed_flowlines = []
pygplates.reconstruct(flowline_feature, rotation_model, reconstructed_flowlines, reconstruction_time,
reconstruct_type=pygplates.ReconstructType.flowline)
for reconstructed_flowline in reconstructed_flowlines:
print("flowline: left %d, right %d at %fMa" % (
reconstructed_flowline.get_feature().get_left_plate(),
reconstructed_flowline.get_feature().get_right_plate(),
reconstruction_time
))
print(" reconstructed seed point: lat: %f, lon: %f" % reconstructed_flowline.get_reconstructed_seed_point().to_lat_lon())
flowline_times = reconstructed_flowline.get_feature().get_times()
print(" left flowline:")
for point_index, left_point in enumerate(reversed(reconstructed_flowline.get_left_flowline())):
lat, lon = left_point.to_lat_lon()
time = flowline_times[-1-point_index]
print(" time: %f, lat: %f, lon: %f" % (time, lat, lon))
print(" right flowline:")
for point_index, right_point in enumerate(reversed(reconstructed_flowline.get_right_flowline())):
lat, lon = right_point.to_lat_lon()
time = flowline_times[-1-point_index]
print(" time: %f, lat: %f, lon: %f" % (time, lat, lon))