Comments (5)
The compression level no.4 was the best in terms of speed and compression.
I agree that as a rule of thumb it is a good choice.
by converting the original double precision data to integer* ones, after converting the original values (e.g. water level in meters to mm) without loosing accuracy
True, that being said, depending on the application, even losing accuracy is something that can occasionally be considered.
from pyposeidon.
Good tip. I will look into it.
from pyposeidon.
Some years ago, I did some tests with the netcdf compression levels (1-9). The compression level no.4 was the best in terms of speed and compression. The tests were done with matlab's snctools (a) but I guess the same should hold true for the other netcdf libraries.
Additionally, we can reduce the file size, by converting the original double precision data to integer* ones, after converting the original values (e.g. water level in meters to mm) without loosing accuracy.
a) http://mexcdf.sourceforge.net/
from pyposeidon.
Implementing this will require to pass a parameter named encoding
to the to_netcdf()
calls.
http://xarray.pydata.org/en/stable/generated/xarray.Dataset.to_netcdf.html
encoding (dict, optional) – Nested dictionary with variable names as keys and dictionaries of variable specific encodings as values, e.g., {"my_variable": {"dtype": "int16", "scale_factor": 0.1, "zlib": True}, ...}
The h5netcdf engine supports both the NetCDF4-style compression encoding parameters {"zlib": True, "complevel": 9} and the h5py ones {"compression": "gzip", "compression_opts": 9}. This allows using any compression plugin installed in the HDF5 library, e.g. LZF.
Not necessarily related to the issue at hand, but the following links provide some interesting insights WRT data formats and compression:
https://docs.dask.org/en/latest/best-practices.html#store-data-efficiently
https://docs.dask.org/en/latest/dataframe-best-practices.html#store-data-in-apache-parquet-format
from pyposeidon.
If the netcdf files are being created with the xarray.DataSet.to_netcdf()
method, then we need to provide a value for the encoding
parameter. It should be a dictionary of the form
{"my_variable": {"dtype": "int16", "scale_factor": 0.1, "zlib": True}, ...}
http://xarray.pydata.org/en/stable/generated/xarray.Dataset.to_netcdf.html
from pyposeidon.
Related Issues (20)
- Document netcdf outpuf format HOT 2
- schism fails around International line
- tests: Expand to include more processes and gmsh
- tests: Resolve test_d3d_cast HOT 2
- Set up pip install option
- Move to conda-forge
- Set up Binder HOT 1
- Deprecations warnings with numpy 1.20+ HOT 1
- Add github action for running tests with `conda install pyPoseidon` HOT 4
- Remove azure-pipelines HOT 6
- Consider moving `dem.nc` to "misc" HOT 1
- Download test data upon first run
- Update metadata on pyproject.toml HOT 3
- Proj version 8+ is not compatible with cartopy 0.18
- Add documentation boilerplate
- pygeos integration
- pydap upstream issue
- Make visualization libraries optional HOT 2
- sort out cfgrib/eccodes dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyposeidon.