Replies: 1 comment 1 reply
-
This mostly a good way to tell the difference. There is a couple of issues, though. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was originally intending to use
nc_open
and check the status, but it seems to work fine on HDF5 files (that are NOT netCDF4 files), and return a reasonable-lookingncid
.Even
nc_inq_format
seems to think a "regular" HDF5 file is a netCDF4 file (NC_FORMAT_NETCDF4
).My next best idea is to check for the presence of
_NCProperties
global attribute with something likenc_inq_att
. This seems to work (works fine on a netCDF4 file and returns aNC_ENOTATT
error status on a "regular" HDF5 file), but I am wondering if there is a better way.Is a
_NCProperties
global attribute guaranteed to be present for all valid netCDF4 files? Should I be using something else?I am working with v4.9.2 if it matters.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions