pygmt.grdpaste
- pygmt.grdpaste(grid1, grid2, outgrid=None, verbose=False, **kwargs)[source]
Join two grids along their common edge.
Combine
grid1andgrid2into a single grid by pasting them together along their common edge. The two input grids must have the same grid spacings and registration, and must have one edge in common. If in doubt, check withpygmt.grdinfoand usepygmt.grdcutand/orpygmt.grdsampleif necessary to prepare the edge joint. Note: For geographical grids, you may have to usecoltypesto handle periodic longitudes unless the input grids are properly recognized as such via their meta-data. For stitching multiple grids, seegrdblend(not implemented in PyGMT yet) instead.Full GMT docs at https://docs.generic-mapping-tools.org/6.6/grdpaste.html.
Aliases:
f = coltypes
G = outgrid
V = verbose
- Parameters:
grid2 (
str|PathLike|DataArray) –The two grids to be pasted. Accepts either file names or
xarray.DataArrayobjects.Notes:
Both grids must be of the same type—mixing a file name with an
xarray.DataArrayis not allowed.Passing two
xarray.DataArrayobjects requires GMT>6.6.0 due to an upstream GMT bug.
outgrid (
str|PathLike|None, default:None) – Name of the output netCDF grid file. If not specified, will return anxarray.DataArrayobject. For writing a specific grid file format or applying basic data operations to the output grid, see https://docs.generic-mapping-tools.org/6.6/gmt.html#grd-inout-full for the available modifiers.verbose (bool or str) – Select verbosity level [Full usage].
coltypes (str) – [i|o]colinfo. Specify data types of input and/or output columns (time or geographical data). Full documentation is at https://docs.generic-mapping-tools.org/6.6/gmt.html#f-full.
- Return type:
- Returns:
ret – Return type depends on whether the
outgridparameter is set:xarray.DataArrayifoutgridis not setNoneifoutgridis set (grid output will be stored in the file set byoutgrid)