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
A user presented some data from an online repository which has a lot of rather weird variable names (but is otherwise fairly sensible).
Probably from the PALM-4U atmospheric model
The question being : should we add some compliance to allow this?
Iris has been very strict on this since v2.3 -- see #3399, and refuses to load the file,
raising ValueError: 'theta(0)' is not a valid NetCDF variable name..
I think the main problem for Iris, which motivated being stricter in that change, is that we really wouldn't want to save data with these kinds of variable names
-- and maybe they could also cause other internal problems in Iris, like selecting cubes/coords by name ?
Resolution:
I personally think that is a poor reason for erroring it on load -- a tolerant adjusment would be "more ideal" IMHO.
A user comment was :
"I agree with the general principle that we shouldn’t be creating files containing such characters in variable names ... we are not always trying to load file which we have had control over the generation of ... Hence having no way of reading the file becomes quite a big restriction."
It seems a bit odd not to be able to load this, claiming that it is not "good netcdf", whereas there is nothing really wrong with the file : So, there's a difference between what netcdf say is generally valid, and what you can have in an actual HDF5-based netCDF4 file.
Needless to say, xarray has no problem with this data !
Adding the issue to the CF compliance discussion
>>> from iris.common.metadata import _TOKEN_PARSE as tp
>>> print([k for k in ds.variables.keys() if not tp.match(k)])
['E*', 'us*', 'th*', 'w*', 'w"theta"0', 'w"theta"', 'theta(0)', 'theta(z_mo)', 'w"u"0', 'w"v"0', 'w"q"0', 'q*', 'w"s"', 's*']
>>>
The text was updated successfully, but these errors were encountered:
pp-mo
changed the title
Consider supporting non-standard netcdf variable names
Loading not possible with non-standard netcdf variable names
Feb 22, 2023
A user presented some data from an online repository which has a lot of rather weird variable names (but is otherwise fairly sensible).
Probably from the PALM-4U atmospheric model
The question being : should we add some compliance to allow this?
Iris has been very strict on this since v2.3 -- see #3399, and refuses to load the file,
raising
ValueError: 'theta(0)' is not a valid NetCDF variable name.
.I think the main problem for Iris, which motivated being stricter in that change, is that we really wouldn't want to save data with these kinds of variable names
-- and maybe they could also cause other internal problems in Iris, like selecting cubes/coords by name ?
Resolution:
I personally think that is a poor reason for erroring it on load -- a tolerant adjusment would be "more ideal" IMHO.
A user comment was :
It seems a bit odd not to be able to load this, claiming that it is not "good netcdf", whereas there is nothing really wrong with the file : So, there's a difference between what netcdf say is generally valid, and what you can have in an actual HDF5-based netCDF4 file.
Needless to say, xarray has no problem with this data !
Adding the issue to the CF compliance discussion
Some Details...
Example file dump (shortened):
List of variable names, :
and all the "invalid" ones
The text was updated successfully, but these errors were encountered: