compression

Mark Koennecke Mark.Koennecke at psi.ch
Thu Nov 25 16:09:53 GMT 1999




On Thu, 25 Nov 1999 F.A.Akeroyd at rl.ac.uk wrote:

> >
> >  There is no need to bother about compression when reading data. (This is
> >  the way HDF deals with it) At the writing end the usage sequence would
> >  be:
> >
> >  NXopendata(......)
> >  NXcompress(.......)
> >  NXputdata(....)
> >
> >
> >  which means that NXcompress only acts upon an open SDS.   
> >
> By the above sequence do i understand that you need to specify "NXcompress"
> separately for each SDS that you write? 

 Yes, this is right!

> If so, i think this may go against 
> the philosophy of NXUwritedata which was introduced as the sequence of
> "make,open,put"
> was considered to be rather verbose for an average user and they would now
> have to
> double their code size with an extra "NXcompress" for each "NXUwritedata".
> While
> you certainly need to be able to control crompression on an SDS by SDS
> basis, would
> it also be a good idea to introduce a function to indicate the "default
> comression" to
> be used in the absense of an NXcompress? Something like
> 
> NXstatus NXsetdefault(int default_type, int default_setting)
> 
> called as   
> 
>   NXsetdefault(NX_COMPRESS, NX_COMPRESS_RLE)
> 
> and also define the symbol NX_COMPRESS_NONE to turn off compression?
> 
> Cheers,
> 
> Freddie
> 
  I agree that it is against the philosophy of NXUwritedata. But has
  NXUwritedata ever made it into the NAPI standard? The second thing to
  ponder is that you usually do not compress all data items in a NeXus
  file. Just the large ones such as the 64*64*512 counts array at SXD.
  Most data items in a NeXus files are single numbers and for those 
  compression would be nonsense. We end up with a little bit of extra code
  for the huge dataset.

  Anyway, I would prefer to add anothe #define NX_NONE and another 
  parameter to NXUwritedata which denotes compression. Perhaps give
  that one another name and keep the old version for backwards
  compatibility. The old one would then call the new one with NX_NONE for
  compression?

  NXUwritedata never came into my mind, I'am mostly using NXDICT for
  any serious work. And I'll add a -compr flag to NXDICT soon.

               Mark
  

    




More information about the NeXus-developers mailing list