When using xarray open_dataset or open_mfdataset to load a NARR netcdf dataset (e.g. ftp://ftp.cdc.noaa.gov/Datasets/NARR/monolevel/air.2m.2010.nc), xarray returns an error regarding "conflicting _FillValue and missing_values".
Entering:
ds = xarray.open_dataset('air.2m.2010.nc')
yields this error:
ValueError: ('Discovered conflicting _FillValue and missing_value. Considering opening the offending dataset using decode_cf=False, corrected the attributes', 'and decoding explicitly using xray.conventions.decode_cf(ds)')
When using the suggestion to open as such:
ds = xarray.open_dataset('air.2m.2010.nc',decode_cf=False)
,
the dataset is opened, but the variables, time, coordinates etc. are not decoded (obviously). Using xarray.decode_cf(ds)
explicitly does not seem to help to successfully decode the dataset as the same error is encountered.
I believe this error arises because the NARR dataset is a Lambert Conformal and so there are some missing values due to the shape of the grid as it is opened by xarray, and for some reason, this conflicts with the fill values.
What is the best way to open and decode this file in xarray?
N.B. I have been able to open and decode using netcdf4-python, but would like to be able to do this in xarray to utilize it's out of core computation functionality provided by dask.