Skip to content Skip to sidebar Skip to footer

Regrid Netcdf Data To Finer Resolution In Python

I would like to downscale netcdf data from 0.5 degree to 0.25 (or lower) resolution by simply creating new finer resolution grid cells that have the same value as the coarser resol

Solution 1:

Note in the docs that you just need to supply the interp method with xout and yout, which are the new desired grids.

You've already done it corectly with a coarser grid (i.e. by incrementing the coordinates with a step of 4 degrees), now you just need to do the opposite by redefining lons_sub and lats_sub to be the grid spacing in 0.25 degree increments. Something like the following should work.

lats_fine = np.arange(lats[0], lats[-1], 0.25) # 0.25 degree fine grid
lons_fine = np.arange(lons[0], lons[-1], 0.25)
lons_sub, lats_sub = np.meshgrid(lons_fine, lats_fine)

Post a Comment for "Regrid Netcdf Data To Finer Resolution In Python"