From b47ab3527e547c6e8cd4bf85dc7183c3ead21220 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Sun, 20 Sep 2020 15:06:23 +1200 Subject: [PATCH 01/15] Document common aliases for grdimage Add automatic docstrings for frame (B), cmap (C), projection (J), region (R), timestamp (U), verbose (V), and interpolation (n). Also removed alias pen (W) that actually doesn't work. --- pygmt/base_plotting.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 950e1b089de..2611c83616a 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -303,12 +303,14 @@ def grdcontour(self, grid, **kwargs): @fmt_docstring @use_alias( - R="region", - J="projection", - W="pen", B="frame", - I="shading", C="cmap", + I="shading", + J="projection", + R="region", + U="timestamp", + V="verbose", + n="interpolation", t="transparency", ) @kwargs_to_strings(R="sequence") @@ -326,6 +328,12 @@ def grdimage(self, grid, **kwargs): ---------- grid : str or xarray.DataArray The file name of the input grid or the grid loaded as a DataArray. + {B} + {CPT} + {J} + {R} + {V} + {n} {t} """ From 4c352c0bd23c84fece9c42b5e71dc2e6db252e08 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Sun, 20 Sep 2020 15:54:56 +1200 Subject: [PATCH 02/15] Alias dpi (E) for grdimage --- pygmt/base_plotting.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 2611c83616a..6d55e612c75 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -305,6 +305,7 @@ def grdcontour(self, grid, **kwargs): @use_alias( B="frame", C="cmap", + E="dpi", I="shading", J="projection", R="region", @@ -330,6 +331,13 @@ def grdimage(self, grid, **kwargs): The file name of the input grid or the grid loaded as a DataArray. {B} {CPT} + dpi : int + ``[i|dpi]``. + Sets the resolution of the projected grid that will be created if a + map projection other than Linear or Mercator was selected [100]. By + default, the projected grid will be of the same size (rows and + columns) as the input file. Specify *i* to use the PostScript image + operator to interpolate the image at the device resolution. {J} {R} {V} From b7029c5591da182d316704e8157b620f0469b14a Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Sun, 20 Sep 2020 16:02:07 +1200 Subject: [PATCH 03/15] 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. --- pygmt/base_plotting.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 6d55e612c75..a38f5608886 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -317,9 +317,37 @@ def grdcontour(self, grid, **kwargs): @kwargs_to_strings(R="sequence") def grdimage(self, grid, **kwargs): """ - Project grids or images and plot them on maps. - - Takes a grid file name or an xarray.DataArray object as input. + Project and plot grids or images. + + Reads one 2-D grid file and produces a gray-shaded (or colored) map by + plotting rectangles centered on each grid node and assigning them a + gray-shade (or color) based on the z-value. Alternatively, `grdimage` + reads three 2-D grid files with the red, green, and blue components + directly (all must be in the 0-255 range). Optionally, illumination may + be added by providing a file with intensities in the (-1,+1) range or + instructions to derive intensities from the input data grid. Values + outside this range will be clipped. Such intensity files can be created + from the grid using `grdgradient` and, optionally, modified by + `grdmath` or `grdhisteq`. A third alternative is available when GMT is + build with GDAL support. Pass *img* which can be an image file + (geo-referenced or not). In this case the images can optionally be + illuminated with the file provided via the *shading* option. Here, if + image has no coordinates then those of the intensity file will be used. + + When using map projections, the grid is first resampled on a new + rectangular grid with the same dimensions. Higher resolution images can + be obtained by using the *dpi* option. To obtain the resampled value + (and hence shade or color) of each map pixel, its location is inversely + projected back onto the input grid after which a value is interpolated + between the surrounding input grid values. By default bi-cubic + interpolation is used. Aliasing is avoided by also forward projecting + the input grid nodes. If two or more nodes are projected onto the same + pixel, their average will dominate in the calculation of the pixel + value. Interpolation and aliasing is controlled with the + *interpolation* option. + + The *region* option can be used to select a map region larger or + smaller than that implied by the extent of the grid. Full option list at :gmt-docs:`grdimage.html` From 14ba3326decf29b2bd92a9a1bef02ada28ed898c Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Sun, 20 Sep 2020 16:12:55 +1200 Subject: [PATCH 04/15] Alias monochrome (M), noclip (N) and nan_alpha (Q) for grdimage --- pygmt/base_plotting.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index a38f5608886..5fe3c2d6c82 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -308,6 +308,9 @@ def grdcontour(self, grid, **kwargs): E="dpi", I="shading", J="projection", + M="monochrome", + N="noclip", + Q="nan_alpha", R="region", U="timestamp", V="verbose", @@ -367,6 +370,16 @@ def grdimage(self, grid, **kwargs): columns) as the input file. Specify *i* to use the PostScript image operator to interpolate the image at the device resolution. {J} + monochrome : bool + Force conversion to monochrome image using the (television) YIQ + transformation. Cannot be used with *nan_alpha*. + noclip : bool + Do not clip the image at the map boundary (only relevant for + non-rectangular maps). + nan_alpha : bool + Make grid nodes with z = NaN transparent, using the color-masking + feature in PostScript Level 3 (the PS device must support PS Level + 3). {R} {V} {n} From 4584c32cd0f5a0b065496176a99594280c455344 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 09:27:26 +1200 Subject: [PATCH 05/15] Alias img_out (A) and img_in (D) for grdimage --- pygmt/base_plotting.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 5fe3c2d6c82..37bc7b1b78d 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -303,8 +303,10 @@ def grdcontour(self, grid, **kwargs): @fmt_docstring @use_alias( + A="img_out", B="frame", C="cmap", + D="img_in", E="dpi", I="shading", J="projection", @@ -360,8 +362,36 @@ def grdimage(self, grid, **kwargs): ---------- grid : str or xarray.DataArray The file name of the input grid or the grid loaded as a DataArray. + img_out : str + ``out_img[=driver]``. + Save an image in a raster format instead of PostScript. Use + extension .ppm for a Portable Pixel Map format which is the only + raster format GMT can natively write. For GMT installations + configured with GDAL support there are more choices: Append + *out_img* to select the image file name and extension. If the + extension is one of .bmp, .gif, .jpg, .png, or .tif then no driver + information is required. For other output formats you must append + the required GDAL driver. The driver is the driver code name used + by GDAL; see your GDAL installation's documentation for available + drivers. Append a **+coptions** string where options is a list of + one or more concatenated number of GDAL **-co** options. For + example, to write a GeoPDF with the TerraGo format use + ``=PDF+cGEO_ENCODING=OGC_BP``. Notes: (1) If a tiff file (.tif) is + selected then we will write a GeoTiff image if the GMT projection + syntax translates into a PROJ syntax, otherwise a plain tiff file + is produced. (2) Any vector elements will be lost. {B} {CPT} + img_in : str + ``[r]`` + GMT will automatically detect standard image files (Geotiff, TIFF, + JPG, PNG, GIF, etc.) and will read those via GDAL. For very obscure + image formats you may need to explicitly set **img_in**, which + specifies that the grid is in fact an image file to be read via + GDAL. Append **r** to assign the region specified by **region** + to the image. For example, if you have used ``region='d'`` then the + image will be assigned a global domain. This mode allows you to + project a raw image (an image without referencing coordinates). dpi : int ``[i|dpi]``. Sets the resolution of the projected grid that will be created if a From 4c1fcb20f3e5b82c280222db5158bbfb603dfa3b Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 09:54:42 +1200 Subject: [PATCH 06/15] Alias bit_color (G) for grdimage --- pygmt/base_plotting.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 37bc7b1b78d..0190d519335 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -308,6 +308,7 @@ def grdcontour(self, grid, **kwargs): C="cmap", D="img_in", E="dpi", + G="bit_color", I="shading", J="projection", M="monochrome", @@ -399,6 +400,14 @@ def grdimage(self, grid, **kwargs): default, the projected grid will be of the same size (rows and columns) as the input file. Specify *i* to use the PostScript image operator to interpolate the image at the device resolution. + bit_color : str + ``color[+b|f]``. + This option only applies when a resulting 1-bit image otherwise + would consist of only two colors: black (0) and white (255). If + so, this option will instead use the image as a transparent mask + and paint the mask with the given color. Append **+b** to paint + the background pixels (1) or **+f** for the foreground pixels + [Default]. {J} monochrome : bool Force conversion to monochrome image using the (television) YIQ From d2b69971e1765141dfac8f53fc914b11e136840c Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 10:10:53 +1200 Subject: [PATCH 07/15] Remove mention of RGB grid inputs, following GMT 6.2.0 grdimage docs --- pygmt/base_plotting.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 0190d519335..21d6da88c13 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -325,19 +325,17 @@ def grdimage(self, grid, **kwargs): """ Project and plot grids or images. - Reads one 2-D grid file and produces a gray-shaded (or colored) map by - plotting rectangles centered on each grid node and assigning them a - gray-shade (or color) based on the z-value. Alternatively, `grdimage` - reads three 2-D grid files with the red, green, and blue components - directly (all must be in the 0-255 range). Optionally, illumination may - be added by providing a file with intensities in the (-1,+1) range or - instructions to derive intensities from the input data grid. Values + Reads a 2-D grid file and produces a gray-shaded (or colored) map by + building a rectangular image and assigning pixels a gray-shade (or + color) based on the z-value and the CPT file. Optionally, illumination + may be added by providing a file with intensities in the (-1,+1) range + or instructions to derive intensities from the input data grid. Values outside this range will be clipped. Such intensity files can be created from the grid using `grdgradient` and, optionally, modified by `grdmath` or `grdhisteq`. A third alternative is available when GMT is - build with GDAL support. Pass *img* which can be an image file - (geo-referenced or not). In this case the images can optionally be - illuminated with the file provided via the *shading* option. Here, if + build with GDAL support. Pass **image** which can be an image file + (geo-referenced or not). In this case the image can optionally be + illuminated with the file provided via the **shading** option. Here, if image has no coordinates then those of the intensity file will be used. When using map projections, the grid is first resampled on a new @@ -362,7 +360,10 @@ def grdimage(self, grid, **kwargs): Parameters ---------- grid : str or xarray.DataArray - The file name of the input grid or the grid loaded as a DataArray. + ``grid | image``. + The file name or a DataArray containing the input 2-D gridded data + set or image to be plotted (See GRID FILE FORMATS at + :gmt-docs:`grdimage.html#grid-file-formats`). img_out : str ``out_img[=driver]``. Save an image in a raster format instead of PostScript. Use From 8817749e4e78a78e336a1b5634448678915d8adf Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 14:32:45 +1200 Subject: [PATCH 08/15] Change grdimage aliases to no_clip (N) and nan_transparent (Q) --- pygmt/base_plotting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 9b1b1898dde..e5b8618903d 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -321,8 +321,8 @@ def grdcontour(self, grid, **kwargs): I="shading", J="projection", M="monochrome", - N="noclip", - Q="nan_alpha", + N="no_clip", + Q="nan_transparent", R="region", U="timestamp", V="verbose", @@ -424,11 +424,11 @@ def grdimage(self, grid, **kwargs): {J} monochrome : bool Force conversion to monochrome image using the (television) YIQ - transformation. Cannot be used with *nan_alpha*. - noclip : bool + transformation. Cannot be used with *nan_transparent*. + no_clip : bool Do not clip the image at the map boundary (only relevant for non-rectangular maps). - nan_alpha : bool + nan_transparent : bool Make grid nodes with z = NaN transparent, using the color-masking feature in PostScript Level 3 (the PS device must support PS Level 3). From 581968a0b3cf2e33d4d5ee0473306e9c1f4d8e4b Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 15:59:45 +1200 Subject: [PATCH 09/15] Fix indentation of bit_color docstring --- pygmt/base_plotting.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index e5b8618903d..1f75b3e667e 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -414,13 +414,13 @@ def grdimage(self, grid, **kwargs): columns) as the input file. Specify *i* to use the PostScript image operator to interpolate the image at the device resolution. bit_color : str - ``color[+b|f]``. - This option only applies when a resulting 1-bit image otherwise - would consist of only two colors: black (0) and white (255). If - so, this option will instead use the image as a transparent mask - and paint the mask with the given color. Append **+b** to paint - the background pixels (1) or **+f** for the foreground pixels - [Default]. + ``color[+b|f]``. + This option only applies when a resulting 1-bit image otherwise + would consist of only two colors: black (0) and white (255). If so, + this option will instead use the image as a transparent mask and + paint the mask with the given color. Append **+b** to paint the + background pixels (1) or **+f** for the foreground pixels + [Default]. {J} monochrome : bool Force conversion to monochrome image using the (television) YIQ From a0771e6bfb66ddd9a5f21a4c6eecdc799a1295e1 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Mon, 21 Sep 2020 16:04:52 +1200 Subject: [PATCH 10/15] Document shading (I) for grdimage --- pygmt/base_plotting.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 1f75b3e667e..7ad01ebb1c2 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -421,6 +421,18 @@ def grdimage(self, grid, **kwargs): paint the mask with the given color. Append **+b** to paint the background pixels (1) or **+f** for the foreground pixels [Default]. + shading : str + ``[intensfile|intensity|modifiers]``. + Give the name of a grid file with intensities in the (-1,+1) range, + or a constant intensity to apply everywhere (affects the ambient + light). Alternatively, derive an intensity grid from the input data + grid via a call to `grdgradient`; append **+aazimuth**, **+nargs**, + and **+mambient** to specify azimuth, intensity, and ambient + arguments for that module, or just give **+d** to select the + default arguments (``+a-45+nt1+m0``). If you want a more specific + intensity scenario then run `grdgradient` separately first. If we + should derive intensities from another file than grid, specify the + file with suitable modifiers [Default is no illumination]. {J} monochrome : bool Force conversion to monochrome image using the (television) YIQ From 3b14a0e0d31546ac3de01ecac9bce45e3eec5dd6 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Tue, 22 Sep 2020 17:08:24 +1200 Subject: [PATCH 11/15] Fix grdimage docstring formatting Co-authored-by: Dongdong Tian --- pygmt/base_plotting.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 589d7bec8bf..494f883986c 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -354,7 +354,7 @@ def grdimage(self, grid, **kwargs): `grdmath` or `grdhisteq`. A third alternative is available when GMT is build with GDAL support. Pass **image** which can be an image file (geo-referenced or not). In this case the image can optionally be - illuminated with the file provided via the **shading** option. Here, if + illuminated with the file provided via the *shading* option. Here, if image has no coordinates then those of the intensity file will be used. When using map projections, the grid is first resampled on a new @@ -394,7 +394,7 @@ def grdimage(self, grid, **kwargs): information is required. For other output formats you must append the required GDAL driver. The driver is the driver code name used by GDAL; see your GDAL installation's documentation for available - drivers. Append a **+coptions** string where options is a list of + drivers. Append a **+c**\ *options* string where options is a list of one or more concatenated number of GDAL **-co** options. For example, to write a GeoPDF with the TerraGo format use ``=PDF+cGEO_ENCODING=OGC_BP``. Notes: (1) If a tiff file (.tif) is @@ -407,9 +407,9 @@ def grdimage(self, grid, **kwargs): ``[r]`` GMT will automatically detect standard image files (Geotiff, TIFF, JPG, PNG, GIF, etc.) and will read those via GDAL. For very obscure - image formats you may need to explicitly set **img_in**, which + image formats you may need to explicitly set *img_in*, which specifies that the grid is in fact an image file to be read via - GDAL. Append **r** to assign the region specified by **region** + GDAL. Append **r** to assign the region specified by *region* to the image. For example, if you have used ``region='d'`` then the image will be assigned a global domain. This mode allows you to project a raw image (an image without referencing coordinates). From ccf6c1dde4c695b404dcf17bbbc2814fa02ac02b Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Tue, 22 Sep 2020 17:19:17 +1200 Subject: [PATCH 12/15] Fix flake8 issue with >79 chars and backslash --- pygmt/base_plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 494f883986c..9d8e719be45 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -394,8 +394,8 @@ def grdimage(self, grid, **kwargs): information is required. For other output formats you must append the required GDAL driver. The driver is the driver code name used by GDAL; see your GDAL installation's documentation for available - drivers. Append a **+c**\ *options* string where options is a list of - one or more concatenated number of GDAL **-co** options. For + drivers. Append a **+c**\\ *options* string where options is a list + of one or more concatenated number of GDAL **-co** options. For example, to write a GeoPDF with the TerraGo format use ``=PDF+cGEO_ENCODING=OGC_BP``. Notes: (1) If a tiff file (.tif) is selected then we will write a GeoTiff image if the GMT projection From 924e5a84008974e21d26b77b3b302733609a05e1 Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Wed, 23 Sep 2020 09:30:05 +1200 Subject: [PATCH 13/15] Properly bold and italicize some more arguments and remove grid | image Co-Authored-By: Dongdong Tian --- pygmt/base_plotting.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 9d8e719be45..21fb46c405a 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -379,7 +379,6 @@ def grdimage(self, grid, **kwargs): Parameters ---------- grid : str or xarray.DataArray - ``grid | image``. The file name or a DataArray containing the input 2-D gridded data set or image to be plotted (See GRID FILE FORMATS at :gmt-docs:`grdimage.html#grid-file-formats`). @@ -392,7 +391,7 @@ def grdimage(self, grid, **kwargs): *out_img* to select the image file name and extension. If the extension is one of .bmp, .gif, .jpg, .png, or .tif then no driver information is required. For other output formats you must append - the required GDAL driver. The driver is the driver code name used + the required GDAL driver. The *driver* is the driver code name used by GDAL; see your GDAL installation's documentation for available drivers. Append a **+c**\\ *options* string where options is a list of one or more concatenated number of GDAL **-co** options. For @@ -418,8 +417,8 @@ def grdimage(self, grid, **kwargs): Sets the resolution of the projected grid that will be created if a map projection other than Linear or Mercator was selected [100]. By default, the projected grid will be of the same size (rows and - columns) as the input file. Specify *i* to use the PostScript image - operator to interpolate the image at the device resolution. + columns) as the input file. Specify **i** to use the PostScript + image operator to interpolate the image at the device resolution. bit_color : str ``color[+b|f]``. This option only applies when a resulting 1-bit image otherwise @@ -433,13 +432,14 @@ def grdimage(self, grid, **kwargs): Give the name of a grid file with intensities in the (-1,+1) range, or a constant intensity to apply everywhere (affects the ambient light). Alternatively, derive an intensity grid from the input data - grid via a call to `grdgradient`; append **+aazimuth**, **+nargs**, - and **+mambient** to specify azimuth, intensity, and ambient - arguments for that module, or just give **+d** to select the - default arguments (``+a-45+nt1+m0``). If you want a more specific - intensity scenario then run `grdgradient` separately first. If we - should derive intensities from another file than grid, specify the - file with suitable modifiers [Default is no illumination]. + grid via a call to `grdgradient`; append **+a** \\ *azimuth*, + **+n** \\ *args*, and **+m** \\ *ambient* to specify azimuth, + intensity, and ambient arguments for that module, or just give + **+d** to select the default arguments (``+a-45+nt1+m0``). If you + want a more specific intensity scenario then run `grdgradient` + separately first. If we should derive intensities from another file + than grid, specify the file with suitable modifiers [Default is no + illumination]. {J} monochrome : bool Force conversion to monochrome image using the (television) YIQ From 6f0c34aa56f5cc7b6a0b1d2e3dbfa53f139285df Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Wed, 23 Sep 2020 10:28:42 +1200 Subject: [PATCH 14/15] Improve explanation of image inputs into grdimage Co-Authored-By: Dongdong Tian --- pygmt/base_plotting.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 21fb46c405a..6e4c5959e4a 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -351,11 +351,11 @@ def grdimage(self, grid, **kwargs): or instructions to derive intensities from the input data grid. Values outside this range will be clipped. Such intensity files can be created from the grid using `grdgradient` and, optionally, modified by - `grdmath` or `grdhisteq`. A third alternative is available when GMT is - build with GDAL support. Pass **image** which can be an image file - (geo-referenced or not). In this case the image can optionally be - illuminated with the file provided via the *shading* option. Here, if - image has no coordinates then those of the intensity file will be used. + `grdmath` or `grdhisteq`. If GMT is built with GDAL support, *grid* can + be an image file (geo-referenced or not). In this case the image can + optionally be illuminated with the file provided via the *shading* + option. Here, if image has no coordinates then those of the intensity + file will be used. When using map projections, the grid is first resampled on a new rectangular grid with the same dimensions. Higher resolution images can From 6b6e63a9b881d637499f32d39017b0f05eb13a3e Mon Sep 17 00:00:00 2001 From: Wei Ji Date: Wed, 23 Sep 2020 11:05:54 +1200 Subject: [PATCH 15/15] Trim whitespace between +a azimuth and others Co-Authored-By: Dongdong Tian --- pygmt/base_plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/base_plotting.py b/pygmt/base_plotting.py index 6e4c5959e4a..e02eb03d310 100644 --- a/pygmt/base_plotting.py +++ b/pygmt/base_plotting.py @@ -432,8 +432,8 @@ def grdimage(self, grid, **kwargs): Give the name of a grid file with intensities in the (-1,+1) range, or a constant intensity to apply everywhere (affects the ambient light). Alternatively, derive an intensity grid from the input data - grid via a call to `grdgradient`; append **+a** \\ *azimuth*, - **+n** \\ *args*, and **+m** \\ *ambient* to specify azimuth, + grid via a call to `grdgradient`; append **+a**\\ *azimuth*, + **+n**\\ *args*, and **+m**\\ *ambient* to specify azimuth, intensity, and ambient arguments for that module, or just give **+d** to select the default arguments (``+a-45+nt1+m0``). If you want a more specific intensity scenario then run `grdgradient`