[MINC-development] [michael.hanke at gmail.com: Re: Bug#585676: minc-tools: Cannot use cmdline tools (file not found)]
Andrew Janke
a.janke at gmail.com
Tue Dec 13 21:23:16 EST 2011
>> If I gunzip the file first, mincinfo works.
>>
>> Known issue?
>
> Nope, not that I am aware of. A little bit of investigation would tell
> me that mincinfo is fine with compressed MINC1 files (NetCDF) but
> fails on compressed MINC2 (HDF) files. it would seem that the
> unzipped tmp file is empty.
OK, more digging reveals that the problem is here:
https://github.com/andrewjanke/minc/blob/master/libsrc/netcdf_convenience.c#L244
There is a hard-coded "hack" in there:
#define BYTES_PER_OPEN (1024*64)
That seems to work for netcdf files. In effect to just get the
"header_only" of a NetCDF file you just keep unzipping and reading in
chunks of this size and wait until you get a successful read.
Seems that there is some MINC2 specific code in there but it doesn't
appear to test if a HDF file can be opened, just accessed. If you
add:
header_only = 0
to about line 266, everything works nicely.
So the question now is should we support this behaviour or just revert
to uncompressing the whole thing? I say "support" because users should
be using HDF's internal compression scheme not external zipping.
a
More information about the MINC-development
mailing list