xcdat
xcdat copied to clipboard
[Enhancement]: Handle descending bounds with horizontal regridding
Is your feature request related to a problem?
We found that descending bounds ("out of order" bounds) can throw off results with xESMF's horizontal regridding. CDAT seemed to rectify bounds implicitly before performing the regridding.
Example with e3sm_diags and Hadley SST dataset:
v2.12.1 CDAT RMSE (weighted, bilinear): 1.476555924046852
v2.12.1 CDAT RMSE (weighted, conservative): 1.4764821102067773
v3.0.0 Xarray RMSE (weighted, bilinear): 1.4763235405423747
v3.0.0 Xarray RMSE (weighted normalized, conservative_normed): 1.7713504288524176
v3.0.0 Xarray RMSE (weighted normalized, conservative_normed, bnds fix): 1.4764820110242953
Related issues
- #338
- https://github.com/E3SM-Project/e3sm_diags/issues/945
- https://github.com/E3SM-Project/e3sm_diags/pull/940#issuecomment-2711274827
Describe the solution you'd like
- Check order of bounds
- If they are descending/out of order:
- Raise warning
- Rectify bounds by making them ascending order
- Perform regrid
Describe alternatives you've considered
No response
Additional context
No response