pygmt.grdmask: Create mask grid from polygons or point coverage(required arguments)#4428
Open
Chuan1937 wants to merge 34 commits intoGenericMappingTools:mainfrom
Open
pygmt.grdmask: Create mask grid from polygons or point coverage(required arguments)#4428Chuan1937 wants to merge 34 commits intoGenericMappingTools:mainfrom
Chuan1937 wants to merge 34 commits intoGenericMappingTools:mainfrom
Conversation
seisman
reviewed
Feb 25, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Feb 25, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
26 tasks
seisman
reviewed
Feb 27, 2026
seisman
reviewed
Mar 2, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Mar 2, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Mar 3, 2026
seisman
reviewed
Mar 3, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Mar 4, 2026
seisman
reviewed
Mar 4, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Mar 4, 2026
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
seisman
reviewed
Mar 4, 2026
Comment on lines
+32
to
+33
| >>> _alias_option_N(outside=0, edge=0, inside=1)._value | ||
| '0/0/1' |
Member
There was a problem hiding this comment.
_alias_option_N() should return None.
Suggested change
| >>> _alias_option_N(outside=0, edge=0, inside=1)._value | |
| '0/0/1' | |
| >>> _alias_option_N()._value |
Comment on lines
+36
to
+45
| >>> _alias_option_N(outside=0, edge=0, inside="z")._value | ||
| 'z' | ||
| >>> _alias_option_N(outside=1, edge=0, inside="z")._value | ||
| 'z/1' | ||
| >>> _alias_option_N(outside=0, edge="z", inside="z")._value | ||
| 'Z' | ||
| >>> _alias_option_N(outside=0, edge=0, inside="id")._value | ||
| 'p' | ||
| >>> _alias_option_N(outside=0, edge="id", inside="id")._value | ||
| 'P' |
Member
There was a problem hiding this comment.
Suggested change
| >>> _alias_option_N(outside=0, edge=0, inside="z")._value | |
| 'z' | |
| >>> _alias_option_N(outside=1, edge=0, inside="z")._value | |
| 'z/1' | |
| >>> _alias_option_N(outside=0, edge="z", inside="z")._value | |
| 'Z' | |
| >>> _alias_option_N(outside=0, edge=0, inside="id")._value | |
| 'p' | |
| >>> _alias_option_N(outside=0, edge="id", inside="id")._value | |
| 'P' | |
| >>> _alias_option_N(inside="z")._value | |
| 'z' | |
| >>> _alias_option_N(outside=1, inside="z")._value | |
| 'z/1' | |
| >>> _alias_option_N(edge="z", inside="z")._value | |
| 'Z' | |
| >>> _alias_option_N(inside="id")._value | |
| 'p' | |
| >>> _alias_option_N(edge="id", inside="id")._value | |
| 'P' |
Comment on lines
+57
to
+61
| # Mode: -Nz, -NZ, -Np, or -NP | ||
| mode_char = _inside_modes[inside] | ||
| if edge == inside: | ||
| mode_char = mode_char.upper() | ||
| mask_values = mode_char if outside is None else [mode_char, outside] |
Member
There was a problem hiding this comment.
Suggested change
| # Mode: -Nz, -NZ, -Np, or -NP | |
| mode_char = _inside_modes[inside] | |
| if edge == inside: | |
| mode_char = mode_char.upper() | |
| mask_values = mode_char if outside is None else [mode_char, outside] | |
| # Mode: -Nz, -NZ, -Np, or -NP | |
| mode = _inside_modes[inside] | |
| if edge == inside: | |
| mode = mode.upper() | |
| mask_values = mode if outside is None else [mode, outside] |
| """ | ||
| Create mask grid from polygons or point coverage. | ||
|
|
||
| Reads one or more files (or standard input) containing polygon or data point |
Member
There was a problem hiding this comment.
There is no standard in in Python.
Suggested change
| Reads one or more files (or standard input) containing polygon or data point | |
| Reads one or more files containing polygon or data point |
| Create mask grid from polygons or point coverage. | ||
|
|
||
| Reads one or more files (or standard input) containing polygon or data point | ||
| coordinates, and creates a binary grid file where nodes that fall inside, on the |
Member
There was a problem hiding this comment.
Suggested change
| coordinates, and creates a binary grid file where nodes that fall inside, on the | |
| coordinates, and creates a grid where nodes that fall inside, on the |
Comment on lines
+108
to
+109
| Pass in either a file name, :class:`pandas.DataFrame`, :class:`numpy.ndarray`, | ||
| or a list of file names containing the polygon(s) or data points. Input can be: |
Member
There was a problem hiding this comment.
Suggested change
| Pass in either a file name, :class:`pandas.DataFrame`, :class:`numpy.ndarray`, | |
| or a list of file names containing the polygon(s) or data points. Input can be: | |
| Pass in either a file name to an ASCII data table, a 2-D $table_classes | |
| containg the polygon(s) or data points. Input can be: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pygmt.grdmask: Create mask grid from polygons or point coverage(required arguments)
Preview: https://pygmt-dev--4428.org.readthedocs.build/en/4428/api/generated/pygmt.grdmask.html#pygmt.grdmask