I want to clip a multidimensional array with points (shapefile). The points are specific events and have a lat, lon and time value. I lcreate from the columns of the shapefile: lat, lon and time a list (for each), to then in a next step select/clip with these lists the multidimensional array (using the function xarray .sel):
lons = pts.geometry.x.to_list()
lats = pts.geometry.y.to_list()
time = pts.time.to_list()
values_pts = 3D_array.sel(lon=lons, lat=lats, time=time, method="nearest")
With this split of the lat, lon, time to separated lists, they lose their relation to one another, which means that all points are cut out for each timestep and not for the specific dates they occured .. Do you have any ideas how I could clip the lat and lon at the specific timesteps in a 3D array?