@@ -317,9 +317,37 @@ def grdcontour(self, grid, **kwargs):
317
317
@kwargs_to_strings (R = "sequence" )
318
318
def grdimage (self , grid , ** kwargs ):
319
319
"""
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.
323
351
324
352
Full option list at :gmt-docs:`grdimage.html`
325
353
0 commit comments