Fast cython function to interpolate ECMWF reduced gaussian gridded data to full gaussian grid.
To test, run python setup.py build_ext --inplace
, then python test.py
(first time will take a while to read data from google cloud,
but after that data will be cached data locally in test.nc
).
Included in pygrib >= 2.1.6.
def redtoreg(redgrid_data, lonsperlat, missval=None):
"""
Takes 1-d array on ECMWF reduced gaussian grid (redgrid_data), linearly interpolates
to corresponding regular gaussian grid.
Reduced gaussian grid defined by lonsperlat array, regular gaussian
grid has the same number of latitudes and max(lonsperlat) longitudes.
Includes handling of missing values using nearest neighbor interpolation.
"""