I’m attempting to rasterize a NetCDF dataset that contains data on a curvilinear grid. The dataset has a 2D matrix of longitudes, a 2D matrix of latitudes, and several 2D matrices of data variables. I am currently using Python.
I have already succeeded in created a WGS84 grid using
scipy.interpolate.griddata()with the three arrays flattened using
numpy.ndarray.ravel(), and then writing to raster using
rasterio, but the interpolation does not respect concavity in the inputted data, and it takes several seconds to process each variable.
Is there an easier / faster way to generate a raster from this nonstandard grid? Can affine transformations be curvilinear?