-
Notifications
You must be signed in to change notification settings - Fork 17
Compression
David Aceituno edited this page Dec 21, 2021
·
8 revisions
Chunked datasets can be compressed if HDF5 was built with zlib support. Use these functions to set or check the compression level:
file.setCompressionLevel(3); // 0 to 9: 0 to disable compression, 9 for maximum compression. Recommended 2 to 5
file.getCompressionLevel(); // Gets the current compression level
h5pp::hdf5::isCompressionAvaliable(); // True if your installation of HDF5 has zlib support or pass a temporary compression level as the fifth argument when writing a dataset:
file.writeDataset(myData, "science/myCompressedData", H5D_CHUNKED, std::nullopt, 3); // Creates a chunked dataset with compression level 3.or use the special member function for this task:
file.writeDataset_compressed(myData, "science/myCompressedData", 3) // // Creates a chunked dataset with compression level 3 (default).