0

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]
1
  • If anyone else has this problem, try timing your code. .clip may not be the problem.
    – John
    Commented Dec 4, 2023 at 0:16

0

Browse other questions tagged or ask your own question.