Skip to content

Commit 5712b7f

Browse files
Change test_grdfill.py to use static_earth_relief (#1743)
1 parent 0c95820 commit 5712b7f

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

pygmt/tests/test_grdfill.py

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
import pytest
88
import xarray as xr
99
from pygmt import grdfill, load_dataarray
10-
from pygmt.datasets import load_earth_relief
1110
from pygmt.exceptions import GMTInvalidInput
1211
from pygmt.helpers import GMTTempFile
12+
from pygmt.helpers.testing import load_static_earth_relief
1313

1414

1515
@pytest.fixture(scope="module", name="grid")
1616
def fixture_grid():
1717
"""
18-
Load the grid data from the sample earth_relief file and set value(s) to
19-
NaN.
18+
Load the grid data from the static_earth_relief file and set value(s) to
19+
NaN and inf.
2020
"""
21-
grid = load_earth_relief(registration="pixel", region=[125, 130, -25, -20])
22-
grid[2:4, 1:3] = np.nan
23-
grid[0:2, 2:4] = np.inf
21+
grid = load_static_earth_relief()
22+
grid[3:6, 3:5] = np.nan
23+
grid[6:8, 2:4] = np.inf
2424
return grid
2525

2626

@@ -31,15 +31,39 @@ def fixture_grid_result():
3131
"""
3232
return xr.DataArray(
3333
data=[
34-
[442.5, 439.0, np.inf, np.inf, 508.0],
35-
[393.0, 364.5, np.inf, np.inf, 506.5],
36-
[362.0, 20.0, 20.0, 373.5, 402.5],
37-
[321.5, 20.0, 20.0, 356.0, 422.5],
38-
[282.5, 318.0, 326.5, 379.5, 383.5],
34+
[347.5, 344.5, 386.0, 640.5, 617.0, 579.0, 646.5, 671.0],
35+
[383.0, 284.5, 344.5, 394.0, 491.0, 556.5, 578.5, 618.5],
36+
[373.0, 367.5, 349.0, 352.5, 419.5, 428.0, 570.0, 667.5],
37+
[557.0, 435.0, 385.5, 20.0, 20.0, 496.0, 519.5, 833.5],
38+
[561.5, 539.0, 446.5, 20.0, 20.0, 553.0, 726.5, 981.0],
39+
[310.0, 521.5, 757.0, 20.0, 20.0, 524.0, 686.5, 794.0],
40+
[521.5, 682.5, np.inf, np.inf, 571.5, 638.5, 739.5, 881.5],
41+
[308.0, 595.5, np.inf, np.inf, 580.0, 770.0, 927.0, 920.0],
42+
[601.0, 526.5, 535.0, 299.0, 398.5, 645.0, 797.5, 964.0],
43+
[494.5, 488.5, 357.0, 254.5, 286.0, 484.5, 653.5, 930.0],
44+
[450.5, 395.5, 366.0, 248.0, 250.0, 354.5, 550.0, 797.5],
45+
[345.5, 320.0, 335.0, 292.0, 207.5, 247.0, 325.0, 346.5],
46+
[349.0, 313.0, 325.5, 247.0, 191.0, 225.0, 260.0, 452.5],
47+
[347.5, 331.5, 309.0, 282.0, 190.0, 208.0, 299.5, 348.0],
3948
],
4049
coords=dict(
41-
lon=[125.5, 126.5, 127.5, 128.5, 129.5],
42-
lat=[-24.5, -23.5, -22.5, -21.5, -20.5],
50+
lon=[-54.5, -53.5, -52.5, -51.5, -50.5, -49.5, -48.5, -47.5],
51+
lat=[
52+
-23.5,
53+
-22.5,
54+
-21.5,
55+
-20.5,
56+
-19.5,
57+
-18.5,
58+
-17.5,
59+
-16.5,
60+
-15.5,
61+
-14.5,
62+
-13.5,
63+
-12.5,
64+
-11.5,
65+
-10.5,
66+
],
4367
),
4468
dims=["lat", "lon"],
4569
)

0 commit comments

Comments
 (0)