Skip to content

pygmt.grdclip: Clip the range of grid values #3882

Closed

Description

@seisman

This is the central issue to track the implementation of the pygmt.grdclip method.

GMT options

Checked: Implemented; Unchecked: To be implemented/discussed; Strikethrough: Won't implement.

Activity

  1. added
    feature request
    on Mar 29, 2025
  2. added this to the 0.4.0 milestone on Mar 29, 2025
  3. moved this from 0) Wishlist to 3) Complete aliases in PyGMT: Wrapping GMT moduleson Mar 29, 2025
  4. seisman commented on Mar 29, 2025

    @seisman
    MemberAuthor

    grdclip is one of the simple modules that have very few options. In PR #3883, I've tried to improve the pygmt.grdclip function, but before that, I'd like to ask your opinion about renaming the parameter new to replace.

    -Srold/new
    Set all data[i] == old to new. This is mostly useful when your data are known to be integer values. Repeat the option for as many replacements as are needed.

    I feel replace is a better name than new.

  5. yvonnefroehlich commented on Mar 29, 2025

    @yvonnefroehlich
    Member

    I feel replace is a better name than new.

    For me a renaming to replace makes sense, as this alias is more descriptive.

  6. seisman commented on Mar 31, 2025

    @seisman
    MemberAuthor

    -Sahigh/above[+e]
    Sets all values where data[i] > high to above. The +e modifier includes equality, meaning data[i] ≥ high.

    This option is aliased as above, with the Pythonic syntax accepting a two-value sequence (e.g., above=(100, 200)). However, there is no direct Pythonic equivalent for the +e modifier. If users need to include equality, a simple workaround is to slightly decrease high (e.g., above=(99.999, 200)). In other words, there is no need to implement a dedicated Pythonic solution for +e.

    The same goes for -Sb.

    For -Si and -Sr, both of them can be repeated for as many intervals as are needed. Currently, between and replace only accept 1-D sequence. PR #3883 will adds 2-D sequence support to these two parameters.

  7. moved this from 3) Complete aliases to 4) Gallery|tutorial example in PyGMT: Wrapping GMT moduleson Apr 26, 2025
  8. moved this from 4) Gallery|tutorial example to 5) Ongoing maintenance in PyGMT: Wrapping GMT moduleson Dec 18, 2025
  9. self-assigned this
    on Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions