verde icon indicating copy to clipboard operation
verde copied to clipboard

Support xarray coordinates and data variables in verde.get_region

Open leouieda opened this issue 5 years ago • 0 comments

Description of the desired feature

The function uses np.min and np.max to get the bounding region of the given set of coordinates. This doesn't work if the coordinates are coming from xarray because the min and max functions return an array instead of a float. This causes non-obvious failures later on in the code when we try to use the region that came from this function.

To have this function behave properly for those inputs, it might need to check if the input or output has a .values attribute (identifying the xarray object or something like it) and use that instead of the variable. It could be done on the input or on the output (which might be the best option).

Are you willing to help implement and maintain this feature? Yes

leouieda avatar Dec 01 '20 17:12 leouieda