[NeXus-code-tickets] [NeXusCode] #226: Save a NeXus file with chunking and no compression
NeXus Data Format Library and Applications
noreply at nexusformat.org
Tue Sep 18 11:40:16 BST 2012
#226: Save a NeXus file with chunking and no compression
----------------------------+---------------------------
Reporter: Pedro.vicente | Owner: Pedro.vicente
Type: enhancement | Status: closed
Priority: major | Milestone: 4.3.0
Component: napi | Version: trunk
Resolution: fixed | Keywords:
----------------------------+---------------------------
Changes (by Freddie Akeroyd):
* status: assigned => closed
* resolution: => fixed
Old description:
> PROPOSED SOLUTION (HDF5)
>
> 1) define a new symbol NX_CHUNK
>
> {{{
>
> /* Map NeXus compression methods to HDF compression methods */
> #define NX_CHUNK 0
> #define NX_COMP_NONE 100
> #define NX_COMP_LZW 200
> #define NX_COMP_RLE 300
> #define NX_COMP_HUF 400
> }}}
>
> 2) the same for the C++ binding
>
> {{{
> enum NXcompression {
> CHUNK = NX_CHUNK,
> NONE = NX_COMP_NONE,
> LZW = NX_COMP_LZW,
> RLE = NX_COMP_RLE,
> HUF = NX_COMP_HUF
> };
> }}}
>
>
> 3) modify NX5compmakedata to handle this case
>
> {{{
> else if (compress_type == NX_CHUNK)
> {
> cparms = H5Pcreate(H5P_DATASET_CREATE);
> iNew = H5Pset_chunk(cparms,rank,chunkdims);
> if (iNew < 0)
> {
> NXIReportError (NXpData, "ERROR: Size of chunks could not
> be set!");
> return NX_ERROR;
> }
> iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
> dataspace, cparms);
>
> }
>
> }}}
New description:
PROPOSED SOLUTION (HDF5)
1) define a new symbol NX_CHUNK
{{{
/* Map NeXus compression methods to HDF compression methods */
#define NX_CHUNK 0
#define NX_COMP_NONE 100
#define NX_COMP_LZW 200
#define NX_COMP_RLE 300
#define NX_COMP_HUF 400
}}}
2) the same for the C++ binding
{{{
enum NXcompression {
CHUNK = NX_CHUNK,
NONE = NX_COMP_NONE,
LZW = NX_COMP_LZW,
RLE = NX_COMP_RLE,
HUF = NX_COMP_HUF
};
}}}
3) modify NX5compmakedata to handle this case
{{{
else if (compress_type == NX_CHUNK)
{
cparms = H5Pcreate(H5P_DATASET_CREATE);
iNew = H5Pset_chunk(cparms,rank,chunkdims);
if (iNew < 0)
{
NXIReportError (NXpData, "ERROR: Size of chunks could not be
set!");
return NX_ERROR;
}
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
dataspace, cparms);
}
}}}
--
--
Ticket URL: <http://trac.nexusformat.org/code/ticket/226#comment:4>
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