[NeXus-code-tickets] [NeXusCode] #113: Add control of HDF5 compression level to NXcompmakedata()
NeXus Data Format Library and Applications
noreply at nexusformat.org
Mon Apr 21 06:11:31 BST 2008
#113: Add control of HDF5 compression level to NXcompmakedata()
--------------------+-------------------------------------------------------
Reporter: Mlesha | Owner: Unassigned
Type: defect | Status: new
Priority: minor | Milestone:
Component: napi | Version: trunk
Keywords: |
--------------------+-------------------------------------------------------
Hi everyone,
There are three levels of compression defined in the NeXus API:
NXcompmakedata() has a compress_type argument which can be NX_COMP_LZW
(Lempel-Ziv as used in gzip), NX_COMP_HUF (Huffman) or NX_COMP_RLE
(Runlength encoded). These work when HDF4 is written out by NeXus,
however for HDF5 output only NX_COMP_LZW has been implemented in napi5.c.
I suspect the reason is that HDF5 does not have any equivalents for
Huffman or run-length encoding. What it does have instead is a level 0-9
which specifies the compression level. This is passed in via the call to
H5Pset_deflate() in napi5.c. The default value of 6 provides the
equivalent performance to the HDF4 implementation.
It would potentially be useful for us to control the compression level
to suit the data, for some fast experiments the data set may be
large/sparse and there may be advantages to applying less compression. My
suggestion is to create compress_type constants NX_COMP_HDF5_LVL0 thru
NX_COMP_HDF5_LVL9, which can set the level via H5Pset_deflate() in
napi5.c. I would be happy to assist in implementation if desired.
Mark Lesha
Scientific Programmer
Australian Nuclear Science and Technology Organisation
PMB 1, Menai NSW 2234
T 02 9717 7026
M 0406 077 929
E mle at ansto.gov.au
www.ansto.gov.au/bragg
--
Ticket URL: <http://trac.nexusformat.org/code/ticket/113>
NeXus Data Format Library and Applications <http://www.nexusformat.org/>
NeXus Data Format Library and Applications
More information about the NeXus-code-tickets
mailing list