Conversation
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.
Done with Claude (Sonnet 5, high reasoning effort).
Summary
Fixes #5954, where
pssac/sacoccasionally draws a short, disconnectedstray line segment near a trace peak.
Two bugs combined to produce this:
pssac.cnever wrapped its line/fill drawing ingmt_map_clip_on/gmt_map_clip_off, unlike other line-plotting modules (psxy,pswiggle, ...), so traces briefly exceeding the plotted y-range were never clipped to the frame.gmt_plot_linepen-width border-extension helper (gmtplot_get_outside_point_extensioningmt_plot.c) computes an extension length viaW / tan(angle). When a line crosses the border at a near-tangent angle — which happens whenever a smooth waveform peak just barely pokes above/below the plotted range, as in the reporter's SAC trace — this blows up to a length far beyond the segment that defines the crossing direction, producing a visible stray line. This is a generic bug (reproduced identically via plainpsxyon the same sample values), not specific to SAC data.Fix
gmt_plot.c: cap the extension length to the length of the segment that defines the crossing direction (L = MIN(L, hypot(dx, dy))).seis/pssac.c: add the missinggmt_map_clip_on/gmt_map_clip_offaround the per-trace plotting loop.Checked visually with:
The files are in #5954.