Open greglucas opened 2 months ago
@karlwx I think it would be a little trickier because you need to transform vectors instead of just scalars, but it should in principle be doable. We do have a decorator that you could try playing around with to see whether it would work for your use-case and/or modifying it for the vector transform paths. https://github.com/SciTools/cartopy/blob/ea946a1d47e110d9274833d803eb068ab394c77c/lib/cartopy/mpl/geoaxes.py#L311 used in Contour here: https://github.com/SciTools/cartopy/blob/ea946a1d47e110d9274833d803eb068ab394c77c/lib/cartopy/mpl/geoaxes.py#L1572-L1574
Thanks @greglucas. Maybe an easier solution would be to add a keyword argument that would automatically thin the arrays of x, y, and data based on the number of data points within the map extent and the value of regrid_shape
before transforming?
Possibly, I'm not sure what that would look like though... Would you be able to do that yourself beforehand something like barbs(x[::3, ::3], y[::3, ::3], ...)
?
The regridding is located here if you want to dig in and try things out: https://github.com/SciTools/cartopy/blob/ea946a1d47e110d9274833d803eb068ab394c77c/lib/cartopy/vector_transform.py#L19
Would it be possible to implement something similar to #1291 with barbs? I am experiencing significant slowdowns with the barb transformation with high-resolution data. Appears I'm not the only one: https://stackoverflow.com/questions/71578820/use-transform-first-keyword-in-barbs
Originally posted by @karlwx in https://github.com/SciTools/cartopy/issues/1291#issuecomment-2140829116