Skip to content

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

Merged
PaulWessel merged 16 commits intomasterfrom
vertical-slices
Oct 22, 2023
Merged

Let grdcut -E extract a vertical slice from a 3-D cube#7961
PaulWessel merged 16 commits intomasterfrom
vertical-slices

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 requested a review from joa-quim October 20, 2023 20:25
@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)

Details

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
@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.

3 participants