ecmwf / cfgrib

A Python interface to map GRIB files to the NetCDF Common Data Model following the CF Convention using ecCodes
Apache License 2.0
409 stars 77 forks source link

var_encoding options for to_netcdf convertor #333

Closed EddyCMWF closed 1 year ago

EddyCMWF commented 1 year ago

This is required because netCDF encoding options (e.g. compression options) need to be added per variable and it is not always possible/simple/sensible to know what variables are in the grib file before converting to netCDF. This change allows users to provide a common set of compression options which are applied to each data variable in the xr.dataset. Any encoding provided in the netcdf_kwargs_json overrides what is set via the global var_encoding_json.