-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error cfgrib.to_grib convert netcdf to grib #91
Comments
@taoansf ouch! This is a typical brown-paper-bag bug. It appears only on Windows. Sorry! I fixed it in the |
Thank you @alexamici you are right, that error does not occur on my linux environment. However, when I try to load the grib output with this code it does not work Do you have some idea how to solve this? With best regards, Taoan |
My grib output |
The problem it that in order to save arbitrary netCDF files to GRIB with cfgrib you must specify all the Saving a to grib a GRIB file opened with cfgrib works more often because the dataset keeps the GRIB keys of the original file, but if you start from a netCDF you need to do the work manually and you need to know the GRIB data format. |
Thank you @alexamici, your explanation was very precise. With best regards, Taoan |
Hello,
I'm looking for a solution to write a grib file from a netcdf data using this code
#! /usr/bin/env python
import xarray as xa
import cfgrib
ds = xa.open_dataset('2015-01-15.nc')
cfgrib.to_grib(ds,'2015-01-15.grb', grib_keys={'gridType':'regular_ll'})
However python give me this error mensage
File "C:\Users\Usuario\Miniconda3\lib\site-packages\cfgrib\bindings.py", line 442, in portable_handle_new_from_samples
sample_path = os.path.join(samples_folder, samplename + b'.tmpl')
TypeError: must be str, not bytes
This is my input file, from SST-MUR data
2015-01-15.zip
I will appreciate any help with this problem.
With best regards,
Taoan
The text was updated successfully, but these errors were encountered: