feat(map2loop): opt-in local-radius RBF for InterpolatedStructure dip interpolation - #329
Open
lachlangrose wants to merge 2 commits into
Open
lachlangrose wants to merge 2 commits into
lachlangrose wants to merge 2 commits into
Conversation
…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).
Closed
2 tasks
This branch has not been deployed
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.
Summary
Ported from Loop3D/map2loop#250 (closing that PR / archiving the standalone repo now that map2loop lives at
packages/map2loop).InterpolatedStructureinterpolates dip withscipy.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 thethickness = L * sin(dip)formula.This adds an opt-in local-radius mode:
DipDipDirectionInterpolatorgains aneighbors: Optional[int]constructor argument. Wheninterpolate()is called withscipy.interpolate.RBFInterpolator(new — previously onlyRbf/LinearNDInterpolatorwere supported), each grid point's fit uses only itsneighborsnearest structure measurements viaRBFInterpolator's built-inneighborsparameter, rather than every point on the map.InterpolatedStructuregainslocal_interpolation_neighbors: Optional[int] = None. When set, it builds the dip interpolator in local mode; when left asNone(the default), behaviour is byte-for-byte the same whole-mapRbffit 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 defaultInterpolatedStructureon the Hamersley test fixtures withlocal_interpolation_neighborsunset, 5, and 20 — all three run cleanly with no NaNs, and thickness estimates shift sensibly as the neighbourhood shrinks