diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 8c264f4f3e5..ea82c02383c 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -21,10 +21,10 @@ def basemap( self, projection: str | None = None, - zsize: float | str | None = None, zscale: float | str | None = None, - frame: str | Sequence[str] | bool = False, + zsize: float | str | None = None, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index e629303b17c..4912e0d8f27 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -46,9 +46,9 @@ def binstats( ] = "number", quantile_value: float = 50, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> xr.DataArray | None: diff --git a/pygmt/src/blockm.py b/pygmt/src/blockm.py index e4c5cadbba7..c3d55aafeb9 100644 --- a/pygmt/src/blockm.py +++ b/pygmt/src/blockm.py @@ -90,11 +90,11 @@ def blockmean( # noqa: PLR0913 outfile: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, outcols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> pd.DataFrame | np.ndarray | None: r""" diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 2c94a5403d4..028307a1a6d 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -28,13 +28,13 @@ def coast( # noqa: PLR0913 shorelines: bool | str | Sequence[int | str] = False, box: Box | bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, - transparency: float | None = None, perspective: float | Sequence[float] | str | bool = False, + transparency: float | None = None, **kwargs, ): r""" @@ -72,11 +72,7 @@ def coast( # noqa: PLR0913 Parameters ---------- - $projection - $region - *Required if this is the first plot command.* $area_thresh - $frame lakes : str or list *fill*\ [**+l**\|\ **+r**]. Set the shade, color, or pattern for lakes and river-lakes. The @@ -196,10 +192,14 @@ def coast( # noqa: PLR0913 to any of the continent codes (e.g. ``"=EU"`` for Europe). Append **+p**\ *pen* to draw polygon outlines [Default is no outline] and **+g**\ *fill* to fill them [Default is no fill]. + $projection + $region + *Required if this is the first plot command.* + $frame + $verbose $panel $perspective $transparency - $verbose Example ------- diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 3e7efb32984..74828d7dcef 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -21,10 +21,10 @@ def colorbar( # noqa: PLR0913 shading: float | Sequence[float] | bool = False, log: bool = False, scale: float | None = None, - projection: str | None = None, box: Box | bool = False, - frame: str | Sequence[str] | bool = False, + projection: str | None = None, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -72,8 +72,6 @@ def colorbar( # noqa: PLR0913 Parameters ---------- - frame : str or list - Set colorbar boundary frame, labels, and axes attributes. $cmap position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ @@ -138,6 +136,10 @@ def colorbar( # noqa: PLR0913 may be in plot distance units or given as relative fractions and will be automatically scaled so that the sum of the widths equals the requested colorbar length. + $projection + $region + frame : str or list + Set colorbar boundary frame, labels, and axes attributes. $verbose $panel $perspective diff --git a/pygmt/src/contour.py b/pygmt/src/contour.py index aa19b3c3584..03490a8ec5b 100644 --- a/pygmt/src/contour.py +++ b/pygmt/src/contour.py @@ -39,8 +39,8 @@ def contour( # noqa: PLR0913 z=None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -78,8 +78,6 @@ def contour( # noqa: PLR0913 $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - $projection - $region annotation : float, list, or str Specify or disable annotated contour levels, modifies annotated contours specified in ``levels``. @@ -90,7 +88,6 @@ def contour( # noqa: PLR0913 - Adjust the appearance by appending different modifiers, e.g., ``"annot_int+f10p+gred"`` gives annotations with a font size of 10 points and a red filled box. For all available modifiers see :gmt-docs:`contour.html#a`. - $frame levels : float, list, or str Specify the contour lines to generate. @@ -139,6 +136,9 @@ def contour( # noqa: PLR0913 to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. + $projection + $region + $frame $verbose $binary $panel diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index edad413c990..ba7b007181b 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -100,6 +100,7 @@ def filter1d( Indicate which column contains the independent variable (time). The left-most column is 0, while the right-most is (*n_cols* - 1) [Default is ``0``]. + $verbose Returns ------- diff --git a/pygmt/src/grd2cpt.py b/pygmt/src/grd2cpt.py index 964a25de64e..a2e439a1ae1 100644 --- a/pygmt/src/grd2cpt.py +++ b/pygmt/src/grd2cpt.py @@ -182,6 +182,7 @@ def grd2cpt( Produce a wrapped (cyclic) color table that endlessly repeats its range. Note that ``cyclic=True`` cannot be set together with ``categorical=True``. + $region $verbose Example diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index fe8b98d8060..cc67aaf6394 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -68,10 +68,6 @@ def grd2xyz( **f** to start at 1 (Fortran-style counting). Alternatively, append **i** to write just the two columns *index* and *z*, where *index* is the 1-D indexing that GMT uses when referring to grid nodes. - $region - Adding ``region`` will select a subsection of the grid. If this - subsection exceeds the boundaries of the grid, only the common region - will be output. weight : str [**a**\ [**+u**\ *unit*]\|\ *weight*]. Write out *x,y,z,w*\ , where *w* is the supplied *weight* (or 1 if not @@ -83,7 +79,6 @@ def grd2xyz( this by appending **+u**\ *unit*. For such grids, the area varies with latitude and also sees special cases for gridline-registered layouts at sides, corners, and poles. - $verbose convention : str [*flags*]. Write a 1-column ASCII [or binary] table. Output will be organized @@ -114,6 +109,11 @@ def grd2xyz( - **d**: 8-byte floating point double precision Default format is scanline orientation of ASCII numbers: **TLa**. + $region + Adding ``region`` will select a subsection of the grid. If this + subsection exceeds the boundaries of the grid, only the common region + will be output. + $verbose $binary $nodata $coltypes diff --git a/pygmt/src/grdclip.py b/pygmt/src/grdclip.py index 348c90c8740..ba3eda096c2 100644 --- a/pygmt/src/grdclip.py +++ b/pygmt/src/grdclip.py @@ -63,7 +63,6 @@ def grdclip( ---------- $grid $outgrid - $region above Pass a sequence of two values in the form of (*high*, *above*), to set all node values greater than *high* to *above*. @@ -81,6 +80,7 @@ def grdclip( (e.g., list of lists or 2-D numpy array) to replace different old values with different new values. This is mostly useful when your data are known to be integer values. + $region $verbose Returns diff --git a/pygmt/src/grdcontour.py b/pygmt/src/grdcontour.py index fada25fddc4..eba8c9f9cf1 100644 --- a/pygmt/src/grdcontour.py +++ b/pygmt/src/grdcontour.py @@ -39,8 +39,8 @@ def grdcontour( self, grid: PathLike | xr.DataArray, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -94,16 +94,12 @@ def grdcontour( Do not draw contours with less than `cut` number of points. resample : str or int Resample smoothing factor. - $projection - $region - $frame label_placement : str [**d**\|\ **f**\|\ **n**\|\ **l**\|\ **L**\|\ **x**\|\ **X**]\ *args*. Control the placement of labels along the quoted lines. It supports five controlling algorithms. See :gmt-docs:`grdcontour.html#g` for details. - $verbose pen : str or list [*type*]\ *pen*\ [**+c**\ [**l**\|\ **f**]]. *type*, if present, can be **a** for annotated contours or **c** for regular @@ -114,8 +110,6 @@ def grdcontour( contour lines are taken from the CPT (see ``levels``). If **+cf** is appended the colors from the CPT file are applied to the contour annotations. Select **+c** for both effects. - $panel - $coltypes label : str Add a legend entry for the contour being plotted. Normally, the annotated contour is selected for the legend. You can select the @@ -123,6 +117,12 @@ def grdcontour( to be of the format [*annotcontlabel*][/*contlabel*]. If either label contains a slash (/) character then use ``|`` as the separator for the two labels instead. + $projection + $region + $frame + $verbose + $panel + $coltypes $perspective $transparency diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 3b7bdfd9455..dd19c672cf4 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -60,8 +60,6 @@ def grdcut( or an image, so we need to specify the raster kind explicitly. The default is ``"grid"``. $outgrid - $projection - $region extend : bool or float Allow grid to be extended if new ``region`` exceeds existing boundaries. Give a value to initialize nodes outside current region. @@ -86,7 +84,8 @@ def grdcut( NaNs, append **+N** to strip off such columns before (optionally) considering the range of the core subset for further reduction of the area. - + $projection + $region $verbose $coltypes diff --git a/pygmt/src/grdfill.py b/pygmt/src/grdfill.py index 97248e8f6ff..81f940f6f76 100644 --- a/pygmt/src/grdfill.py +++ b/pygmt/src/grdfill.py @@ -160,8 +160,8 @@ def grdfill( # noqa: PLR0913 instead. The parameter will be removed in v0.19.0. $region - $coltypes $verbose + $coltypes Returns ------- diff --git a/pygmt/src/grdgradient.py b/pygmt/src/grdgradient.py index 2ee0c62c7b5..c643066030b 100644 --- a/pygmt/src/grdgradient.py +++ b/pygmt/src/grdgradient.py @@ -136,10 +136,10 @@ def grdgradient( grid output is not needed for this run then do not specify ``outgrid``. For subsequent runs, just use **r** to read these values. Using **R** will read then delete the statistics file. - $region slope_file : str Name of output grid file with scalar magnitudes of gradient vectors. Requires ``direction`` but makes ``outgrid`` optional. + $region $verbose $coltypes $interpolation diff --git a/pygmt/src/grdimage.py b/pygmt/src/grdimage.py index 563872fe775..bbdb9e62ed9 100644 --- a/pygmt/src/grdimage.py +++ b/pygmt/src/grdimage.py @@ -31,8 +31,8 @@ def grdimage( # noqa: PLR0913 monochrome: bool = False, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -89,7 +89,6 @@ def grdimage( # noqa: PLR0913 Parameters ---------- $grid - $frame $cmap img_in : str [**r**]. @@ -132,7 +131,6 @@ def grdimage( # noqa: PLR0913 suitable modifiers [Default is no illumination]. **Note**: If the input data represent an *image* then an *intensfile* or constant *intensity* must be provided. - $projection monochrome Force conversion to monochrome image using the (television) YIQ transformation. Cannot be used with ``nan_transparent``. @@ -146,7 +144,9 @@ def grdimage( # noqa: PLR0913 3). If the input is a grid, use **+z** to select another grid value than NaN. If input is instead an image, append an alternate *color* to select another pixel value to be transparent [Default is ``"black"``]. + $projection $region + $frame $verbose $panel $coltypes diff --git a/pygmt/src/grdinfo.py b/pygmt/src/grdinfo.py index 5f8a5db00fd..bb3f18dc577 100644 --- a/pygmt/src/grdinfo.py +++ b/pygmt/src/grdinfo.py @@ -51,7 +51,6 @@ def grdinfo( Parameters ---------- $grid - $region per_column : str or bool **n**\|\ **t**. Format the report using tab-separated fields on a single line. The @@ -114,6 +113,7 @@ def grdinfo( absolute value of the two extremes, append **+s**. We report the result via the text string *zmin/zmax* or *zmin/zmax/dz* (if *dz* was given) as expected by :func:`pygmt.makecpt`. + $region $verbose $coltypes diff --git a/pygmt/src/grdlandmask.py b/pygmt/src/grdlandmask.py index ca07a5a9993..b2a2d01bc68 100644 --- a/pygmt/src/grdlandmask.py +++ b/pygmt/src/grdlandmask.py @@ -30,9 +30,9 @@ def grdlandmask( "auto", "full", "high", "intermediate", "low", "crude", None ] = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, cores: int | bool = False, **kwargs, ) -> xr.DataArray | None: @@ -61,7 +61,6 @@ def grdlandmask( ---------- $outgrid $spacing - $region $area_thresh resolution Select the resolution of the coastline dataset to use. The available resolutions @@ -95,6 +94,7 @@ def grdlandmask( Values can be any number, or one of ``None``, ``"NaN"``, and ``np.nan`` for setting nodes to NaN. + $region $verbose $registration $cores diff --git a/pygmt/src/grdproject.py b/pygmt/src/grdproject.py index eb2b66e1f9a..e903cf38224 100644 --- a/pygmt/src/grdproject.py +++ b/pygmt/src/grdproject.py @@ -24,9 +24,9 @@ def grdproject( spacing: float | str | Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -64,8 +64,6 @@ def grdproject( inverse : bool When set to ``True`` transforms grid from rectangular to geographical [Default is ``False``]. - $projection - $region center If ``True``, let the projected coordinates be relative to the projection center [Default is relative to the lower left corner]. Optionally, set offsets @@ -87,6 +85,8 @@ def grdproject( Append **c**, **i**, or **p** to indicate that centimeters, inches, or points should be the projected measure unit. Cannot be used with ``scaling``. + $projection + $region $verbose $interpolation $registration diff --git a/pygmt/src/grdsample.py b/pygmt/src/grdsample.py index b50d68369e2..1e7db9c3f59 100644 --- a/pygmt/src/grdsample.py +++ b/pygmt/src/grdsample.py @@ -30,9 +30,9 @@ def grdsample( toggle: bool = False, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, cores: int | bool = False, **kwargs, ) -> xr.DataArray | None: @@ -66,12 +66,12 @@ def grdsample( $grid $outgrid $spacing - $region toggle Toggle between grid and pixel registration; if the input is grid-registered, the output will be pixel-registered and vice-versa. This is a *destructive* grid change; see :gmt-docs:`reference/options.html#switch-registrations`. *Note**: ``toggle`` and ``registration`` are mutually exclusive. + $region $verbose $coltypes $interpolation diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index 236cff1da8e..554eaf419fe 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -197,7 +197,6 @@ def grdtrack( nearest distance nodes along the cross-profiles. We write 13 output columns per track: *dist, lonc, latc, distc, azimuthc, zc, lonl, latl, distl, lonr, latr, distr, width*. - $region no_skip : bool Do *not* skip points that fall outside the domain of the grid(s) [Default only output points within the grid domain]. @@ -255,9 +254,10 @@ def grdtrack( spherical degrees. Use *radius* to change the unit and give *radius* = 0 if you do not want to limit the radius search. To instead replace the input point with the coordinates of the nearest node, append **+p**. - $verbose z_only : bool Only write out the sampled z-values [Default writes all columns]. + $region + $verbose $aspatial $binary $nodata diff --git a/pygmt/src/grdview.py b/pygmt/src/grdview.py index ebf820508fb..aa6a1f5d74a 100644 --- a/pygmt/src/grdview.py +++ b/pygmt/src/grdview.py @@ -40,8 +40,8 @@ def grdview( # noqa: PLR0913 projection: str | None = None, zscale: float | str | None = None, zsize: float | str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -78,15 +78,6 @@ def grdview( # noqa: PLR0913 Parameters ---------- $grid - region : str or list - *xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*]. - Specify the :doc:`region ` of interest. When used - with ``perspective``, optionally append */zmin/zmax* to indicate the range to - use for the 3-D axes [Default is the region given by the input grid]. - $projection - zscale/zsize - Set z-axis scaling or z-axis size. - $frame cmap : str The name of the color palette table to use. drape_grid : str or :class:`xarray.DataArray` @@ -133,6 +124,15 @@ def grdview( # noqa: PLR0913 **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments for that function, or just give **+d** to select the default arguments [Default is ``"+a-45+nt1+m0"``]. + $projection + zscale/zsize + Set z-axis scaling or z-axis size. + region : str or list + *xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*]. + Specify the :doc:`region ` of interest. When used + with ``perspective``, optionally append */zmin/zmax* to indicate the range to + use for the 3-D axes [Default is the region given by the input grid]. + $frame $verbose $panel $coltypes diff --git a/pygmt/src/histogram.py b/pygmt/src/histogram.py index f1aa068a484..3a72577f415 100644 --- a/pygmt/src/histogram.py +++ b/pygmt/src/histogram.py @@ -45,8 +45,8 @@ def histogram( self, data: PathLike | TableLike, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -75,9 +75,6 @@ def histogram( data Pass in either a file name to an ASCII data table, a Python list, a 2-D $table_classes. - $projection - $region - $frame $cmap fill : str Set color or pattern for filling bars [Default is no fill]. @@ -146,6 +143,9 @@ def histogram( To use weights provided as a second data column instead of pure counts, append **+w**. + $projection + $region + $frame $verbose $binary $nodata diff --git a/pygmt/src/info.py b/pygmt/src/info.py index d12f409fcfa..dcb50bc4b60 100644 --- a/pygmt/src/info.py +++ b/pygmt/src/info.py @@ -22,9 +22,9 @@ def info( data: PathLike | TableLike, spacing: Sequence[float] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> np.ndarray | str: @@ -70,7 +70,6 @@ def info( **dz**\[\ **+c**\ *col*]. Report the min/max of the first (0'th) column to the nearest multiple of dz and output this in the form ``[zmin, zmax, dz]``. - $verbose $aspatial $incols diff --git a/pygmt/src/makecpt.py b/pygmt/src/makecpt.py index b2c36405840..793c5d302aa 100644 --- a/pygmt/src/makecpt.py +++ b/pygmt/src/makecpt.py @@ -157,7 +157,6 @@ def makecpt( continuous Force a continuous CPT when building from a list of colors and a list of z-values [Default is False, i.e. discrete CPT]. - $verbose categorical : bool Do not interpolate the input color table but pick the output colors starting at the beginning of the color table, until colors for all @@ -167,6 +166,7 @@ def makecpt( Produce a wrapped (cyclic) color table that endlessly repeats its range. Note that ``cyclic=True`` cannot be set together with ``categorical=True``. + $verbose """ if kwargs.get("W") is not None and kwargs.get("Ww") is not None: msg = "Set only categorical or cyclic to True, not both." diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 10d3ec07c4e..d28e96a6eac 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -147,8 +147,8 @@ def meca( # noqa: PLR0913 event_name: str | Sequence[str] | None = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 0b9827ce926..bf555937498 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -36,10 +36,10 @@ def nearneighbor( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -93,11 +93,7 @@ def nearneighbor( $table_classes. x/y/z : 1-D arrays Arrays of x and y coordinates and values z of the data points. - $spacing - - $region - search_radius : str Set the search radius that determines which data points are considered close to a node. @@ -118,7 +114,7 @@ def nearneighbor( sector enters into the averaging; the more distant points are ignored. Alternatively, use ``sectors="n"`` to call GDAL's nearest neighbor algorithm instead. - + $region $verbose $aspatial $binary diff --git a/pygmt/src/plot.py b/pygmt/src/plot.py index f7c92bebc6e..de033dd3da2 100644 --- a/pygmt/src/plot.py +++ b/pygmt/src/plot.py @@ -52,8 +52,8 @@ def plot( # noqa: PLR0912, PLR0913 direction=None, straight_line: bool | Literal["x", "y"] = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -116,8 +116,6 @@ def plot( # noqa: PLR0912, PLR0913 should be a list of two 1-D arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen. - $projection - $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -141,7 +139,6 @@ def plot( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - $frame $cmap offset : str *dx*/*dy*. @@ -210,7 +207,6 @@ def plot( # noqa: PLR0912, PLR0913 Plot symbols (including vectors, pie slices, fronts, decorated or quoted lines). $pen - $verbose zvalue : str *value*\|\ *file*. Instead of specifying a symbol or polygon fill and outline color @@ -220,6 +216,10 @@ def plot( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. + $projection + $region + $frame + $verbose $aspatial $binary $panel diff --git a/pygmt/src/plot3d.py b/pygmt/src/plot3d.py index d4ce2940488..1292cb339f1 100644 --- a/pygmt/src/plot3d.py +++ b/pygmt/src/plot3d.py @@ -54,8 +54,8 @@ def plot3d( # noqa: PLR0912, PLR0913 projection: str | None = None, zscale: float | str | None = None, zsize: float | str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -119,10 +119,6 @@ def plot3d( # noqa: PLR0912, PLR0913 should be a list of two 1-D arrays with the vector directions. These can be angle and length, azimuth and length, or x and y components, depending on the style options chosen. - $projection - zscale/zsize - Set z-axis scaling or z-axis size. - $region straight_line By default, line segments are drawn as straight lines in the Cartesian and polar coordinate systems, and as great circle arcs (by resampling coarse input data @@ -148,7 +144,6 @@ def plot3d( # noqa: PLR0912, PLR0913 meaning of *x* and *y* is reversed, i.e., *x* means meridians and *y* means parallels. The bug is fixed by upstream `PR #8648 `__. - $frame $cmap offset : str *dx*/*dy*\ [/*dz*]. @@ -189,7 +184,6 @@ def plot3d( # noqa: PLR0912, PLR0913 the foreground are plotted after items in the background. style : str Plot symbols. Full documentation is at :gmt-docs:`plot3d.html#s`. - $verbose $pen zvalue : str *value*\|\ *file*. @@ -200,6 +194,12 @@ def plot3d( # noqa: PLR0912, PLR0913 polygon in the input data. To apply it to the fill color, use ``fill="+z"``. To apply it to the pen color, append **+z** to ``pen``. + $projection + zscale/zsize + Set z-axis scaling or z-axis size. + $region + $frame + $verbose $aspatial $binary $panel diff --git a/pygmt/src/rose.py b/pygmt/src/rose.py index 14edc5183a0..3896a7b671f 100644 --- a/pygmt/src/rose.py +++ b/pygmt/src/rose.py @@ -39,8 +39,8 @@ def rose( # noqa: PLR0913 data: PathLike | TableLike | None = None, length=None, azimuth=None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -87,14 +87,6 @@ def rose( # noqa: PLR0913 length/azimuth : float or 1-D arrays Length and azimuth values, or arrays of length and azimuth values. - - orientation : bool - Specify that the input data are orientation data (i.e., have a - 180 degree ambiguity) instead of true 0-360 degree directions - [Default is 0-360 degrees]. We compensate by counting each record - twice: First as azimuth and second as azimuth +180. Ignored if - ``region`` is given as (-90, 90) or (0, 180). - region : str or list *r0/r1/az0/az1* or [*r0*, *r1*, *az0*, *az1*]. *Required if this is the first plot command*. @@ -102,6 +94,18 @@ def rose( # noqa: PLR0913 Here, *r0* is 0 and *r1* is the maximal length in units. For *az0* and *az1*, specify either (-90, 90) or (0, 180) for half circle plot or (0, 360) for full circle. + frame : str + Set map boundary frame and axes attributes. Remember that *x* + here is radial distance and *y* is azimuth. The y label may be + used to plot a figure caption. The scale bar length is determined + by the radial gridline spacing. + + orientation : bool + Specify that the input data are orientation data (i.e., have a + 180 degree ambiguity) instead of true 0-360 degree directions + [Default is 0-360 degrees]. We compensate by counting each record + twice: First as azimuth and second as azimuth +180. Ignored if + ``region`` is given as (-90, 90) or (0, 180). diameter : str Set the diameter of the rose diagram. If not given, @@ -117,12 +121,6 @@ def rose( # noqa: PLR0913 by the largest value so all radii (or bin counts) range from 0 to 1. - frame : str - Set map boundary frame and axes attributes. Remember that *x* - here is radial distance and *y* is azimuth. The y label may be - used to plot a figure caption. The scale bar length is determined - by the radial gridline spacing. - scale : float or str Multiply the data radii by scale. E.g., use ``scale=0.001`` to convert your data from m to km. To exclude the radii from diff --git a/pygmt/src/select.py b/pygmt/src/select.py index b9f3168f034..d6476bef358 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -148,7 +148,6 @@ def select( (and ``area_thresh``, ``resolution``). - **z** select records NOT within the range specified by ``z_subregion``. - $projection mask_values : str or list Pass all records whose location is inside specified geographical features. Specify if records should be skipped (s) or kept (k) using 1 of 2 formats: @@ -166,8 +165,6 @@ def select( the coastlines differ in details, a node in a mask file using one resolution is not guaranteed to remain inside [or outside] when a different resolution is selected. If ``None``, the low resolution is used by default. - $region - $verbose z_subregion : str or list *min*\ [/*max*]\ [**+a**]\ [**+c**\ *col*]\ [**+i**]. Pass all records whose 3rd column (*z*; *col* = 2) lies within the @@ -187,6 +184,9 @@ def select( and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. + $projection + $region + $verbose $binary $nodata $find diff --git a/pygmt/src/solar.py b/pygmt/src/solar.py index 7669153e66f..79ab879aef1 100644 --- a/pygmt/src/solar.py +++ b/pygmt/src/solar.py @@ -22,8 +22,8 @@ def solar( # noqa: PLR0913 fill: str | None = None, pen: str | None = None, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -74,13 +74,13 @@ def solar( # noqa: PLR0913 integer number of hours (e.g., -8 or +5); fractional hours are truncated towards zero (e.g., -8.5 becomes -8 and +5.5 becomes +5). [Default is the current UTC date and time]. - $region - $projection - $frame fill Set color or pattern for filling terminators [Default is no fill]. pen Set pen attributes for lines [Default is ``"0.25p,black,solid"``]. + $projection + $region + $frame $verbose $panel $perspective diff --git a/pygmt/src/sph2grd.py b/pygmt/src/sph2grd.py index 8a210657645..783c8589f06 100644 --- a/pygmt/src/sph2grd.py +++ b/pygmt/src/sph2grd.py @@ -21,10 +21,10 @@ def sph2grd( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, incols: int | str | Sequence[int | str] | None = None, + registration: Literal["gridline", "pixel"] | bool = False, cores: int | bool = False, **kwargs, ) -> xr.DataArray | None: diff --git a/pygmt/src/sphdistance.py b/pygmt/src/sphdistance.py index 6d4af6c46ec..7adca4d010b 100644 --- a/pygmt/src/sphdistance.py +++ b/pygmt/src/sphdistance.py @@ -61,8 +61,6 @@ def sphdistance( Arrays of x and y coordinates. $outgrid $spacing - $region - $verbose single_form : bool For large data sets you can save some memory (at the expense of more processing) by only storing one form of location coordinates @@ -98,6 +96,8 @@ def sphdistance( voronoi : str Append the name of a file with pre-calculated Voronoi polygons [Default performs the Voronoi construction on input data]. + $region + $verbose Returns ------- diff --git a/pygmt/src/subplot.py b/pygmt/src/subplot.py index 0ef2ed37e34..d0b1249ec63 100644 --- a/pygmt/src/subplot.py +++ b/pygmt/src/subplot.py @@ -30,8 +30,8 @@ def subplot( margins: float | str | Sequence[float | str] | None = None, title: str | None = None, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, **kwargs, diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index 99ff9de80e1..416dcc2ff57 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -39,9 +39,9 @@ def surface( outgrid: PathLike | None = None, spacing: Sequence[float | str] | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -92,8 +92,6 @@ def surface( Arrays of x and y coordinates and values z of the data points. $spacing - - $region $outgrid convergence : float Optional. Convergence limit. Iteration is assumed to have converged @@ -139,6 +137,7 @@ def surface( set boundary tension. If you do not prepend **i** or **b**, both will be set to the same value. [Default is 0 for both and gives minimum curvature solution.] + $region $verbose $aspatial $binary diff --git a/pygmt/src/ternary.py b/pygmt/src/ternary.py index 9f2adc41051..038d419bb1f 100644 --- a/pygmt/src/ternary.py +++ b/pygmt/src/ternary.py @@ -19,8 +19,8 @@ def ternary( # noqa: PLR0913 alabel: str | None = None, blabel: str | None = None, clabel: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -65,6 +65,7 @@ def ternary( # noqa: PLR0913 [*amin*, *amax*, *bmin*, *bmax*, *cmin*, *cmax*]. Give the min and max limits for each of the three axes **a**, **b**, and **c**. + $frame $cmap $fill alabel diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 156dd616a92..2487e4f4630 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -46,8 +46,8 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 justify: bool | None | AnchorCode | Sequence[AnchorCode] = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -133,9 +133,6 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 e.g., **BL** for Bottom Left. If no justification is explicitly given (i.e. ``justify=True``), then the input to ``textfiles`` must have this as a column. - $projection - $region - *Required if this is the first plot command.* clearance : str [*dx/dy*][**+to**\|\ **O**\|\ **c**\|\ **C**]. Adjust the clearance between the text and the surrounding box @@ -167,6 +164,10 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 (see ``clearance``) [Default is ``"0.25p,black,solid"``]. no_clip Do **not** clip text at the frame boundaries [Default is ``False``]. + $projection + $region + *Required if this is the first plot command.* + $frame $verbose $aspatial $panel diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index 0fb5eeb003d..0f6277284c5 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -68,11 +68,11 @@ def regular_grid( # noqa: PLR0913 spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal[ "quiet", "error", "warning", "timing", "info", "compat", "debug" ] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, incols: int | str | Sequence[int | str] | None = None, **kwargs, ) -> xr.DataArray | None: @@ -115,8 +115,6 @@ def regular_grid( # noqa: PLR0913 Pass in (x, y[, z]) or (longitude, latitude[, elevation]) values by providing a file name to an ASCII data table, a 2-D $table_classes. - $projection - $region $spacing $outgrid The interpolation is performed in the original coordinates, so if @@ -124,6 +122,8 @@ def regular_grid( # noqa: PLR0913 all data to a local coordinate system before using ``triangulate`` (this is true of all gridding routines) or instead select :gmt-docs:`sphtriangulate `. + $projection + $region $verbose $binary $nodata diff --git a/pygmt/src/velo.py b/pygmt/src/velo.py index 343b600b60c..ec2dd8b0557 100644 --- a/pygmt/src/velo.py +++ b/pygmt/src/velo.py @@ -39,8 +39,8 @@ def velo( # noqa : PLR0913 data: PathLike | TableLike | None = None, no_clip: bool = False, projection: str | None = None, - frame: str | Sequence[str] | bool = False, region: Sequence[float | str] | str | None = None, + frame: str | Sequence[str] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, panel: int | Sequence[int] | bool = False, @@ -173,14 +173,11 @@ def velo( # noqa : PLR0913 with extension taken positive. - **5**: azimuth of eps2 in degrees CW from North. - $projection - $region vector : bool or str Modify vector parameters. For vector heads, append vector head *size* [Default is 9p]. See :gmt-docs:`supplements/geodesy/velo.html#vector-attributes` for specifying additional attributes. - $frame $cmap rescale : str Can be used to rescale the uncertainties of velocities (``spec="e"`` @@ -227,7 +224,6 @@ def velo( # noqa : PLR0913 no_clip Do **not** skip symbols that fall outside the frame boundaries [Default is ``False``, i.e., plot symbols inside the frame boundaries only]. - $verbose pen : str [*pen*][**+c**\ [**f**\|\ **l**]]. Set pen attributes for velocity arrows, ellipse circumference and fault @@ -245,6 +241,10 @@ def velo( # noqa : PLR0913 required columns). To instead use the corresponding error estimates (i.e., vector or rotation uncertainty) to lookup the color and paint the error ellipse or wedge instead, append **+e**. + $projection + $region + $frame + $verbose $panel $nodata $find diff --git a/pygmt/src/wiggle.py b/pygmt/src/wiggle.py index 66007fe5de5..dd450048bf3 100644 --- a/pygmt/src/wiggle.py +++ b/pygmt/src/wiggle.py @@ -107,14 +107,11 @@ def wiggle( # noqa: PLR0913 $table_classes. Use parameter ``incols`` to choose which columns are x, y, z, respectively. - $projection - $region scale : str or float Give anomaly scale in data-units/distance-unit. Append **c**, **i**, or **p** to indicate the distance unit (centimeters, inches, or points); if no unit is given we use the default unit that is controlled by :gmt-term:`PROJ_LENGTH_UNIT`. - $frame position : str [**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\ **+w**\ *length*\ [**+j**\ *justify*]\ [**+al**\|\ **r**]\ @@ -127,9 +124,12 @@ def wiggle( # noqa: PLR0913 track : str Draw track [Default is no track]. Append pen attributes to use [Default is ``"0.25p,black,solid"``]. - $verbose pen : str Specify outline pen attributes [Default is no outline]. + $projection + $region + $frame + $verbose $binary $panel $nodata diff --git a/pygmt/src/x2sys_cross.py b/pygmt/src/x2sys_cross.py index 870db3c7d7d..7710663996d 100644 --- a/pygmt/src/x2sys_cross.py +++ b/pygmt/src/x2sys_cross.py @@ -161,8 +161,6 @@ def x2sys_cross( Use **e** for external COEs only, and **i** for internal COEs only [Default is all COEs]. - $region - speed : str or list **l**\|\ **u**\|\ **h**\ *speed*. Defines window of track speeds. If speeds are outside this window we do @@ -178,8 +176,6 @@ def x2sys_cross( speed of 0, upper speed of 10, and disable heading calculations for speeds below 5. - $verbose - numpoints : int Give the maximum number of data points on either side of the crossover to use in the spline interpolation [Default is 3]. @@ -188,6 +184,9 @@ def x2sys_cross( Report the values of each track at the crossover [Default reports the crossover value and the mean value]. + $region + $verbose + Returns ------- crossover_errors diff --git a/pygmt/src/x2sys_init.py b/pygmt/src/x2sys_init.py index a7ff867fa55..1abba77d350 100644 --- a/pygmt/src/x2sys_init.py +++ b/pygmt/src/x2sys_init.py @@ -106,9 +106,6 @@ def x2sys_init( [Default is ``units=["dk", "se"]`` (km and m/s) if ``discontinuity`` is set, and ``units=["dc", "sc"]`` otherwise (e.g., for Cartesian units)]. - $region - $verbose - gap : str or list **t**\|\ **d**\ *gap*. Give **t** or **d** and append the corresponding maximum time gap (in @@ -118,6 +115,8 @@ def x2sys_init( If these limits are exceeded then a data gap is assumed and no COE will be determined. + $region + $verbose $distcalc """ aliasdict = AliasSystem( diff --git a/pygmt/src/xyz2grd.py b/pygmt/src/xyz2grd.py index ab1f9f59b10..2325b712508 100644 --- a/pygmt/src/xyz2grd.py +++ b/pygmt/src/xyz2grd.py @@ -36,9 +36,9 @@ def xyz2grd( spacing: Sequence[float | str] | None = None, projection: str | None = None, region: Sequence[float | str] | str | None = None, - registration: Literal["gridline", "pixel"] | bool = False, verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"] | bool = False, + registration: Literal["gridline", "pixel"] | bool = False, **kwargs, ) -> xr.DataArray | None: r""" @@ -83,9 +83,6 @@ def xyz2grd( *x* and *y* as *z* is not consulted). Append **z** to sum multiple values that belong to the same node. $spacing - $projection - $region - $verbose convention : str [*flags*]. Read a 1-column ASCII [or binary] table. This assumes that all the @@ -126,6 +123,9 @@ def xyz2grd( each input record to have a single value, while the former can handle multiple values per record but can only parse regular floating point values. Translate incoming *z*-values via the ``incols`` parameter. + $projection + $region + $verbose $binary $nodata $find