-1

I have a NetCDF obtained from a WRF simulation with a curvilinear grid with the following attributes:

  • points=48000 (250x192)
  • XLONG : -46.01144 to 42.05725 degree_east
  • XLAT : 24.87103 to 63.47381 degree_north
  • 20km of horizontal resolution

I want to create new coordinates for the same domain, but with a horizontal resolution of 5km. I would like to do it with xarray if it's possible.

  • Is your goal to create the dimension coordinates in xarray that are absent from your WRF dataset, or is it to regrid your existing data to a grid of reduced grid spacing? If it is the first, [this gist](https://gist.github.com/jthielen/8881d32d08d625c75c906a7e8ad7583f) may be helpful, otherwise, I suggest looking into [xesmf](https://xesmf.readthedocs.io/en/latest/) – Jon Thielen Aug 13 '19 at 18:44

1 Answers1

0

At present it seems difficult to deal with curvilinear grids with xarray (https://github.com/pydata/xarray/issues/2281)

But you can use cdo to transform your grid to a regular grid using cdo (http://gradsusr.org/pipermail/gradsusr/2014-February/036493.html)

And then you can actually regrid to any resolution you may want. You can follow the example at http://xarray.pydata.org/en/stable/interpolation.html#example to interpolate to a higher resolution.

Manmeet Singh
  • 405
  • 2
  • 11