-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netCDF4 cannot read from little-endian HDF4 files #400
Comments
Tim: Could you create an issue for this at https://github.com/Unidata/netcdf-c/issues? |
Logged as Unidata/netcdf-c#113 |
Could you try updating your netcdf C library from github master? I'm wondering if the bug fix reported in Unidata/netcdf-c#112 helps. |
I've built from the netcdf-c github master on OS X using autoreconf -vif CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure --enable-hdf4 --enable-hdf4-file-tests make make check make install All tests passed. However I still get: ncdump hdf_little-endian.hdf ncdump: hdf_little-endian.hdf: NetCDF: Bad type ID MBP:hdf4-endianess tim$ python Python 2.7.9 (default, Jan 7 2015, 11:50:42) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from netCDF4 import Dataset >>> ds = Dataset('hdf_little-endian.hdf') Traceback (most recent call last): File "", line 1, in File "netCDF4.pyx", line 1503, in netCDF4.Dataset.__init__ (netCDF4.c:24382) RuntimeError: NetCDF: Bad type ID For reference, the HDF4 library version I'm using is 4.2.10 |
Oh well. Let's see if they respond to the ticket you created. |
@jswhit The issue should hopefully be fixed now. More details over at Unidata/netcdf-c#113, or in our JIRA system at https://bugtracking.unidata.ucar.edu/browse/NCF-332, but long-story-short, the issue was identified and resolved. The fix has been merged into netcdf-c |
Thanks @WardF! |
Using OS X 10.9.5, the following example code will produce a little-endian HDF4 file which contains a simple incrementing 5x5 array. Specifically, binary ORing the defined datatype with DNFT_LITEND create a little-endian file.
Using
hdp dumpsds filename
showsHowever
ncdump
fails to read the file with aNetCDF: Bad type ID
. The python netCDF4 library also fails when using the Dataset constructor, producing:I recognise that this is likely an upstream netCDF isuse but it would be good to identify which call is producing the error so the issue can be logged with the upstream providers.
The text was updated successfully, but these errors were encountered: