NOAA-MDL / grib2io

Python interface to the NCEP G2C Library for reading and writing GRIB2 messages.
https://noaa-mdl.github.io/grib2io
MIT License
33 stars 12 forks source link

Unified interpolation function #85

Closed EricEngle-NOAA closed 1 year ago

EricEngle-NOAA commented 1 year ago

This commit unifies the module-level functions interpolate() and interpolate_to_stations() into a single interpolate() function.

This unified function supports scalar and vector interpolation to a new grid OR to station points.

Added enhanced functionality to Grib2GridDef to support a station points "grid definition".

Added helper function _adjust_array_shape_for_interp(). This function existed in each interpolate() and interpolate_to_stations() functions and now exists as 1 function that can work on the various types of interpolation output.

More general cleanup of _grib2io.py.