Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long-lasting bug with seniority finally killed in gmt_crossover function #8188

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

PaulWessel
Copy link
Member

The test spline_5.sh has failed (at least on macOS) for the longest time. Finally decided to debug the sucker and found that the missing contour annotations had to do with round-off. If fact there were two missing but only one was seen as a bug. Problem was that if the crossing was exactly on a data noted then our test to see if it was outside the segment failed because we checked along-track "time":

tx_a < ta_stop && tx_b < tb_stop

Clearly, if tx_a or tx_b equal ta_stop or tb_stop then we still fail (cutting at the mode). Solution is to allow one of the ends to be equal:

if (tx_a < ta_stop && tx_b <= tb_stop)

Now, the contour map places all the contours crossing the imaginary line set by -Gl:

gspline_5

The topmost 40 label in the bottom plot was missing before, but so was the 30 contour. Now all is well. A bug with seniority bites the dust!

WHen we use -G to create creat circle lines and wish to annotate the contours where those two line-types intersect we did this:

1. Create the helper lines in geographic coordinates then convert to plot coordinates
2. COnert contour lines to plot coordinates.
3. Call gmt_crossover with geo = true;

Hence, gmt_crossover would look for periodic data and jump even though there is none in the Caresian x,y.

This PR passes false instead of GMT_M_is_lon (GMT, GMT_IN) since that is not correct.

No change to any tests, but is homing in on the missing label (for macOS only?) in greenspline_5.sh test.
Update PS file
@PaulWessel PaulWessel added the bug Something isn't working label Dec 12, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Dec 12, 2023
@PaulWessel PaulWessel requested a review from a team December 12, 2023 15:40
@PaulWessel PaulWessel self-assigned this Dec 12, 2023
Copy link
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
deleted test/baseline/greenspline/gspline_1.ps
deleted test/baseline/greenspline/gspline_2.ps
deleted test/baseline/greenspline/gspline_3.ps
deleted test/baseline/greenspline/gspline_4.ps
deleted test/baseline/greenspline/gspline_5.ps
deleted test/baseline/greenspline/gspline_6.ps
deleted test/baseline/greenspline/gspline_7.ps
deleted test/baseline/greenspline/gspline_8.ps
modified test/baseline/greenspline/

Image diff(s)

Added images

Modified images

Path Old New

Report last updated at commit 41a3558

@PaulWessel PaulWessel merged commit 3e22029 into master Dec 12, 2023
7 checks passed
@PaulWessel PaulWessel deleted the cartesian-crossovers branch December 12, 2023 16:30
@WalterHFSmith
Copy link
Contributor

WalterHFSmith commented Dec 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants