Skip to content

Commit

Permalink
Merge branch 'main' into refactor/x2sys_cross
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed May 27, 2024
2 parents 6450ba0 + 14082d8 commit 29a7f9e
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 108 deletions.
16 changes: 6 additions & 10 deletions pygmt/datasets/earth_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_age"]


@kwargs_to_strings(region="sequence")
def load_earth_age(
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel"] = "gridline",
):
r"""
Expand Down Expand Up @@ -56,13 +55,10 @@ def load_earth_age(
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration.
Expand Down
16 changes: 6 additions & 10 deletions pygmt/datasets/earth_free_air_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_free_air_anomaly"]


@kwargs_to_strings(region="sequence")
def load_earth_free_air_anomaly(
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel", None] = None,
):
r"""
Expand Down Expand Up @@ -56,13 +55,10 @@ def load_earth_free_air_anomaly(
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``None``, means
Expand Down
16 changes: 6 additions & 10 deletions pygmt/datasets/earth_geoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_geoid"]


@kwargs_to_strings(region="sequence")
def load_earth_geoid(
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel"] = "gridline",
):
r"""
Expand Down Expand Up @@ -49,13 +48,10 @@ def load_earth_geoid(
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration.
Expand Down
17 changes: 6 additions & 11 deletions pygmt/datasets/earth_magnetic_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_magnetic_anomaly"]


@kwargs_to_strings(region="sequence")
def load_earth_magnetic_anomaly(
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m"
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel", None] = None,
data_source: Literal["emag2", "emag2_4km", "wdmam"] = "emag2",
):
Expand Down Expand Up @@ -70,20 +69,16 @@ def load_earth_magnetic_anomaly(
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes. The resolution ``"02m"`` is not available for
``data_source="wdmam"``.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``None``, means
``"gridline"`` for all resolutions except ``"02m"`` for
``data_source="emag2"`` or ``data_source="emag2_4km"``, which are
``"pixel"`` only.
data_source
Select the source of the magnetic anomaly data. Available options are:
Expand Down
13 changes: 5 additions & 8 deletions pygmt/datasets/earth_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_mask"]


@kwargs_to_strings(region="sequence")
def load_earth_mask(
resolution: Literal[
"01d",
Expand All @@ -30,7 +29,7 @@ def load_earth_mask(
"30s",
"15s",
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel"] = "gridline",
):
r"""
Expand Down Expand Up @@ -61,11 +60,9 @@ def load_earth_mask(
resolution
The grid resolution. The suffix ``d``, ``m``, and ``s`` stand for arc-degrees,
arc-minutes, and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code.
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration.
Expand Down
22 changes: 8 additions & 14 deletions pygmt/datasets/earth_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_relief"]


@kwargs_to_strings(region="sequence")
def load_earth_relief(
resolution: Literal[
"01d",
Expand All @@ -33,10 +32,10 @@ def load_earth_relief(
"03s",
"01s",
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel", None] = None,
data_source: Literal["igpp", "gebco", "gebcosi", "synbath"] = "igpp",
use_srtm=False,
use_srtm: bool = False,
):
r"""
Load the Earth relief datasets (topography and bathymetry) in various resolutions.
Expand Down Expand Up @@ -77,19 +76,15 @@ def load_earth_relief(
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes, and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for Earth relief grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``None``, means
``"gridline"`` for all resolutions except ``"15s"`` which is
``"pixel"`` only.
data_source
Select the source for the Earth relief data. Available options are:
Expand All @@ -102,8 +97,7 @@ def load_earth_relief(
inferred relief via altimetric gravity. See
:gmt-datasets:`earth-gebco.html`.
- ``"gebcosi"``: GEBCO Earth Relief that gives sub-ice (si) elevations.
use_srtm : bool
use_srtm
By default, the land-only SRTM tiles from NASA are used to generate the
``"03s"`` and ``"01s"`` grids, and the missing ocean values are filled
by up-sampling the SRTM15 tiles which have a resolution of 15
Expand Down
16 changes: 6 additions & 10 deletions pygmt/datasets/earth_vertical_gravity_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_vertical_gravity_gradient"]


@kwargs_to_strings(region="sequence")
def load_earth_vertical_gravity_gradient(
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel", None] = None,
):
r"""
Expand Down Expand Up @@ -56,13 +55,10 @@ def load_earth_vertical_gravity_gradient(
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Required for grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``None``, means
Expand Down
13 changes: 6 additions & 7 deletions pygmt/datasets/mars_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
The grids are available in various resolutions.
"""

from collections.abc import Sequence
from typing import Literal

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_mars_relief"]


@kwargs_to_strings(region="sequence")
def load_mars_relief(
resolution: Literal[
"01d",
Expand All @@ -31,7 +30,7 @@ def load_mars_relief(
"15s",
"12s",
] = "01d",
region=None,
region: Sequence[float] | str | None = None,
registration: Literal["gridline", "pixel", None] = None,
):
r"""
Expand Down Expand Up @@ -68,10 +67,10 @@ def load_mars_relief(
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*. Required for
grids with resolutions higher than 5 arc-minutes (i.e., ``"05m"``).
region
The subregion of the grid to load, in the form of a sequence [*xmin*, *xmax*,
*ymin*, *ymax*] or an ISO country code. Required for grids with resolutions
higher than 5 arc-minutes (i.e., ``"05m"``).
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``None``, means
Expand Down
Loading

0 comments on commit 29a7f9e

Please sign in to comment.