You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a C++ code that loads a netcdf file and accesses the units attribute like this:
netCDF::NcFile _data;
// open file [...]
auto a = _data.getVar("valid_time").getAtt("units");
SPDLOG_DEBUG(a.getType().getName()); // prints string
std::string epoch;
a.getValues(epoch); // throws exception
which results in an exception with the following error:
NetCDF: Attempt to convert between text & numbers
This netcdf has string attributes and are Copernicus CDS ERA5 netcdf files. ncdump shows:
I have a C++ code that loads a netcdf file and accesses the
units
attribute like this:which results in an exception with the following error:
This netcdf has string attributes and are Copernicus CDS ERA5 netcdf files.
ncdump
shows:If I have a non-string attr like:
the above C++ code works as expected.
This problem appears to be the same issue noted in this
netcdf-fortran
issue Unidata/netcdf-fortran#181 (comment)However, as I understand it, string attributes is supposed to work with
netcdf-c
. Is this a limitation to the C++ api?Versions:
The text was updated successfully, but these errors were encountered: