This repository was archived by the owner on Sep 21, 2026. It is now read-only.
fix: use circular mean for collocated dip direction aggregation - #249
Closed
lachlangrose wants to merge 1 commit into
Closed
lachlangrose wants to merge 1 commit into
lachlangrose wants to merge 1 commit into
Conversation
…urements DipDipDirectionInterpolator.setup_interpolation averages collocated structure points (within one DBSCAN cluster) with a plain arithmetic mean. DIPDIR is a compass bearing, so this is wrong near due north: averaging 350 and 10 degrees gives 180 (the opposite direction) instead of 0. DIPDIR is now aggregated with a circular mean; X, Y and DIP (not a wrapping quantity) are unaffected.
Merged
2 tasks
Member
Author
|
Closing — map2loop now lives in packages/map2loop of Loop3D/LoopStructural, and this repository is being archived. Ported to Loop3D/LoopStructural#328 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
DipDipDirectionInterpolator.setup_interpolationclusters structure points that are withincell_sizeof each other (DBSCAN) and averages X, Y, DIP and DIPDIR within each cluster with a plain.mean().Note: this fixes aggregation of collocated points only. The RBF interpolation step across the full grid still blends raw DIPDIR values without circular awareness, so it can still produce artifacts near a 0°/360° discontinuity — that's a separate, larger change (e.g. interpolating sin/cos components independently) and out of scope here.
Test plan
pytest tests/thickness tests/project/test_thickness_calculations.py— passes unchanged (exercisesInterpolatedStructure, which uses this interpolator)_circular_mean_degrees([350, 10]) == 0(mod float precision) vs the oldmean([350, 10]) == 180