I had the y coords of the rasterio window upside down. Following @arevill2's example, we now use the from_bounds command to give the physical coordinates of the rasterio window (instead of pixel values). This seems more robust since we rely on rasterio to get it right.
I also fixed an intermittent issue I saw with the window dataset being garbage collected before it could be plotted.
I had the y coords of the rasterio window upside down. Following @arevill2's example, we now use the
from_bounds
command to give the physical coordinates of the rasterio window (instead of pixel values). This seems more robust since we rely on rasterio to get it right.I also fixed an intermittent issue I saw with the window dataset being garbage collected before it could be plotted.