Skip to content

Update the z min/max inside readonly subsets - #5948

Merged
PaulWessel merged 2 commits into
masterfrom
reset_zrange-readonly
Nov 4, 2021
Merged

PaulWessel merged 2 commits into
masterfrom
reset_zrange-readonly

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

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

@maxrjones maxrjones left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works well, thanks!

This branch was previously deployed

1 inactive deployment
Preview — 1bd9bbea Deployed Nov 4, 2021 by vercel[bot]
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