Menu

5labview cannot open file that HDFView 2.13 can

dpakilgo
2017-11-06
2017-11-09
  • dpakilgo

    dpakilgo - 2017-11-06

    Hi Martijn (and all),

    I'm trying to read data from netCDF files - these are hdf5 files of a specific style. I have found that I can open these and view the file contents using the HDFView (2.13) software but I cannot get them to open using 5hlabview.

    If I try to open the file (using H5FOpen.vi) - I get the following error: 60020

    H5Equery.vi<err>
    Error in H5Fopen: unable to open file</err>

    • H5F_open: unable to read superblock
    • H5F_super_read: file signature not found.

    Complete call chain:
    H5Equery.vi
    H5F.lvlib:H5Fopen.vi:6750001
    Untitled 1

    I've put an example file here - https://drive.google.com/open?id=1_ABK-XnVU2Tw7fuOhNmPqc9ZoY7xqdEy

    I'm afraid I don't know enough about superblock and super-reads to work out how to solve the problem.

    Kind regards,

    David

     
  • Martijn Jasperse

    Hi David,
    It appears that this is not a valid HDF5 file, despite the fact that HDFView v3.0 appears to be able to open it. With what tool was it generated? I thought maybe it was created using the new spec in v1.10.x of HDF5 which cannot be read by v1.8.x (and therefore h5labview), but the official v1.10.1 HDF5 tools fail to load the file. In particular, h5dump cannot load the example, which is used for debug and diagnostics.

    Actually, I just noticed that although HDFView opens the file without error, it cannot access many of the datasets - they are all blank. For example, all the instrument sets except instrument_name show up as blank, further indicating that the file is corrupt.

    Cheers,
    Martijn

     
  • dpakilgo

    dpakilgo - 2017-11-08

    Hi Martijn,

    Thank you for your response,

    NetCDF files are meant to be valid hdf5 files (http://www.unidata.ucar.edu/software/netcdf/docs/interoperability_hdf5.html). This particular file was created by Agilent's Open Lab CDS software and it is possible that they are not formatting/constructing the file correctly. Certainly I cannot find the hdf5 dll's on that computer - so they are possibly using their own code for this.

    As you noticed, many of the datasets in the example file are blank - but that is not an error. They really are blank, so far as I can see. The important sets can be read by HDFView (scan_index, point_count, mass_values, time_values and intensity_values).

    I wonder how HDFView can open the file? It must have some way of circumventing the error (that part of the file is misformatted) and still allowing the file to be opened? Is it possible to try that option with h5labview? But, perhaps the error comes back from the dll and there is nothing that could be done about it?

    I will also chase this up with Agilent to see if they might be mis-creating the file somehow - or if there is an error in the NetCDF dlls.

    Kind regards,

    David

     
  • Martijn Jasperse

    Hi David,
    It looks to me like this is not an HDF5 file as it does not conform to the HDF5 spec, specifically regarding the start of the file, which is called the "superblock". NetCDF files are only valid hdf5 files since netCDF revision 4.0, and looking at the example file it seems to be revision 2.3.2 ("classic" format).

    The reason HDFView can view the file is that it includes the netCDF library and therefore has netCDF support for files generated before netCDF rev 4. This is beyond the scope of h5labview and therefore will not be supported.

    It seems to me that there would be a tool to do a netCDF > netCDF4 conversion (a quick glance shows that "nccopy" from netCDF or "ncks" from NCO can do this) after which it could be loaded in h5labview.

    Cheers,
    Martijn

     
  • dpakilgo

    dpakilgo - 2017-11-09

    Thanks Martijn!

    I'll follow that route. NetCDF files are not friendly to deal with - I was hoping that hdf5 (through the excellent 5hlabview :-) ) would make the job less painful. But I will soldier on. I'll try the nccopy idea first.

    Kind regards,

    David

     
  • dpakilgo

    dpakilgo - 2017-11-09

    Works like a dream! nccopy was the answer.

    NetCDF dates from the 90's - it never occured to me that the Agilent code would be that far out of date.

    Thanks again - for solving a problem that wasn't even yours.

    David

     
  • dpakilgo

    dpakilgo - 2017-11-09

    Sorry - I meant to say NetCDF 2.3.2 dates from the 90's.

     

Log in to post a comment.

MongoDB Logo MongoDB