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

Update the z min/max inside readonly subsets #5948

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

PaulWessel
Copy link
Member

When a grid via a matrix is passed by reference and there is no need to switch to duplication, we adjust the grid's pad to simulate a cut. However, we never updated the header zmin/zmax to reflect the new data region. This PR takes care of this for grids (and cubes). Closes #5294.

PS: In the process I moved the relevant functions from gmt_grdio.c to gmt_api.c since they were only called there and this eliminates some duplication of macros as well as eliminating a few exported functions.

When a matrix is passed by reference and there is no need to switch to duplication, we adjust the grid's pad to simulate a cut.  However, we never updated the header zmin/zmax to reflect the new data region.  This PR takes care of this for grids (and cubes).  Closes #5294.
@PaulWessel PaulWessel added the bug Something isn't working label Nov 4, 2021
@PaulWessel PaulWessel added this to the 6.3.0 milestone Nov 4, 2021
@PaulWessel PaulWessel requested a review from maxrjones November 4, 2021 22:20
@PaulWessel PaulWessel self-assigned this Nov 4, 2021
Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, thanks!

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.

CPT range auto-stretching works differently with NetCDF and virtual reliefgrid inputs
2 participants