From ben.mather at sydney.edu.au Wed May 1 14:40:16 2019 From: ben.mather at sydney.edu.au (Ben Mather) Date: Wed, 1 May 2019 04:40:16 +0000 Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates Message-ID: Hi team! This is quite a basic question... Say that I have some point data from 10 Ma that I want to move to 9Ma. Is there a simple way to do this? Currently I create a point feature, assign plate IDs from reconstructed polygons at 10 Ma, use pygplates.reverse_reconstruct to move the points to the present day location, then use pygplates.reconstruct to move them back to 9Ma. I was expecting that pygplates.reverse_reconstruct would have an optional 'to' argument to accept times other than the present day, or perhaps the Feature class would have a 'set_reconstruction_time' method that would be compatible with the reconstruct function. Is there a suggested workflow for this that I haven't discovered? Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/pRv-CyoNVrcZ8jEVUMCPGa?domain=twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.cannon at sydney.edu.au Wed May 1 23:40:04 2019 From: john.cannon at sydney.edu.au (John Cannon) Date: Wed, 1 May 2019 13:40:04 +0000 Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates In-Reply-To: References: Message-ID: Hi Ben, Your approach is currently the way to do this. That is, first convert the geometry to its present-day position and then reconstruct from there. This is more complicated than expected because all features in GPlates must contain *present* day geometries (this is essentially a requirement of GPlates/pyGPlates). If we consider GPlates first, then when you create a feature at a past time (such as using a digitization tool) GPlates automatically reverse reconstructs to present day before actually creating the feature. However, in pyGPlates it's possible to directly create a feature with a *non*-present day geometry, and this is what the pygplates.reverse_reconstruct() function is for - to fix this up by making it present-day. Then, once a feature has a present-day geometry, pygplates.reconstruct() can reconstruct it to any past geological time. Here's a slightly easier (but still complicated) way that avoids pygplates.reverse_reconstruct() and instead uses pygplates.Feature.set_geometry() to do the reverse reconstruction... from_time = 10 to_time = 9 point_at_from_time = ... rotation_model = pygplates.RotationModel('rotations.rot') # Find plate ID of the point at the 'from' time. plate_partitioner_at_from_time = pygplates.PlatePartitioner('static_polygons.gpml', rotation_model, from_time) polygon_containing_point = plate_partitioner_at_from_time.partition_point(point_at_from_time) point_plate_id = 0 if polygon_containing_point: point_plate_id = polygon_containing_point.get_feature().get_reconstruction_plate_id() # Create the point feature with a present-day geometry that is reverse reconstructed from the 'from' time to present day. point_feature = pygplates.Feature() point_feature.set_reconstruction_plate_id(point_plate_id) point_feature.set_geometry( point_at_from_time, reverse_reconstruct=(rotation_model, from_time)) # Reconstruct from present day to the 'to' time. reconstructed_points = [] pygplates.reconstruct(point_feature, rotation_model, reconstructed_points, to_time) point_at_to_time = reconstructed_points[0].get_reconstructed_geometry() I'll look into adding a new reconstruct function with a 'from' and 'to' time that can reconstruct in either direction (backward or forward in time) but does not require creating a pygplates.Feature ... # Reconstruct from the 'from' time to the 'to' time. points_at_to_time = [] pygplates.reconstruct_geometries(point_at_from_time, rotation_model, points_at_to_time, point_plate_id, to_time, from_time) point_at_to_time = points_at_to_time[0] Regards, John From: GPlates-discuss On Behalf Of Ben Mather Sent: Wednesday, 1 May 2019 2:40 PM To: gplates-discuss at mailman.sydney.edu.au Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates Hi team! This is quite a basic question... Say that I have some point data from 10 Ma that I want to move to 9Ma. Is there a simple way to do this? Currently I create a point feature, assign plate IDs from reconstructed polygons at 10 Ma, use pygplates.reverse_reconstruct to move the points to the present day location, then use pygplates.reconstruct to move them back to 9Ma. I was expecting that pygplates.reverse_reconstruct would have an optional 'to' argument to accept times other than the present day, or perhaps the Feature class would have a 'set_reconstruction_time' method that would be compatible with the reconstruct function. Is there a suggested workflow for this that I haven't discovered? Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/TH2yCP7yOZtWLGAvsrEIYY?domain=twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.mather at sydney.edu.au Thu May 2 14:40:51 2019 From: ben.mather at sydney.edu.au (Ben Mather) Date: Thu, 2 May 2019 04:40:51 +0000 Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates In-Reply-To: References: , Message-ID: Hi John, Thanks for your detailed response, and for your explanation of the inner workings of GPlates. I had thought that one of these reconstruction calculations could be avoided in pyGPlates, since all of the required information to move a point from one time to another is stored in the rotation files, but now it makes more sense in the context of how GPlates operates. Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/DE_0CgZowLHQAmWosopvni?domain=twitter.com On 2019-05-01 23:40:23+10:00 GPlates-discuss wrote: Hi Ben, Your approach is currently the way to do this. That is, first convert the geometry to its present-day position and then reconstruct from there. This is more complicated than expected because all features in GPlates must contain *present* day geometries (this is essentially a requirement of GPlates/pyGPlates). If we consider GPlates first, then when you create a feature at a past time (such as using a digitization tool) GPlates automatically reverse reconstructs to present day before actually creating the feature. However, in pyGPlates it?s possible to directly create a feature with a *non*-present day geometry, and this is what the pygplates.reverse_reconstruct() function is for ? to fix this up by making it present-day. Then, once a feature has a present-day geometry, pygplates.reconstruct() can reconstruct it to any past geological time. Here?s a slightly easier (but still complicated) way that avoids pygplates.reverse_reconstruct() and instead uses pygplates.Feature.set_geometry() to do the reverse reconstruction? from_time = 10 to_time = 9 point_at_from_time = ... rotation_model = pygplates.RotationModel('rotations.rot') # Find plate ID of the point at the 'from' time. plate_partitioner_at_from_time = pygplates.PlatePartitioner('static_polygons.gpml', rotation_model, from_time) polygon_containing_point = plate_partitioner_at_from_time.partition_point(point_at_from_time) point_plate_id = 0 if polygon_containing_point: point_plate_id = polygon_containing_point.get_feature().get_reconstruction_plate_id() # Create the point feature with a present-day geometry that is reverse reconstructed from the 'from' time to present day. point_feature = pygplates.Feature() point_feature.set_reconstruction_plate_id(point_plate_id) point_feature.set_geometry( point_at_from_time, reverse_reconstruct=(rotation_model, from_time)) # Reconstruct from present day to the ?to? time. reconstructed_points = [] pygplates.reconstruct(point_feature, rotation_model, reconstructed_points, to_time) point_at_to_time = reconstructed_points[0].get_reconstructed_geometry() I?ll look into adding a new reconstruct function with a ?from? and ?to? time that can reconstruct in either direction (backward or forward in time) but does not require creating a pygplates.Feature ? # Reconstruct from the ?from? time to the ?to? time. points_at_to_time = [] pygplates.reconstruct_geometries(point_at_from_time, rotation_model, points_at_to_time, point_plate_id, to_time, from_time) point_at_to_time = points_at_to_time[0] Regards, John From: GPlates-discuss On Behalf Of Ben Mather Sent: Wednesday, 1 May 2019 2:40 PM To: gplates-discuss at mailman.sydney.edu.au Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates Hi team! This is quite a basic question... Say that I have some point data from 10 Ma that I want to move to 9Ma. Is there a simple way to do this? Currently I create a point feature, assign plate IDs from reconstructed polygons at 10 Ma, use pygplates.reverse_reconstruct to move the points to the present day location, then use pygplates.reconstruct to move them back to 9Ma. I was expecting that pygplates.reverse_reconstruct would have an optional 'to' argument to accept times other than the present day, or perhaps the Feature class would have a 'set_reconstruction_time' method that would be compatible with the reconstruct function. Is there a suggested workflow for this that I haven't discovered? Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/DE_0CgZowLHQAmWosopvni?domain=twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.chin at sydney.edu.au Thu May 2 16:52:54 2019 From: michael.chin at sydney.edu.au (Michael Chin) Date: Thu, 2 May 2019 06:52:54 +0000 Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates In-Reply-To: References: , , Message-ID: Hi Ben, If you want to avoid reconstructing the points back to present-day, you can try get_rotation() method to get the FiniteRotation from 10Ma to 9Ma and then use the "*" operator to calculate the new coordinates https://protect-au.mimecast.com/s/FBI6C6X13RtwrL3NcpWbBw?domain=gplates.org ________________________________ From: GPlates-discuss on behalf of Ben Mather Sent: Thursday, 2 May 2019 2:40 PM To: John Cannon; gplates-discuss at mailman.sydney.edu.au Subject: Re: [GPlates-discuss] Reverse reconstruction in pyGPlates Hi John, Thanks for your detailed response, and for your explanation of the inner workings of GPlates. I had thought that one of these reconstruction calculations could be avoided in pyGPlates, since all of the required information to move a point from one time to another is stored in the rotation files, but now it makes more sense in the context of how GPlates operates. Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/JwUMC81Zj6t46NJGt25eHO?domain=twitter.com On 2019-05-01 23:40:23+10:00 GPlates-discuss wrote: Hi Ben, Your approach is currently the way to do this. That is, first convert the geometry to its present-day position and then reconstruct from there. This is more complicated than expected because all features in GPlates must contain *present* day geometries (this is essentially a requirement of GPlates/pyGPlates). If we consider GPlates first, then when you create a feature at a past time (such as using a digitization tool) GPlates automatically reverse reconstructs to present day before actually creating the feature. However, in pyGPlates it?s possible to directly create a feature with a *non*-present day geometry, and this is what the pygplates.reverse_reconstruct() function is for ? to fix this up by making it present-day. Then, once a feature has a present-day geometry, pygplates.reconstruct() can reconstruct it to any past geological time. Here?s a slightly easier (but still complicated) way that avoids pygplates.reverse_reconstruct() and instead uses pygplates.Feature.set_geometry() to do the reverse reconstruction? from_time = 10 to_time = 9 point_at_from_time = ... rotation_model = pygplates.RotationModel('rotations.rot') # Find plate ID of the point at the 'from' time. plate_partitioner_at_from_time = pygplates.PlatePartitioner('static_polygons.gpml', rotation_model, from_time) polygon_containing_point = plate_partitioner_at_from_time.partition_point(point_at_from_time) point_plate_id = 0 if polygon_containing_point: point_plate_id = polygon_containing_point.get_feature().get_reconstruction_plate_id() # Create the point feature with a present-day geometry that is reverse reconstructed from the 'from' time to present day. point_feature = pygplates.Feature() point_feature.set_reconstruction_plate_id(point_plate_id) point_feature.set_geometry( point_at_from_time, reverse_reconstruct=(rotation_model, from_time)) # Reconstruct from present day to the ?to? time. reconstructed_points = [] pygplates.reconstruct(point_feature, rotation_model, reconstructed_points, to_time) point_at_to_time = reconstructed_points[0].get_reconstructed_geometry() I?ll look into adding a new reconstruct function with a ?from? and ?to? time that can reconstruct in either direction (backward or forward in time) but does not require creating a pygplates.Feature ? # Reconstruct from the ?from? time to the ?to? time. points_at_to_time = [] pygplates.reconstruct_geometries(point_at_from_time, rotation_model, points_at_to_time, point_plate_id, to_time, from_time) point_at_to_time = points_at_to_time[0] Regards, John From: GPlates-discuss On Behalf Of Ben Mather Sent: Wednesday, 1 May 2019 2:40 PM To: gplates-discuss at mailman.sydney.edu.au Subject: [GPlates-discuss] Reverse reconstruction in pyGPlates Hi team! This is quite a basic question... Say that I have some point data from 10 Ma that I want to move to 9Ma. Is there a simple way to do this? Currently I create a point feature, assign plate IDs from reconstructed polygons at 10 Ma, use pygplates.reverse_reconstruct to move the points to the present day location, then use pygplates.reconstruct to move them back to 9Ma. I was expecting that pygplates.reverse_reconstruct would have an optional 'to' argument to accept times other than the present day, or perhaps the Feature class would have a 'set_reconstruction_time' method that would be compatible with the reconstruct function. Is there a suggested workflow for this that I haven't discovered? Many thanks, Ben -- Dr. Ben Mather | Computational Geophysicist Room 418, Madsen Building F09 School of Geoscience, Faculty of Science The University of Sydney, NSW 2006 m +61 422 470 117 w benmather.info t https://protect-au.mimecast.com/s/JwUMC81Zj6t46NJGt25eHO?domain=twitter.com -------------- next part -------------- An HTML attachment was scrubbed... URL: