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

Improve header checker for netCDF grids #4251

Merged
merged 3 commits into from
Sep 24, 2020
Merged

Conversation

PaulWessel
Copy link
Member

Description of proposed changes

See the discussion and grid posted on the Forum.

This PR addresses the spurious WARNING message that the grid in question generates. The reason we get the message is that for the y-coordinates, the stated range is -50 to 0, but the vector with y-coordinates starts at 0 and goes to -50. The two are in agreement (apart from perhaps direction, which is dealt with elsewhere) but the test here is about grid registration, so it fails for the wrong reasons and triggers

GMT_Report (GMT->parent, GMT_MSG_WARNING, "The y-coordinates and range attribute are in conflict; must rely on coordinates only\n");

on line 738 in gmt_nc.c. The PR also introduces a few more intermediate variables to help diagnose these issues in future cases. Tests all pass.

I added more temporary variables to the neader checker so it is easies to determine what the tests are based on.  Also, a netCDF file with a y-array that went from 0 to -50 caused trouble in a check for no particular reason.  This version should yield less spurious warnings.
@PaulWessel PaulWessel self-assigned this Sep 24, 2020
@PaulWessel PaulWessel merged commit 81d4e56 into master Sep 24, 2020
@PaulWessel PaulWessel deleted the improve-checker-nc branch September 24, 2020 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants