I'm using xesmf v0.8.2
and get an error when trying to use Regridder(...method='conservative')
. The grid_in has 2D longitude and latitude coordinates. The lat and lon bounds should be computed in xesmf using cf.get_bounds()
, but this call is returning "No results found for 'longitude'" even though longitude
is a coordinate. Screenshot-2023-11-29-at-10.18.36-AM.png
Stephen Yeager has marked this topic as resolved.
Hi @Stephen Yeager I was thinking about this question the other day and wondering how you resolved it? I know in the past I've had to be careful about how to define bounds for conservative regridding with xesmf
.
I realized I had asked a similar question before that Deepak answered. The cf.get_bounds()
returns bounds that already exist, while cf.add_bounds
attempts to guess them. I continue to have a lot of difficulty using xesmf for conservative regridding when lon/lat are 2D arrays because Regridder does not know how to generate the lon_bnds/lat_bnds that should have dimension (ny+1,nx+1). Seems like that has to be done by hand before calling xesmf.
Yeah, that's sounding familiar with what I've encountered as well (creating the bounds beforehand). Good to know about 2D arrays. Thanks for clarifying!
Last updated: May 16 2025 at 17:14 UTC