Skip to content

Add blockmedian and surface gallery example - #4771

Open
Aayush7788 wants to merge 12 commits into
GenericMappingTools:mainfrom
Aayush7788:docs-blockmedian-surface
Open

Add blockmedian and surface gallery example#4771
Aayush7788 wants to merge 12 commits into
GenericMappingTools:mainfrom
Aayush7788:docs-blockmedian-surface

Conversation

@Aayush7788

@Aayush7788 Aayush7788 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description of proposed changes

Adds a gallery example showing how to reduce irregular bathymetry observations
with pygmt.blockmedian before interpolating them with pygmt.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 perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@seisman seisman added documentation Improvements or additions to documentation needs review This PR has higher priority and needs review. labels Jul 28, 2026
@seisman seisman added this to the 0.20.0 milestone Jul 28, 2026
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Aayush7788 and others added 4 commits July 29, 2026 14:17
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>
@Aayush7788

Copy link
Copy Markdown
Contributor Author

@seisman , any update

@Aayush7788

Copy link
Copy Markdown
Contributor Author

@seisman, any update on this branch?

Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py Outdated
Comment thread examples/gallery/images/gridding_with_surface.py
Comment thread examples/gallery/images/gridding_with_surface.py
region=region,
projection="M?",
frame=Frame(
axes="WSne",

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.

axes defaults to "WSen", so it can be omitted.

Suggested change
axes="WSne",

region=region,
projection="M?",
frame=Frame(
axes="WSne",

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.

Suggested change
axes="WSne",

Comment on lines +5 to +10
The :func:`pygmt.surface` function interpolates irregularly spaced (x, y, z)
observations onto a regular grid. Before interpolation, it's usually recommended
to preprocess the data using one of :func:`pygmt.blockmean`,
:func:`pygmt.blockmedian`, and :func:`pygmt.blockmode`, to avoid aliasing short
wavelengths, by returning one value for every occupied block.

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.

Suggested change
The :func:`pygmt.surface` function interpolates irregularly spaced (x, y, z)
observations onto a regular grid. Before interpolation, it's usually recommended
to preprocess the data using one of :func:`pygmt.blockmean`,
:func:`pygmt.blockmedian`, and :func:`pygmt.blockmode`, to avoid aliasing short
wavelengths, by returning one value for every occupied block.
The :func:`pygmt.surface` function interpolates irregularly spaced (x, y, z)
observations onto a regular grid. Before interpolation, it's usually recommended to
preprocess the data using one of :func:`pygmt.blockmean`, :func:`pygmt.blockmedian`, and
:func:`pygmt.blockmode`, to avoid aliasing short wavelengths, by returning one value for
every occupied block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs review This PR has higher priority and needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gallery example to showcase blockmean/blockmedian and surface

3 participants