Improve header checker for netCDF grids #4251
Merged
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.
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.