-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using xesmf to efficiently regrid data to another resolution including vertical dimension #268
Comments
A limited support for vertical regridding exists in ESMF and ESMpy, but it was sadly not yet implemented into xESMF. Note that ESMF only supports vertical coordinates given as a "radius". Not pressure levels, only distance from the earth center. From my own experience, the dimension mismatch is usually such that it doesn't matter if the vertical regridding is done afterwards (horizontal lengths are much greater than vertical ones). If this is reasonable in your workflow, I would suggest regridding the horizontal coordinates with xESMF and then interpolating the vertical one with |
Hi @aulemahal, Cheers |
xgcm specializes in vertical interpolation. What is your specific use case? |
@kevinrosa I have reanalysis files with a spatial and vertical resolution are L576x361_v72 and I want to have it as L288x192_v32, where the vertical dimension is by using hybrid level coefficients: p(i,j,k)= A_{k}*P_0 + B_{k}*P_{s}(i,j) |
You can perform this transformation in 2 general steps:
Maybe experiment with the order of these 2 steps to determine whether it's more efficient to do the horizontal or vertical step first. I don't understand the specifics of your hybrid level coordinates equation so I can't offer any xgcm advice but I'd suggest reading the linked documentation which has good examples and then possibly opening an issue in the xgcm repo if you're still struggling. |
@kevinrosa Thanks |
Greetings,
I found a very useful reference this website to use xesmf to regrid data to another resolution:
https://climate-cms.org/posts/2021-04-09-xesmf-regrid.html
Nevertheless, here it is also detailed to do it for horizontal coordinates (lat, lon).
ds_out = xe.util.grid_2d(-180.0, 180.0, 2.5, -90.0, 90.0, 2.5)
regridder = xe.Regridder(ds, ds_out, 'bilinear', periodic=True)
I was wondering if is possible do it for vertical coordinates (vertical levels) by specifying by an array the number and intervals?.
Thanks in advance
The text was updated successfully, but these errors were encountered: