Skip to content

Commit b7029c5

Browse files
committed
Copy grdimage long description from GMT manpage
Copied from https://docs.generic-mapping-tools.org/6.1/grdimage.html, swapping out short command-line arguments for long aliases.
1 parent 4c352c0 commit b7029c5

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

pygmt/base_plotting.py

+31-3
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,37 @@ def grdcontour(self, grid, **kwargs):
317317
@kwargs_to_strings(R="sequence")
318318
def grdimage(self, grid, **kwargs):
319319
"""
320-
Project grids or images and plot them on maps.
321-
322-
Takes a grid file name or an xarray.DataArray object as input.
320+
Project and plot grids or images.
321+
322+
Reads one 2-D grid file and produces a gray-shaded (or colored) map by
323+
plotting rectangles centered on each grid node and assigning them a
324+
gray-shade (or color) based on the z-value. Alternatively, `grdimage`
325+
reads three 2-D grid files with the red, green, and blue components
326+
directly (all must be in the 0-255 range). Optionally, illumination may
327+
be added by providing a file with intensities in the (-1,+1) range or
328+
instructions to derive intensities from the input data grid. Values
329+
outside this range will be clipped. Such intensity files can be created
330+
from the grid using `grdgradient` and, optionally, modified by
331+
`grdmath` or `grdhisteq`. A third alternative is available when GMT is
332+
build with GDAL support. Pass *img* which can be an image file
333+
(geo-referenced or not). In this case the images can optionally be
334+
illuminated with the file provided via the *shading* option. Here, if
335+
image has no coordinates then those of the intensity file will be used.
336+
337+
When using map projections, the grid is first resampled on a new
338+
rectangular grid with the same dimensions. Higher resolution images can
339+
be obtained by using the *dpi* option. To obtain the resampled value
340+
(and hence shade or color) of each map pixel, its location is inversely
341+
projected back onto the input grid after which a value is interpolated
342+
between the surrounding input grid values. By default bi-cubic
343+
interpolation is used. Aliasing is avoided by also forward projecting
344+
the input grid nodes. If two or more nodes are projected onto the same
345+
pixel, their average will dominate in the calculation of the pixel
346+
value. Interpolation and aliasing is controlled with the
347+
*interpolation* option.
348+
349+
The *region* option can be used to select a map region larger or
350+
smaller than that implied by the extent of the grid.
323351
324352
Full option list at :gmt-docs:`grdimage.html`
325353

0 commit comments

Comments
 (0)