WIP. Add stereonet module for plotting structural geology stereonets (Schmidt/Wulff) - #9178
Open
Esteban82 wants to merge 17 commits into
Open
WIP. Add stereonet module for plotting structural geology stereonets (Schmidt/Wulff)#9178Esteban82 wants to merge 17 commits into
Esteban82 wants to merge 17 commits into
Conversation
Review fixes on the stereonet module: - Fix a segfault: a bare -W (no pen argument) together with -Tl left W.string NULL while W.active was already true, so aliasing the pen onto -L called strdup(NULL). - Reject dips/plunges outside 0-90 and rakes outside 0-180. Such values projected onto the far hemisphere, where they are clipped away, so the module quietly produced a figure with missing data instead of an error. - Accept a negative rake as the usual shorthand for a rake measured from the opposite end of the strike, folding it into the 0-180 range (-25 is read as 155), matching the convention used by mplstereonet. The docs previously claimed negatives were rejected, which was never enforced. - Restore test/geology/minimal.sh as a classic-mode test producing $ps so the test harness can compare it, and drop the minimal.png/minimal.txt artifacts that were committed by accident.
New modules must add themselves to four separate hardcoded name lists in gmt_modern.c, or their modern name silently misbehaves in ways that only show up once you specifically go looking (this is not mentioned in devdocs/custom_supplements.rst): - gmt_current_name(): without this, every GMT_Report message (errors, warnings, info) prints the classic name "psstereonet" even when the user typed "stereonet" and is in modern mode. - gmtlib_get_active_name(): same classic->modern translation, used by a different set of callers. - gmtlib_is_modern_name(): without this, "gmt stereonet -^" (or any bare invocation outside a session, e.g. querying usage) fails outright with "Shared GMT module not found: stereonet", because the modern-mode leniency that lets a bare modern name grab usage/purpose text before a session exists never triggers. Found by testing "gmt stereonet ..." against the exact same scenarios for core module ternary and supplement modules polar/coupe (same pattern, already correctly registered) and diffing the behavior.
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.
Opening this as a draft/WIP specifically to get feedback before going further. @rhum1-geo, your suggestions (density contouring, Fisher stats, notation auto-detection, richer -S/vector options) are noted and intentionally not in this first PR — the plan is to land plotting first, then follow up with statistics in a later PR once the plotting side is settled.
What's implemented:
-T[d|l|p]— planes as strike/dip (right-hand rule) or dip-direction/dip, or lines as trend/plunge-W/-S/-L/-G— cyclographic traces and poles (or lines), styled like plot-A/-B— azimuth ring and the net's own grid mesh, both opt-in-T+u— upper hemisphereTested with (no automated tests yet — these are the scripts I manually ran and checked; anyone from #9156 is welcome to run them too):
0_Empty_Nets.sh— empty Schmidt and Wulff nets, with title, grid, and azimuth ring, no data1_Plot_Data.sh— a plane + its pole from strike/dip (RHR) input, styled independently2_Plot_Data_Inverted.sh— same data with columns swapped;-:and-i1,0should reproduce script 1 exactly3_Plot_Planes_Conventions.sh— the same plane entered as-Tp(strike/dip, RHR) and-Td(dip-direction/dip); traces should coincide4_Plot_Poles_Conventions.sh—-Tpand-Tdpoles for the same two planes should coincide (red under blue);-Tlreuses the same numbers as a line's trend/plunge instead, which is a different quantity and lands elsewhere on purpose5_Annotations.sh— fractional azimuth interval (-A22.5) with a title and-ViModel/effort: Claude Opus 5 for design and code review, Claude Sonnet 5 for iteration and testing.
Related to #9156.