-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to reduce the output size with to_netcdf? #865
Comments
NetCDF and xarray support lossy compression (extremely efficient and fast with the cost of numerical precision loss) or gzip compression (without precision loss but with slower I/O - especially when reading chunks of data). You can have a look at the documentation about NetCDF I/O here. |
How do I get lossy compression? I could not find it on the documentation :( |
Please read the documentation |
Thanks, I thought there were some methods to choose from or something like that. For future readers, |
You can also use zlib and complevel |
Just making it clear: those would configure lossless compression of netcdf4 lib, not lossy compression. |
Hello,
The options of the ds.to_netcdf method allow several netcdf modes and a control of several options (missing values, format...).
Our current options are as follows:
ds.to_netcdf(filenam,
'w',
'NETCDF4',
'netcdf4',
encoding={ vkey2:{'dtype': float32,'_FillValue':0}})
Whereas the input size is 6 GiB / variable, the output size reaches 23 GiB / variable.
What is the best strategy in the options to reduce the netcdf output size, other than changing the format (in my exercice we have float32)?
In particular, is there some interest in modifying the deprecated "missing_values" attribute?
Thank you in advance,
The text was updated successfully, but these errors were encountered: