Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions pygmt/src/grdproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import xarray as xr
from pygmt._typing import PathLike
from pygmt.alias import AliasSystem
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_list, fmt_docstring, kwargs_to_strings, use_alias
Expand All @@ -17,18 +17,18 @@

@fmt_docstring
@use_alias(
C="center",
D="spacing",
E="dpi",
F="scaling",
I="inverse",
M="unit",
n="interpolation",
)
@kwargs_to_strings(C="sequence", D="sequence")
@kwargs_to_strings(D="sequence")
def grdproject(
grid: PathLike | xr.DataArray,
outgrid: PathLike | None = None,
center: Sequence[float | str] | bool = False,
projection: str | None = None,
region: Sequence[float | str] | str | None = None,
registration: Literal["gridline", "pixel"] | bool = False,
Expand Down Expand Up @@ -57,6 +57,7 @@ def grdproject(
Full GMT docs at :gmt-docs:`grdproject.html`.

{aliases}
- C = center
- J = projection
- R = region
- V = verbose
Expand All @@ -71,13 +72,12 @@ def grdproject(
[Default is ``False``].
{projection}
{region}
center : str or list
[*dx*, *dy*].
Let projected coordinates be relative to projection center [Default
is relative to lower left corner]. Optionally, add offsets in the
projected units to be added (or subtracted when ``inverse`` is set) to
(from) the projected coordinates, such as false eastings and
northings for particular projection zones [Default is ``[0, 0]``].
center
If ``True``, let the projected coordinates be relative to the projection center
[Default is relative to the lower left corner]. Optionally, set offsets
(*dx*, *dy*) in the projected units to be added (or subtracted when ``inverse``
is set) to (from) the projected coordinates, such as false eastings and
northings for particular projection zones [Default is ``(0, 0)``].
{spacing}
dpi : int
Set the resolution for the new grid in dots per inch.
Expand Down Expand Up @@ -120,7 +120,9 @@ def grdproject(
msg = "Parameter 'projection' must be specified."
raise GMTInvalidInput(msg)

aliasdict = AliasSystem().add_common(
aliasdict = AliasSystem(
C=Alias(center, name="center", sep="/", size=2),
).add_common(
J=projection,
R=region,
V=verbose,
Expand Down
Loading