Skip to content

Commit 54b8390

Browse files
committed
Fix the spacing parameter and check required parameters in xyz2grd
1 parent fc352ca commit 54b8390

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pygmt/src/xyz2grd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
r="registration",
3131
w="wrap",
3232
)
33-
@kwargs_to_strings(R="sequence")
33+
@kwargs_to_strings(I="sequence", R="sequence")
3434
def xyz2grd(data=None, x=None, y=None, z=None, **kwargs):
3535
r"""
3636
Create a grid file from table data.
@@ -132,6 +132,9 @@ def xyz2grd(data=None, x=None, y=None, z=None, **kwargs):
132132
- None if ``outgrid`` is set (grid output will be stored in file set by
133133
``outgrid``)
134134
"""
135+
if "I" not in kwargs or "R" not in kwargs:
136+
raise GMTInvalidInput("Both 'region' and 'spacing' must be specified.")
137+
135138
with GMTTempFile(suffix=".nc") as tmpfile:
136139
with Session() as lib:
137140
file_context = lib.virtualfile_from_data(

0 commit comments

Comments
 (0)