Add blockmedian and surface gallery example - #4771
Conversation
| data=data, | ||
| region=region, | ||
| spacing=spacing, | ||
| C=True, |
There was a problem hiding this comment.
It seems the -C option is not aliased in PyGMT yet. Would you like to add it in a separate PR?
There was a problem hiding this comment.
thanks for pointing this out; I’ll keep this PR focused on the gallery example and leave the alias for a separate contribution.
There was a problem hiding this comment.
This example already looks good, but we need to implement the -C alias before merging this PR.
There was a problem hiding this comment.
Understood. I’ll implement the -C alias in a separate PR first. Before I start, could you please confirm that the public parameter should be named center and that it should be added consistently to blockmean, blockmedian, and blockmode, since GMT supports -C in all three modules? After that PR is merged, I’ll update this example to use center=True.
There was a problem hiding this comment.
Yes. If you look at the source code, you’ll notice that there are currently two ways to add the -C alias because we are transitioning from the old alias system to the new one: (1) using the use_alias decorator and (2) using the AliasSystem class. The use_alias decorator belongs to the old system and is no longer recommended, so please add the alias using AliasSystem instead.
There was a problem hiding this comment.
I opened #4780 to add the center parameter to blockmean, blockmedian, and blockmode using AliasSystem.
There was a problem hiding this comment.
Please merge the main branch into this branch, and then update C=True to center=True.
updated Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
updated Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
updated Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
|
@seisman , any update |
|
@seisman, any update on this branch? |
Description of proposed changes
Adds a gallery example showing how to reduce irregular bathymetry observations
with
pygmt.blockmedianbefore interpolating them withpygmt.surface.The example uses the built-in bathymetry sample dataset and compares the reduced
observations with the resulting grid.
Fixes #1352
Preview: https://pygmt-dev--4771.org.readthedocs.build/en/4771/gallery/images/gridding_with_surface.html
Guidelines
Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash command is:
/format: automatically format and lint the code