Skip to content
This repository was archived by the owner on Sep 21, 2026. It is now read-only.

feat: opt-in local-radius RBF for InterpolatedStructure dip interpolation - #250

Closed
lachlangrose wants to merge 1 commit into
masterfrom
feature/local-rbf-dip-interpolation
Closed

lachlangrose wants to merge 1 commit into
masterfrom
feature/local-rbf-dip-interpolation

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

Follow-up to a review of the thickness calculators. 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 tests/thickness 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.
@lachlangrose

Copy link
Copy Markdown
Member Author

Closing — map2loop now lives in packages/map2loop of Loop3D/LoopStructural, and this repository is being archived. Ported to Loop3D/LoopStructural#329

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant