Skip to content

pygmt.grdfilter: Support Pythonic arguments for the distance parameter#4405

Merged
seisman merged 9 commits intomainfrom
grdfilter/distance
Feb 24, 2026
Merged

pygmt.grdfilter: Support Pythonic arguments for the distance parameter#4405
seisman merged 9 commits intomainfrom
grdfilter/distance

Conversation

@seisman
Copy link
Member

@seisman seisman commented Feb 10, 2026

grdfilter's -D option is the distance flag indicating the meaning of the grid and the width. It can accept one of p or 0-5, but arguments like distance=4 is very confusing. This PR makes it take more readable arguments.

The long names come from

https://github.com/GenericMappingTools/gmt/blob/328f373b348747abcb2279456778e7f60567eb49/src/grdfilter.c#L149-L155

#define GRDFILTER_XY_PIXEL		-1
#define GRDFILTER_XY_CARTESIAN		0
#define GRDFILTER_GEO_CARTESIAN		1
#define GRDFILTER_GEO_FLATEARTH1	2
#define GRDFILTER_GEO_FLATEARTH2	3
#define GRDFILTER_GEO_SPHERICAL		4
#define GRDFILTER_GEO_MERCATOR		5

Preview: https://pygmt-dev--4405.org.readthedocs.build/en/4405/api/generated/pygmt.grdfilter.html

@seisman seisman added high-priority enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Feb 10, 2026
@seisman seisman added this to the 0.19.0 milestone Feb 10, 2026
@seisman seisman marked this pull request as ready for review February 10, 2026 12:20
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Feb 20, 2026
@seisman seisman requested a review from a team February 20, 2026 07:53
@seisman
Copy link
Member Author

seisman commented Feb 20, 2026

@GenericMappingTools/pygmt-maintainers Please give this PR final reviews. Plan to merge it in three days.

@seisman seisman removed final review call This PR requires final review and approval from a second reviewer high-priority labels Feb 24, 2026
@seisman seisman merged commit cb607ed into main Feb 24, 2026
21 of 23 checks passed
@seisman seisman deleted the grdfilter/distance branch February 24, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant