When I tried to using python package "xarray" to read grib files, I got an error. It's quite weird, because I had did it successfully yesterday. This is my code:
import xarray as xr
import os
import cfgrib
import pygrib as pg
import matplotlib.pyplot as plt
workDir = 'D:/ERA5/ERA5land_monthly_2000_2023_5eco_extent/raw_data'
os.chdir(workDir)
t2m_ds = xr.open_mfdataset('*.grib', parallel=True, chunks ={'time':2}, engine='cfgrib',
backend_kwargs={ 'filter_by_keys':{ 'cfVarName': 't2m', 'typeOfLevel':'surface'},'indexpath':''})
print(t2m_ds)
longitude = t2m_ds.longitude.values
latitude = t2m_ds.latitude.values
And this error occured:
### fatal flex scanner internal error--end of buffer missed
### E
Do you know the reason?