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

Let grdcut -E extract a vertical slice from a 3-D cube #7961

Merged
merged 16 commits into from Oct 22, 2023

Conversation

PaulWessel
Copy link
Member

grdcut -Ex|ycoord lets users extract a vertical slice grid that is either parallel to the x or y direction and goes through the specified coordinate. For example, gmt grdcut my cube.nc -Gslice.nc -Ey33 will cut along the row corresponding to y = 33. For grdcut we require the cube be equidistant in the 3rd dimension, and that coord is a node coordinate so there is no resampling here, just picking the nodes along that slice. Once tested I will add this to grdinterpolate where, if -T is set and coord does not necessarily fall on a node,. we will resample by providing the coordinates for the output grid.

If you have a 3D cube it is nice to get a vertical slice grid out for some given x or y value. grdinterpolate -R does this by point and via grdtrack so it is slow.  If n_layers are equidistantly spaced then it is simple to extract a grid.
@PaulWessel PaulWessel added the new core module feature PR that implements a new core module feature label Oct 20, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Oct 20, 2023
@PaulWessel PaulWessel self-assigned this Oct 20, 2023
@PaulWessel PaulWessel changed the title WIP Let crd cut -E extract a vertical slice from a 3-D cube WIP Let grdcut -E extract a vertical slice from a 3-D cube Oct 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2023

Summary of changed images

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

Status Path
added test/baseline/grdcut/vert_cube_cuts.ps
modified test/baseline/grdcut/

Image diff(s)

Added images

  • test/baseline/grdcut/vert_cube_cuts.png

Modified images

Path Old New

Report last updated at commit 22de03c

@PaulWessel PaulWessel changed the title WIP Let grdcut -E extract a vertical slice from a 3-D cube Let grdcut -E extract a vertical slice from a 3-D cube Oct 22, 2023
@PaulWessel
Copy link
Member Author

Added working test and polished docs.

@PaulWessel PaulWessel merged commit f6a77e6 into master Oct 22, 2023
7 checks passed
@PaulWessel PaulWessel deleted the vertical-slices branch October 22, 2023 12:09
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-changelog Add PR to the changelog new core module feature PR that implements a new core module feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants