Skip to content

What is a good way to tell a netCDF4 file from a "regular" HDF5 file? #3085

Closed Answered by DennisHeimbigner
krisfed asked this question in Q&A
Discussion options

You must be logged in to vote

There is one other possibility. There is an attribute called '_IsNetcdf4' that is backed by a program called "NC4_isnetcdf4" in "libhdf5/nc4hdf.c". The program looks for various elements of the netcdf-4/hdf5 file to decide if it was created by libnetcdf.
Currently it tests for existence of a variety of attributes, dimension names,etc in the file. It occurs to me that if the program/attribute returns false, and the file is otherwise readable by libnetcdf, then is should be a pure HDF5 file.

Replies: 5 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@krisfed
Comment options

@krisfed
Comment options

Comment options

You must be logged in to vote
2 replies
@krisfed
Comment options

@krisfed
Comment options

Answer selected by krisfed
Comment options

You must be logged in to vote
1 reply
@krisfed
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Dave-Allured
Comment options

@Dave-Allured
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants