-
I have a xarray dataset which looks like this:
And I have some lists of longitudes and latitudes such as:
If there is only a list, I can select data in dataset with this:
However there are probably hundreds of lists in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is really nothing inherently wrong with a for loop if it accomplishes what you need! The dataset in your example is quite small, but if you really are concerned with scalability here is some discussion that might be of interest https://discourse.pangeo.io/t/advice-for-scalable-raster-vector-extraction/4129/18
The answer here depends on what you ultimately want to do with your subsets of data. Do you just want summary statistics? The Xvec library provides an elegant approach if you convert your bboxes to a vector index of Polygons https://xvec.readthedocs.io/en/stable/zonal_stats.html. |
Beta Was this translation helpful? Give feedback.
There is really nothing inherently wrong with a for loop if it accomplishes what you need! The dataset in your example is quite small, but if you really are concerned with scalability here is some discussion that might be of interest https://discourse.pangeo.io/t/advice-for-scalable-raster-vector-extraction/4129/18
The answer here depends on what you ultimately want to do with your subsets of data. Do you just want summary statistics? The Xvec library provides an elegant approach if you convert you…