1
1
"""
2
- grdfill - Fill blank areas from a grid.
2
+ grdfill - Interpolate across holes in a grid.
3
3
"""
4
4
5
5
import xarray as xr
6
6
from pygmt .clib import Session
7
7
from pygmt .exceptions import GMTInvalidInput
8
- from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
8
+ from pygmt .helpers import (
9
+ build_arg_list ,
10
+ deprecate_parameter ,
11
+ fmt_docstring ,
12
+ kwargs_to_strings ,
13
+ use_alias ,
14
+ )
9
15
10
16
__doctest_skip__ = ["grdfill" ]
11
17
12
18
13
19
@fmt_docstring
14
- @use_alias (
15
- A = "mode" ,
16
- N = "no_data" ,
17
- R = "region" ,
18
- V = "verbose" ,
19
- )
20
+ # TODO(PyGMT>=0.19.0): Remove the deprecated 'no_data' parameter.
21
+ @deprecate_parameter ("no_data" , "hole" , "v0.15.0" , remove_version = "v0.19.0" )
22
+ @use_alias (A = "mode" , N = "hole" , R = "region" , V = "verbose" )
20
23
@kwargs_to_strings (R = "sequence" )
21
24
def grdfill (grid , outgrid : str | None = None , ** kwargs ) -> xr .DataArray | None :
22
25
r"""
23
- Fill blank areas from a grid file .
26
+ Interpolate across holes in a grid.
24
27
25
- Read a grid that presumably has unfilled holes that the user wants to
26
- fill in some fashion. Holes are identified by NaN values but this
27
- criteria can be changed via the ``no_data`` parameter. There are several
28
- different algorithms that can be used to replace the hole values.
28
+ Read a grid that presumably has unfilled holes that the user wants to fill in some
29
+ fashion. Holes are identified by NaN values but this criteria can be changed via the
30
+ ``hole`` parameter. There are several different algorithms that can be used to
31
+ replace the hole values. If no holes are found the original unchanged grid is
32
+ returned.
29
33
30
34
Full option list at :gmt-docs:`grdfill.html`
31
35
@@ -43,10 +47,9 @@ def grdfill(grid, outgrid: str | None = None, **kwargs) -> xr.DataArray | None:
43
47
where (*X,Y*) are the node dimensions of the grid]), or
44
48
**s** for bicubic spline (optionally append a *tension*
45
49
parameter [Default is no tension]).
46
- no_data : float
47
- Set the node value used to identify a point as a member of a hole
48
- [Default is NaN].
49
-
50
+ hole : float
51
+ Set the node value used to identify a point as a member of a hole [Default is
52
+ NaN].
50
53
{region}
51
54
{verbose}
52
55
0 commit comments