I am new to xarray and confused at how I am supposed to construct Datasets and DataArrays. I have xyz point data and each point has 2 data values.
Below is my attempt to do this but I am receiving the error ValueError: Could not convert tuple of form (dims, data[, attrs, encoding]): ... to Variable.
I believe this is telling me that my point_data1 and point_data2 need to be 3 dimensional, but I am confused on how to do that in a way that makes sense for my use case.
import numpy as np
num_points = 20
point_locations = np.random.randint(99, size=(num_points, 3))
point_data1= np.ones(num_points)
point_data2 = np.random.randint(5, size=num_points)
ds = xr.Dataset({'point_data1': (['x', 'y', 'z'], point_data1 ),
'point_data2 ': (['x', 'y', 'z'], point_data2 )},
coords={'x': point_locations[:,0], 'y': point_locations[:,1], 'z': point_locations[:,2]})