climate-v / netcdf.earth

1 stars 0 forks source link

Not correct error message if file is netcdf4 #19

Open ucyo opened 3 years ago

ucyo commented 3 years ago

Currently the error message says that the file is not a netcdf, which it actually is. But not a supported one.

kumpelblase2 commented 2 years ago

This seems to be because it is completely different from a netcdf3 file as it does not even match the magic initials:

$ xxd icon-art-netcdf4.nc | head -n1
00000000: 8948 4446 0d0a 1a0a 0000 0000 0008 0800  .HDF............
$ xxd icon-art.nc | head -n1
00000000: 4344 4602 0000 0002 0000 000a 0000 0004  CDF.............

As we check for those magic bytes and they're not there, it's a non-netcdf file to us, i.e. an invalid file.

ucyo commented 2 years ago

Yes. It is a totally different format. The phrasing of the error is wrong, since it says that it is not a netcdf file. Rather it should be, "not a supported netcdf file". I opened an issue at climate-v/head-scratcher#3 regarding this. But is a long way to support netcdf4/hdf5