Skip to content

Commit fb41536

Browse files
COrrect ot 'north-south' | change parameter name from 'direction' to 'component'
1 parent d139544 commit fb41536

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

pygmt/datasets/earth_deflection.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Function to download the IGPP Earth east-west and south-north deflection datasets from
2+
Function to download the IGPP Earth east-west and north-south deflection datasets from
33
the GMT data server, and load as :class:`xarray.DataArray`.
44
55
The grids are available in various resolutions.
@@ -20,18 +20,18 @@ def load_earth_deflection(
2020
] = "01d",
2121
region: Sequence[float] | str | None = None,
2222
registration: Literal["gridline", "pixel", None] = None,
23-
direction: Literal["east_west", "south_north"] = "east_west",
23+
direction: Literal["east", "north"] = "east",
2424
) -> xr.DataArray:
2525
r"""
26-
Load the IGPP Earth east-west and south-north deflection datasets in various
26+
Load the IGPP Earth east-west and north-south deflection datasets in various
2727
resolutions.
2828
2929
.. list-table::
3030
:widths: 50 50
3131
:header-rows: 1
3232
3333
* - IGPP Earth east-west deflection
34-
- IGPP Earth south-north deflection
34+
- IGPP Earth north-south deflection
3535
* - .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_edefl.jpg
3636
- .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_ndefl.jpg
3737
@@ -71,8 +71,8 @@ def load_earth_deflection(
7171
``"gridline"`` for gridline registration. Default is ``None``, means
7272
``"gridline"`` for all resolutions except ``"01m"`` which is ``"pixel"`` only.
7373
direction
74-
By default, the east-west deflection (``direction="east_west"``) is returned,
75-
``direction="south_north"`` to return the south-north deflection.
74+
By default, the east-west deflection (``direction="east"``) is returned,
75+
``direction="north"`` to return the north-south deflection.
7676
7777
Returns
7878
-------
@@ -97,16 +97,16 @@ def load_earth_deflection(
9797
>>> # load the default grid for east-west deflection (gridline-registered
9898
>>> # 1 arc-degree grid)
9999
>>> grid = load_earth_deflection()
100-
>>> # load the default grid for south-north deflection
101-
>>> grid = load_earth_deflection(direction="ndefl")
100+
>>> # load the default grid for north-south deflection
101+
>>> grid = load_earth_deflection(component="ndefl")
102102
>>> # load the 30 arc-minutes grid with "gridline" registration
103103
>>> grid = load_earth_deflection(resolution="30m", registration="gridline")
104104
>>> # load high-resolution (5 arc-minutes) grid for a specific region
105105
>>> grid = load_earth_deflection(
106106
... resolution="05m", region=[120, 160, 30, 60], registration="gridline"
107107
... )
108108
"""
109-
prefix = "earth_ndefl" if direction == "south_north" else "earth_edefl"
109+
prefix = "earth_ndefl" if direction == "north" else "earth_edefl"
110110
grid = _load_remote_dataset(
111111
name=prefix,
112112
prefix=prefix,

pygmt/datasets/load_remote_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class GMTRemoteDataset(NamedTuple):
296296
},
297297
),
298298
"earth_ndefl": GMTRemoteDataset(
299-
description="IGPP Earth south-north deflection",
299+
description="IGPP Earth north-south deflection",
300300
units="micro-radians",
301301
extra_attributes={"horizontal_datum": "WGS84"},
302302
resolutions={

pygmt/tests/test_datasets_earth_deflection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ def test_earth_edefl_01m_default_registration():
5757

5858
def test_earth_ndefl_01d():
5959
"""
60-
Test some properties of the Earth south-north deflection 01d data.
60+
Test some properties of the Earth north-south deflection 01d data.
6161
"""
62-
data = load_earth_deflection(resolution="01d", direction="south_north")
62+
data = load_earth_deflection(resolution="01d", component="north")
6363
assert data.name == "z"
6464
assert data.attrs["long_name"] == "ndefl (microradians)"
65-
assert data.attrs["description"] == "IGPP Earth south-north deflection"
65+
assert data.attrs["description"] == "IGPP Earth north-south deflection"
6666
assert data.attrs["units"] == "micro-radians"
6767
assert data.attrs["horizontal_datum"] == "WGS84"
6868
assert data.shape == (181, 361)
@@ -75,10 +75,10 @@ def test_earth_ndefl_01d():
7575

7676
def test_earth_ndefl_01d_with_region():
7777
"""
78-
Test loading low-resolution Earth south-north deflection with "region".
78+
Test loading low-resolution Earth north-south deflection with "region".
7979
"""
8080
data = load_earth_deflection(
81-
resolution="01d", region=[-10, 10, -5, 5], direction="south_north"
81+
resolution="01d", region=[-10, 10, -5, 5], component="north"
8282
)
8383
assert data.shape == (11, 21)
8484
assert data.gmt.registration == 0
@@ -94,7 +94,7 @@ def test_earth_ndefl_01m_default_registration():
9494
registration.
9595
"""
9696
data = load_earth_deflection(
97-
resolution="01m", region=[-10, -9, 3, 5], direction="south_north"
97+
resolution="01m", region=[-10, -9, 3, 5], component="north"
9898
)
9999
assert data.shape == (120, 60)
100100
assert data.gmt.registration == 1

0 commit comments

Comments
 (0)