Skip to content

Commit 6e80ed1

Browse files
committed
v1
1 parent de0eba8 commit 6e80ed1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

pygmt/src/xyz2grd.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@
1010

1111
__doctest_skip__ = ["xyz2grd"]
1212

13+
def _xyz2xyz(x=None, y=None, z=None):
14+
if x is not None:
15+
x = np.atleast_1d(x)
16+
if y is not None:
17+
y = np.atleast_1d(y)
18+
if z is not None:
19+
z = np.atleast_1d(z)
20+
21+
# Three 1-D arrays.
22+
if x.ndim == 1 and y.ndim == 1 and z.ndim == 1:
23+
pass
24+
# z is a 2-D array.
25+
if z.ndim == 2:
26+
if x is None:
27+
x = np.arange(z.shape[0])
28+
if y is None:
29+
y = np.arange(z.shape[1])
30+
return
31+
return x, y, z
32+
1333

1434
@fmt_docstring
1535
@use_alias(

0 commit comments

Comments
 (0)