Repository navigation
Closed
Labels
feature requestNew feature wanted
Description
This issue serves as the central place for discussing and tracking the implementation of the pygmt.grdinfo function in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at PyGMT: Wrapping GMT modules.
Documentation
- GMT: https://docs.generic-mapping-tools.org/dev/grdinfo.html
- GMT.jl: https://www.generic-mapping-tools.org/GMTjl_doc/documentation/modules/grdinfo
- PyGMT: https://www.pygmt.org/dev/api/generated/pygmt.grdinfo.html
GMT Option Flags and Modifiers
☑️: Implemented; ⬜: To be implemented/discussed; Strikethrough: Won't implement.
- ☑️
-C(per_column): Format the report as tab-separated fields on a single line; use"t"to append the file name, or"n"/Truefor numerical columns only. - ☑️
-D(tiles): Divide the grid domain into tiles of a given size (set viaspacing); optionally specify overlap and ignore tiles with no data (+i). : Not applicable in the Python interface (requires postscript output context).-E- ☑️
-F(geographic): Report domain and increments in world mapping format. : Not applicable (bulk grid download option not relevant in the Python interface).-G- ☑️
-I(spacing): Report region rounded to the nearest multiple of dx[/dy]; use"r"for the actual grid region,"i"for exact geographic region of img-produced grids, or"b"to write bounding-box polygons. - ☑️
-L(force_scan): Scan data to report actual z-range ("0"), median and L1 scale ("1"), mean/std/rms ("2"), mode and LMS scale ("p"), or all of the above ("a"). - ☑️
-M(minmax_pos): Include the x/y locations of the minimum and maximum z-values. - ☑️
-T(nearest_multiple): Determine min/max z, optionally rounded to multiples of dz; supports+a(alpha-trimmed range) and+s(symmetrical range about zero). - ☑️
-V(verbose): Verbosity level. : Use-X/-YFigure.shift_origininstead.- ☑️
-f(coltypes): Specify column data types for coordinate interpretation. : Use--PAR=valuepygmt.configinstead.
Notes on Input Formats
grid: Accepts a file path orxarray.DataArray.spacing(-I): If no argument is given, reports the grid increment as xinc[/yinc]. Use"b"to output the bounding-box polygon of the grid.per_columnandgeographicare mutually exclusive.- Returns a plain string; for machine-readable parsing, combine with
per_column. - When
tilesis in effect,spacingsets the tile dimensions rather than a rounding interval.
Linked Pull Requests
- Initial feature implementation – Wrap xyz2grd #636
- Accept
xarray.DataArrayas input – Rename vercel configuration file from now.json to vercel.json #738 - Add a gallery or tutorial example demonstrating
grdinfooutput (e.g., reporting z-range statistics or producing tiling region strings for a global relief grid)
Related Issues and Discussions
- Closely related to
pygmt.grdcutandpygmt.grdsample, which also work with grid metadata. - The
nearest_multiple(-T) output is designed for direct use withpygmt.makecpt. - The
tiles(-D) option can drive a tiled processing workflow for large grids.
Metadata
Metadata
Assignees
Labels
feature requestNew feature wanted
Type
Projects
- StatusShow more project fieldsNo status
Activity