Skip to content

Deform continental polygons in seafloor gridding#414

Draft
jcannon-gplates wants to merge 22 commits into
masterfrom
continents-masked-with-deforming-networks
Draft

Deform continental polygons in seafloor gridding#414
jcannon-gplates wants to merge 22 commits into
masterfrom
continents-masked-with-deforming-networks

Conversation

@jcannon-gplates

Copy link
Copy Markdown
Contributor

Implement continental polygon deformation using deforming networks

This PR is built on top of #413. So that PR should be merged first (and that PR depends on a pyGPlates 1.1 release).

It is also still experimental. It works okay for some regions (like Andes) but not others (like Canadian Arctic Islands). So it needs some more work. The preference is to include this in the GPlately 2.1 release, but it could get pushed to a subsequent release.

It essentially deforms the continental masks that are used to mask ocean seed points in the seafloor gridding workflow.

This comment was written with Claude's help. However, the code is all-human (that'll soon change though).

Summary

  • Implement deformation of continental polygons when masking ocean seed points
    ReconstructContinents.reconstruct_continent_features was previously a no-op with a TODO.
    It now detects whether the plate model contains deforming network features and, if so,
    reconstructs and deforms the continent polygon boundaries forward from present day through
    the full [min_time, max_time] time range before the gridding run starts. Rigid-only
    models fall back to the existing per-request PlateReconstruction.reconstruct path,
    unchanged.

  • Parallelise deformation across continent feature batches — continent features are split
    into batches and processed in parallel, with results merged afterward.

  • Produce a debug GPML containing reconstructed and deforming continent polygons
    the deformed_continents.gpmlz debug file can be inspected in GPlates.

Algorithm

  • Point-by-point deformation using attached resolved networks — at each time step,
    continental polygon boundary points are reconstructed individually: each point that falls
    inside a resolved deforming network attached to its continent is reconstructed using that
    network; points outside any attached network are moved with the continent's rigid stage
    rotation.

  • Group continental polygons into rigid aggregates to identify attached networks
    rather than testing every boundary point of a continental polygon against all resolved networks
    at every time step, continental polygons are first grouped into aggregates: polygons with
    the same stage rotation (within 0.01°) that are touching or overlapping are merged into one
    aggregate. Each aggregate then identifies its attached networks by checking whether any
    network boundary points fall inside the aggregate and have a velocity that matches the
    aggregate's rigid velocity (within 1 km/Myr). Only those attached networks are used when
    reconstructing that aggregate's polygon points, avoiding spurious network attachment.

jcannon-gplates and others added 22 commits June 25, 2026 16:44
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.
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.
Also write to save directory (not current working directory).
@jcannon-gplates jcannon-gplates added this to the release 2.1 milestone Jun 25, 2026
@jcannon-gplates jcannon-gplates self-assigned this Jun 25, 2026
@jcannon-gplates

Copy link
Copy Markdown
Contributor Author

This PR still needs more experimentation (so it may or may not make it into GPlately 2.1). It also depends on #413 which in turn depends on a pyGPlates 1.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant