Spatial resampling or sometimes we call it regridding and remapping, or even interpolation depending on whether we upscale or downscale grid cells, is something that we did quite often while dealing with large scale datasets.
If we want to use scipy, here are the functions I found relevant, but not good enough because they are disconnected from their geographic coordinates.
scipy.ndimage.map_coordinates
scipy.interpolate.RectBivariateSpline
I use the second one and found several issues. First, the latitude and longitude seems get wrong. While the other problem is more problematic. That is the boundary is wrong.
Another way to work around is using cdo remapgrid. CDO has a wrapper of SCRIP (Spherical Coordinate Remapping and Interpolation Package), which could be found on line (Los Alamos National Laboratory). I strongly recommend use this functionality of CDO, a powerful and fast tool based on Fortran. It has bilinear, bicubic, distance-weighted average, nearest neighbor, conservative (box-average), and largest area fraction interpolations.
I haven't really looked at gdal, but I guess it takes more time to figure out the commands from the unfriendly gdal manual...
No comments:
Post a Comment