Open JoerivanEngelen opened 3 years ago
The same ERROR: Status 3: Driver: Ugrid: Could not read double array
also pops up in files without time coordinates. For instance, if I have a vector of type int
with one element for every node.
The error disappears when converting the vector to floats. That suggests to me this is the same issue, and the problem isn't time specific.
Hi,
We encountered an issue in the UGRID reader when the time coordinates are encoded as integers instead of doubles. It seems like the UGRID reader expects time to be encoded as doubles.
I have attached two small examples, one with time encoded as integers, one with doubles. For the version with integers, running
mdalinfo
throws aERROR: Status 3: Driver: Ugrid: Could not read double array
. MDAL then falls back to interpreting the file as a regular NetCDF. For the version with time as doubles, there are no problems.mdal_time_dtype.zip
To my understanding, the UGRID conventions have no specifications for data types of time, so the CF conventions apply here. For which I can only find here
So I guess assuming the time coordinate is specified as doubles will result in issues for the naive user. For example, at our department, we use the python package xarray a lot, which encodes CF time coordinates by default as integers.