xarray-data icon indicating copy to clipboard operation
xarray-data copied to clipboard

Non CF conforming dataset

Open kmuehlbauer opened this issue 1 year ago • 4 comments

The file eraint_uvz.nc contains variables which do not conform to CF standard.

Below is the ncdump of the z-variable of dtype int16 but the _FillValue is NaN. According to CF conventions _FillValue should be of same type as its variable.

ncdump:

short z(month, level, latitude, longitude) ;
    z:number_of_significant_digits = 5 ;
    z:units = "m**2 s**-2" ;
    z:scale_factor = -1.7250274674968 ;
    z:long_name = "Geopotential" ;
    z:add_offset = 66825.5 ;
    z:_FillValue = NaN ;
    z:standard_name = "geopotential" ;

kmuehlbauer avatar Feb 07 '24 11:02 kmuehlbauer

Interesting. Do we know where this file came from and how this value was generated?

rabernat avatar Feb 07 '24 11:02 rabernat

Thanks Ryan for the quick reply. This is in the global attributes (XXXX added by me):

Info :
    Monthly ERA-Interim data. Downloaded and edited by fabien.maussion@XXXXXXX

Maybe @fmaussion can shed some light.

kmuehlbauer avatar Feb 07 '24 12:02 kmuehlbauer

Does Xarray write these sorts of attributes itself? Or do they come from the data provider?

rabernat avatar Feb 07 '24 21:02 rabernat

Xarray is able to write these attributes, but for int16 dtype NaN does not make any sense. I'd consider that a bug.

But maybe someone with more knowledge on ERA5 has some idea what a correct _FillValue would be.

kmuehlbauer avatar Feb 07 '24 22:02 kmuehlbauer