@@ -23,9 +23,11 @@ def load_earth_relief(resolution="01d", region=None, registration=None):
23
23
These grids can also be accessed by passing in the file name
24
24
**@earth_relief**\_\ *res*\[_\ *reg*] to any grid plotting/processing
25
25
function. *res* is the grid resolution (see below), and *reg* is grid
26
- registration type (**p** for pixel registration or *g* for gridline
27
- registration). Refer to :gmt-docs:`datasets/remote-data.html` for more
28
- details.
26
+ registration type (**p** for pixel registration or **g** for gridline
27
+ registration).
28
+
29
+ Refer to :gmt-docs:`datasets/remote-data.html#global-earth-relief-grids`
30
+ for more details.
29
31
30
32
Parameters
31
33
----------
@@ -37,8 +39,10 @@ def load_earth_relief(resolution="01d", region=None, registration=None):
37
39
or ``'01s'``.
38
40
39
41
region : str or list
40
- The subregion of the grid to load. Required for Earth relief grids with
41
- resolutions higher than 5 arc-minute (i.e., ``05m``).
42
+ The subregion of the grid to load, in the forms of a list
43
+ [*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
44
+ Required for Earth relief grids with resolutions higher than 5
45
+ arc-minute (i.e., ``05m``).
42
46
43
47
registration : str
44
48
Grid registration type. Either ``pixel`` for pixel registration or
@@ -81,7 +85,7 @@ def load_earth_relief(resolution="01d", region=None, registration=None):
81
85
reg = f"_{ registration [0 ]} " if registration else ""
82
86
else :
83
87
raise GMTInvalidInput (
84
- f"Invalid grid registration: { registration } , should be either "
88
+ f"Invalid grid registration: ' { registration } ' , should be either "
85
89
"'pixel', 'gridline' or None. Default is None, where a "
86
90
"pixel-registered grid is returned unless only the "
87
91
"gridline-registered grid is available."
@@ -90,6 +94,15 @@ def load_earth_relief(resolution="01d", region=None, registration=None):
90
94
if resolution not in non_tiled_resolutions + tiled_resolutions :
91
95
raise GMTInvalidInput (f"Invalid Earth relief resolution '{ resolution } '." )
92
96
97
+ # Check combination of resolution and registeration.
98
+ if (resolution == "15s" and registration == "gridline" ) or (
99
+ resolution in ("03s" , "01s" ) and registration == "pixel"
100
+ ):
101
+ raise GMTInvalidInput (
102
+ f"{ registration } -registered Earth relief data for "
103
+ f"resolution '{ resolution } ' is not supported."
104
+ )
105
+
93
106
# different ways to load tiled and non-tiled earth relief data
94
107
# Known issue: tiled grids don't support slice operation
95
108
# See https://github.com/GenericMappingTools/pygmt/issues/524
0 commit comments