|
2 | 2 | grdimage - Plot grids or images.
|
3 | 3 | """
|
4 | 4 | from pygmt.clib import Session
|
| 5 | +from pygmt.exceptions import GMTInvalidInput |
5 | 6 | from pygmt.helpers import (
|
6 | 7 | build_arg_string,
|
7 | 8 | deprecate_parameter,
|
|
16 | 17 | @fmt_docstring
|
17 | 18 | @deprecate_parameter("bit_color", "bitcolor", "v0.10.0", remove_version="v0.12.0")
|
18 | 19 | @use_alias(
|
19 |
| - A="img_out", |
20 | 20 | B="frame",
|
21 | 21 | C="cmap",
|
22 | 22 | D="img_in",
|
@@ -76,21 +76,6 @@ def grdimage(self, grid, **kwargs):
|
76 | 76 | Parameters
|
77 | 77 | ----------
|
78 | 78 | {grid}
|
79 |
| - img_out : str |
80 |
| - *out_img*\[=\ *driver*]. |
81 |
| - Save an image in a raster format instead of PostScript. Append |
82 |
| - *out_img* to select the image file name and extension. If the |
83 |
| - extension is one of .bmp, .gif, .jpg, .png, or .tif then no driver |
84 |
| - information is required. For other output formats you must append |
85 |
| - the required GDAL driver. The *driver* is the driver code name used |
86 |
| - by GDAL; see your GDAL installation's documentation for available |
87 |
| - drivers. Append a **+c**\ *args* string where *args* is a list |
88 |
| - of one or more concatenated number of GDAL **-co** arguments. For |
89 |
| - example, to write a GeoPDF with the TerraGo format use |
90 |
| - ``=PDF+cGEO_ENCODING=OGC_BP``. **Notes**: (1) If a tiff file (.tif) |
91 |
| - is selected then we will write a GeoTiff image if the GMT |
92 |
| - projection syntax translates into a PROJ syntax, otherwise a plain |
93 |
| - tiff file is produced. (2) Any vector elements will be lost. |
94 | 79 | {frame}
|
95 | 80 | {cmap}
|
96 | 81 | img_in : str
|
@@ -172,6 +157,13 @@ def grdimage(self, grid, **kwargs):
|
172 | 157 | """
|
173 | 158 | kwargs = self._preprocess(**kwargs)
|
174 | 159 |
|
| 160 | + # Do not support -A option |
| 161 | + if any(kwargs.get(arg) is not None for arg in ["A", "img_out"]): |
| 162 | + raise GMTInvalidInput( |
| 163 | + "Parameter 'img_out'/'A' is not implemented. " |
| 164 | + "Please consider submitting a feature request to us." |
| 165 | + ) |
| 166 | + |
175 | 167 | with Session() as lib:
|
176 | 168 | with lib.virtualfile_from_data(
|
177 | 169 | check_kind="raster", data=grid
|
|
0 commit comments