@@ -99,9 +99,9 @@ class Session:
99
99
Examples
100
100
--------
101
101
102
- >>> from pygmt.datasets import load_earth_relief
102
+ >>> from pygmt.helpers.testing import load_static_earth_relief
103
103
>>> from pygmt.helpers import GMTTempFile
104
- >>> grid = load_earth_relief ()
104
+ >>> grid = load_static_earth_relief ()
105
105
>>> type(grid)
106
106
<class 'xarray.core.dataarray.DataArray'>
107
107
>>> # Create a session and destroy it automatically when exiting the "with"
@@ -117,7 +117,7 @@ class Session:
117
117
... # Read the contents of the temp file before it's deleted.
118
118
... print(fout.read().strip())
119
119
...
120
- -180 180 -90 90 -8182 5651.5 1 1 360 180 1 1
120
+ -55 -47 -24 -10 190 981 1 1 8 14 1 1
121
121
"""
122
122
123
123
# The minimum version of GMT required
@@ -1295,17 +1295,17 @@ def virtualfile_from_grid(self, grid):
1295
1295
Examples
1296
1296
--------
1297
1297
1298
- >>> from pygmt.datasets import load_earth_relief
1298
+ >>> from pygmt.helpers.testing import load_static_earth_relief
1299
1299
>>> from pygmt.helpers import GMTTempFile
1300
- >>> data = load_earth_relief(resolution="01d" )
1300
+ >>> data = load_static_earth_relief( )
1301
1301
>>> print(data.shape)
1302
- (180, 360 )
1302
+ (14, 8 )
1303
1303
>>> print(data.lon.values.min(), data.lon.values.max())
1304
- -179 .5 179 .5
1304
+ -54 .5 -47 .5
1305
1305
>>> print(data.lat.values.min(), data.lat.values.max())
1306
- -89 .5 89 .5
1306
+ -23 .5 -10 .5
1307
1307
>>> print(data.values.min(), data.values.max())
1308
- -8182 .0 5651.5
1308
+ 190 .0 981.0
1309
1309
>>> with Session() as ses:
1310
1310
... with ses.virtualfile_from_grid(data) as fin:
1311
1311
... # Send the output to a file so that we can read it
@@ -1314,7 +1314,7 @@ def virtualfile_from_grid(self, grid):
1314
1314
... ses.call_module("grdinfo", args)
1315
1315
... print(fout.read().strip())
1316
1316
...
1317
- -180 180 -90 90 -8182 5651.5 1 1 360 180 1 1
1317
+ -55 -47 -24 -10 190 981 1 1 8 14 1 1
1318
1318
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows reg gtype
1319
1319
"""
1320
1320
_gtype = {0 : "GMT_GRID_IS_CARTESIAN" , 1 : "GMT_GRID_IS_GEO" }[grid .gmt .gtype ]
0 commit comments