NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi, While converting HDF-EOS2 files into HDF5 files that can be read by netCDF4, I got a question. I'm implementing the converter with HDF5 C API, and checking the generated file by using netCDF4 C API and ncdump. Since I'm using HDF5 API, I can fabricate a variable that does not have dimensions. I think netCDF4 API does not allow this case because variables should be defined with dimensions. For those variables, nc_inq_var() gives invalid dimension ids. It makes ncdump terminate with some messages. Since those variables do not have actual scientific data, I don't want to simply generate dimensions for each variable if I can avoid. However, I don't want to generate a file that loses that information. I was wondering how I can achieve this goal. I don't think generating dimensions for each variable is the best solution because the fact that those dimensions are fakes cannot be detected. Since netCDF4 uses HDF5, I guess netCDF4 can detect the number of elements even though dimensions don't exist. So, I think netCDF4 may be able to generate fake dimensions on-the-fly at the time nc_inq_var() is called. I thought netCDF4 may support this feature in that nc_open() does not complain when it opens those variables; only inquiry functions give invalid ids. Also, if there is any semantic that makes netCDF4 skip an HDF5 dataset, this would be nice, too. I know that netCDF4 recognizes "NAME" attribute, and it alters the way netCDF4 treats this variable. I'm wondering if I can similarly exploit special semantics. Any general suggestions and ideas will be appreciated. If my question was vague, please let me know. Thank you!
netcdfgroup
archives: