I have a line of code that clips a Dataset from a larger xarray.core.dataset.Dataset
.
clipped = ds.rio.clip([user_polygon], crs=4326, all_touched=True)
I need to process many of these large datasets (NetCDF files) and this clip operation is time consuming. Is there a way to get the array indices so that I can access the data directly in subsequent extractions? Something like
coords = [(53, 1002), (53, 1003), (54, 1002), (54, 1003)]
clipped = ds[coords]
.clip
may not be the problem.