You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, clisops will subset a dataset based on the lat/lon coordinate of the grid pixels, meaning that the center of the pixel needs to be inside the region to be kept. An option to instead keep all the pixels that touch the region would be very useful.
I realise that the buffer argument of subset_shape already serves that purpose, but it can be difficult to use effectively since the optimal value depends on model resolution. At minimum, however, a similar option should be included for subset_bbox too.
The text was updated successfully, but these errors were encountered:
That would necessitate the cell boundaries I believe. Similarly with xESMF, this is trivial to obtain for rectilinear grids, but not for curvilinear (rotated pole) ones. Would you be ok if this had the same conditions as in xESMF? i.e. : When touching = True, if lat and lon are 2D arrays and ds.cf.get_bounds fails, then the function fails.
I think so, but in that case we'd definitely need both buffer and touching for subset_shape and subset_bbox. This way, buffer could still be used for curvilinear grids.
Also, reading a little more on which features shapely has, I think that intersects or overlaps would be better terms than touches/touching.
object.intersects(other)
Returns True if the boundary or interior of the object intersect in any way with those of the other.
object.overlaps(other)
Returns True if the geometries have more than one but not all points in common, have the same dimension, and the intersection of the interiors of the geometries has the same dimension as the geometries themselves.
object.touches(other)
Returns True if the objects have at least one point in common and their interiors do not intersect with any part of the other.
RondeauG
changed the title
Add a 'touching' option to subset bbox and shape
Add a 'intersects' option to subset bbox and shape
Oct 12, 2022
Description
Currently,
clisops
will subset a dataset based on the lat/lon coordinate of the grid pixels, meaning that the center of the pixel needs to be inside the region to be kept. An option to instead keep all the pixels that touch the region would be very useful.I realise that the
buffer
argument ofsubset_shape
already serves that purpose, but it can be difficult to use effectively since the optimal value depends on model resolution. At minimum, however, a similar option should be included forsubset_bbox
too.The text was updated successfully, but these errors were encountered: