Skip to content

feat(map2loop): opt-in local-radius RBF for InterpolatedStructure dip interpolation - #329

Open
lachlangrose wants to merge 2 commits into
masterfrom
feature/local-rbf-dip-interpolation
Open

lachlangrose wants to merge 2 commits into
masterfrom
feature/local-rbf-dip-interpolation

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

Ported from Loop3D/map2loop#250 (closing that PR / archiving the standalone repo now that map2loop lives at packages/map2loop).

InterpolatedStructure interpolates dip with scipy.interpolate.Rbf, which fits one smooth surface to every structure measurement across the whole map at once. Near a fold hinge, fault, or unconformity, true dip can change quickly over a short distance, and a single global surface blurs that change into neighbouring, structurally unrelated units — feeding a wrong dip value into the thickness = L * sin(dip) formula.

This adds an opt-in local-radius mode:

  • DipDipDirectionInterpolator gains a neighbors: Optional[int] constructor argument. When interpolate() is called with scipy.interpolate.RBFInterpolator (new — previously only Rbf/LinearNDInterpolator were supported), each grid point's fit uses only its neighbors nearest structure measurements via RBFInterpolator's built-in neighbors parameter, rather than every point on the map.
  • InterpolatedStructure gains local_interpolation_neighbors: Optional[int] = None. When set, it builds the dip interpolator in local mode; when left as None (the default), behaviour is byte-for-byte the same whole-map Rbf fit as before.

This is purely additive — nothing changes for existing callers unless they explicitly opt in.

Test plan

  • pytest packages/map2loop/tests/thickness packages/map2loop/tests/project/test_thickness_calculations.py — passes unchanged with the new parameter left at its default
  • Manual run of InterpolatedStructure on the Hamersley test fixtures with local_interpolation_neighbors unset, 5, and 20 — all three run cleanly with no NaNs, and thickness estimates shift sensibly as the neighbourhood shrinks

…ructure

DipDipDirectionInterpolator's existing scipy.interpolate.Rbf path fits one
smooth surface to every structure measurement across the whole map, so
dip changes fast across a fold hinge or fault get blurred into
neighbouring, structurally unrelated units and can feed a wrong dip into
the L*sin(dip) thickness formula.

Add an opt-in local mode built on scipy.interpolate.RBFInterpolator's
`neighbors` parameter: each grid point is now fit from only its nearest
`neighbors` structure measurements instead of every measurement on the
map. Wired through as InterpolatedStructure(local_interpolation_neighbors=N).

Default behaviour (neighbors=None) is unchanged and still uses the
original whole-map Rbf fit, so this is purely additive.

Ported from Loop3D/map2loop#250 (that repository is being archived now
that map2loop lives in packages/map2loop of this monorepo).

This branch has not been deployed

No deployments
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