Improve seed point reconstruction in seafloor gridding#413
Draft
jcannon-gplates wants to merge 17 commits into
Draft
Improve seed point reconstruction in seafloor gridding#413jcannon-gplates wants to merge 17 commits into
jcannon-gplates wants to merge 17 commits into
Conversation
This naturally deactivates seed points at convergent plate boundaries without having to compare velocity deltas and distances to boundaries with empirical thresholds.
Topological lines can be sections of topological boundaries/networks. New collision detection was recently added in 521b6fe.
Resolving the same current topological boundary/network to the next time might generate different number of intersections between boundary sections. We now detect this so we can generate a topology boundary polygon using a different approach when this happens.
Instead of returning the boundary of the next resolved topology, return the boundary sub-segments of the current resolved topology moved to the next time and joined together.
The consistent sub-segments (resolved at 'next' time) can be kept.
And we can now sample all points together, rather than one by one.
And remove implementation based on TopologicalModel since it's no longer needed (since we now use a different collision detection algorithm and also the new implementation can reconstruct points that are in deforming networks, which the original implementation could not).
And no longer return all the points (active and inactive). Now returns only the active points and their indices into the original points.
More chance of reusing cached resolved topologies.
Due to improved collision detection added in 0582168.
So that subsequent diffs don't show the whole file as changed.
Also merge separate seafloor age and spreading rate plots into a single function.
Contributor
Author
|
Because this PR relies on functionality that will be in the next pyGPlates release ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve seed point reconstruction in seafloor gridding
This new algorithm naturally deactivates seed points at convergent plate boundaries
without having to compare velocity deltas and distances to boundaries
with empirical thresholds (like the subduction collision parameters).
This comment was written with Claude's help. However, the code is all-human (that'll soon change though).
Summary
Rewrite collision detection for seafloor seed points — the previous approach
deactivated a seed point when it transitioned between plates and the velocity delta
exceeded a threshold (and the point was close enough to the boundary). The new approach
takes the resolved plate containing a seed point at the current time, resolves that same
plate at the next time step, and deactivates the point if its reconstructed position falls
outside the next-time boundary. Any converging boundary will naturally consume seed points
without requiring velocity thresholds, distance thresholds, or subduction-zone labels.
This removes the
_DefaultCollision,_ContinentCollision,_ReconstructByTopologiesImpl,and
_ReconstructByTopologicalModelImplclasses entirely.Prefer resolved deforming networks over rigid plates when both cover a point — the
topology lookup is now split into two passes (networks then boundaries) using a shared
spatial tree, with the network result taking precedence. This correctly handles deforming
networks that overlay rigid plates.
Accept
PlateReconstructioninstead of raw rotation model + topology features —ReconstructByTopologies.__init__andreconstruct_points_by_topologies()now take asingle
plate_reconstructionargument. Topological snapshots are obtained fromPlateReconstruction.topological_snapshot(), which caches resolved topologies and avoidsredundant resolving across concurrent workers.
Deprecate
subduction_collision_parametersinSeafloorGrid— the parameter is nolonger used (collision detection no longer depends on velocity thresholds). Passing it now
emits a
DeprecationWarning; the parameter is removed from__init__and the classdocstring is updated to remove references to the old velocity-delta mechanism.
What happens when a topology at the current time cannot be resolved at the next time
This results in inconsistent next-time topology boundaries, which are handled by cloning and extending their sub-segment valid times.
To deactivate seed points at converging boundaries, the code resolves the same plate topology at the next time step and checks whether each seed point's reconstructed position still falls inside it. This requires that all boundary sub-segment features are valid at the next time, but a topology's valid time period often does not include the next time (e.g., at the last time step before a topology disappears).
_NextTopologicalFeatureshandles this by cloning any boundary section feature (and any topological-line sub-section feature) whose valid time does not include the next time, extending the clone's valid time to cover it (distant past → 0 Ma), and using the clone when resolving at the next time. If the resulting next topology is still inconsistent with the current one — detected by comparing boundary sub-segment counts and checking for unexpected multiple intersections between neighbouring sections, which can distort the resolved boundary shape —_NextTopologicalBoundaryfalls back to reconstructing the inconsistent sub-segments directly: each current sub-segment geometry is reverse-reconstructed to present day, its valid time is extended to cover the next time if needed, and it is then reconstructed forward to the next time, with the resulting geometries stitched into a replacement boundary polygon.