fix(map2loop): InterpolatedStructure contact/dip selection and StructuralPoint strike wraparound - #327
Open
lachlangrose wants to merge 1 commit into
Open
fix(map2loop): InterpolatedStructure contact/dip selection and StructuralPoint strike wraparound#327lachlangrose wants to merge 1 commit into
lachlangrose wants to merge 1 commit into
Conversation
…alPoint strike wraparound InterpolatedStructure: - shapely.shortest_line(point, top_contact_geometry) broadcasts over the list of top-contact geometries and returns one line per entry. The code took short_line[0] unconditionally, so whenever a basal contact was split into more than one feature (common across faults or map-sheet edges) the thickness estimate used an arbitrary segment instead of the nearest one. Now the candidate with the smallest length is selected explicitly. - Dip was sampled from stratigraphic_order[i] (the overlying unit) while the measured line spans stratigraphic_order[i + 1] (the unit whose thickness is being computed). Dip is now sampled from the same unit being measured. StructuralPoint: - The strike-allowance check compared strike1/strike2 against a plain numeric range (strike - allowance, strike + allowance). Strike is a compass bearing that wraps at 360 degrees, so measurements near due north (e.g. strike=5, contact strike=350) were incorrectly rejected even though they are well within tolerance. Replaced with an angular difference check that handles the wraparound correctly. Ported from Loop3D/map2loop#248 (that repository is being archived now that map2loop lives in packages/map2loop of this monorepo).
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#248 (closing that PR / archiving the standalone repo now that map2loop lives at
packages/map2loop).Three correctness bugs in the two most-used thickness calculators (
InterpolatedStructureis the project default;StructuralPointis the other user-facing option) inpackages/map2loop:InterpolatedStructurepicked the wrong basal contact segment.shapely.shortest_line(point, top_contact_geometry)broadcasts across the list of top-contact geometries and returns one candidate line per list entry; the code always tookshort_line[0]. Whenever a basal contact is split into more than one feature (common across faults or map-sheet edges), the thickness estimate silently used an arbitrary segment instead of the nearest one. Now the candidate with the minimum length is selected.InterpolatedStructuresampled dip from the wrong unit. The measured line spansstratigraphic_order[i + 1](the unit whose thickness is being computed), but dip was pulled from interpolated points instratigraphic_order[i](the overlying unit). Dip is now sampled from the unit actually being measured.StructuralPointrejected valid strike matches near due north. The strike-allowance check comparedstrike1/strike2against a plain numeric range(strike - allowance, strike + allowance). Strike is a compass bearing that wraps at 360°, so e.g. a measured strike of 5° and a contact strike of 350° (15° apart) failed the check even though they're well within the 30° default tolerance. Replaced with an angular-difference comparison that handles wraparound.Test plan
pytest packages/map2loop/tests/thickness— all 3 existing suites (InterpolatedStructure,StructuralPoint,ThicknessCalculatorAlpha) pass unchangedpytest packages/map2loop/tests/project/test_thickness_calculations.pypasses unchanged