Herbie
Herbie copied to clipboard
Herbie accessors should be able to work for a GRIB2 file read by cfgrib that wasn't routed through Herbie
If you read a GRIB2 file into xarray with cfgrib, it is still missing the projection info that Herbie gets from pyproj and pygrib. That means you can't use the
ds = xr.open_dataset("file.grib2", engine='cfgrib')
ds.herbie.crs # <<-- !! THIS ERRORS, because no projection info
It would be nice if the accessor would do the work to get that info like the H.xarray method already does.
This could be worked on as part of #172
I will need to look for the file path from the cfgrib history
import re
import xarray as xr
ds = xr.open_dataset(FILE, engine='cfgrib')
match = re.search(r'"source": "(.*?)"', ds. History)
Path(match. Group(1)).exists()