Skip to content

Commit ca68016

Browse files
authored
load_earth_relief() now returns gridline-registrated grids by default in GMT 6.4 (#2052)
* pygmt.datasets.load_earth_relief() now returns gridline-registrated grids by default in GMT 6.4 * Add a note for GMT 6.3
1 parent cc276eb commit ca68016

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

pygmt/accessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class GMTDataArrayAccessor:
1515
1616
>>> from pygmt.datasets import load_earth_relief
1717
>>> # Use the global Earth relief grid with 1 degree spacing
18-
>>> grid = load_earth_relief(resolution="01d")
18+
>>> grid = load_earth_relief(resolution="01d", registration="pixel")
1919
2020
>>> # See if grid uses Gridline (0) or Pixel (1) registration
2121
>>> grid.gmt.registration

pygmt/clib/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def dataarray_to_matrix(grid):
4848
4949
>>> from pygmt.datasets import load_earth_relief
5050
>>> # Use the global Earth relief grid with 1 degree spacing
51-
>>> grid = load_earth_relief(resolution="01d")
51+
>>> grid = load_earth_relief(resolution="01d", registration="pixel")
5252
>>> matrix, region, inc = dataarray_to_matrix(grid)
5353
>>> print(region)
5454
[-180.0, 180.0, -90.0, 90.0]

pygmt/datasets/earth_relief.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,16 @@ def load_earth_relief(resolution="01d", region=None, registration=None, use_srtm
4646
registration : str
4747
Grid registration type. Either ``pixel`` for pixel registration or
4848
``gridline`` for gridline registration. Default is ``None``, where
49-
a pixel-registered grid is returned unless only the
50-
gridline-registered grid is available.
49+
a gridline-registered grid is returned unless only the pixel-registered
50+
grid is available.
51+
52+
**Note:** For GMT 6.3, ``registration=None`` returns a pixel-registered
53+
grid by default unless only the gridline-registered grid is available.
5154
5255
use_srtm : bool
5356
By default, the land-only SRTM tiles from NASA are used to generate the
5457
``'03s'`` and ``'01s'`` grids, and the missing ocean values are filled
55-
by up-sampling the SRTM15+V2.1 tiles which have a resolution of 15
58+
by up-sampling the SRTM15+ tiles which have a resolution of 15
5659
arc-second (i.e., ``'15s'``). If True, will only load the original
5760
land-only SRTM tiles.
5861
@@ -71,7 +74,7 @@ def load_earth_relief(resolution="01d", region=None, registration=None, use_srtm
7174
Examples
7275
--------
7376
74-
>>> # load the default grid (pixel-registered 01d grid)
77+
>>> # load the default grid (gridline-registered 01d grid)
7578
>>> grid = load_earth_relief()
7679
>>> # load the 30m grid with "gridline" registration
7780
>>> grid = load_earth_relief("30m", registration="gridline")

0 commit comments

Comments
 (0)