使用xarray的open_dataset或open_mfdataset加载NARR netcdf数据集(例如ftp://ftp.cdc.noaa.gov/Datasets/NARR/monolevel/air.2m.2010.nc)时,xarray会返回有关“冲突的_FillValue和missing_values”的错误。
输入:
ds = xarray.open_dataset('air.2m.2010.nc')
会产生以下错误:
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)')
当使用以下建议打开时:
ds = xarray.open_dataset('air.2m.2010.nc',decode_cf=False),
数据集被打开,但是变量、时间、坐标等未被解码(显然)。明确使用xarray.decode_cf(ds)也似乎无法成功解码数据集,因为遇到了相同的错误。
我认为这个错误的原因是NARR数据集是Lambert Conformal投影,由于它在xarray中打开时的网格形状,存在一些缺失值,因此与填充值发生了冲突。
最好的方法是如何在xarray中打开和解码此文件?
注意:我已经能够使用netcdf4-python打开和解码,但希望能够在xarray中实现这一点,以利用dask提供的外部计算功能。
输入:
ds = xarray.open_dataset('air.2m.2010.nc')
会产生以下错误:
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)')
当使用以下建议打开时:
ds = xarray.open_dataset('air.2m.2010.nc',decode_cf=False),
数据集被打开,但是变量、时间、坐标等未被解码(显然)。明确使用xarray.decode_cf(ds)也似乎无法成功解码数据集,因为遇到了相同的错误。
我认为这个错误的原因是NARR数据集是Lambert Conformal投影,由于它在xarray中打开时的网格形状,存在一些缺失值,因此与填充值发生了冲突。
最好的方法是如何在xarray中打开和解码此文件?
注意:我已经能够使用netcdf4-python打开和解码,但希望能够在xarray中实现这一点,以利用dask提供的外部计算功能。