failed to set key 'endStep' in to_grib
See original GitHub issueI read the temperature from GFS and tried to write the data to a new GRIB file .
from eccodes import *
import numpy as np
import xarray as xr
from cfgrib.xarray_to_grib import to_grib
filename = "gfs.2022010500f24"
ds = xr.open_dataset(filename, engine='cfgrib',
backend_kwargs={'filter_by_keys': {'typeOfLevel': 'isobaricInhPa',
'name' : 'Temperature'}})
to_grib(ds, 'out1.grib', grib_keys={'edition': 2})
Running the script directly will result in an error
KeyError: 1641340800000000000
following #272 , it works with a warning :
failed to set key 'endStep' to numpy.timedelta64(24,'ns')
and the time information in the grib file is incorrect
1:0:d=2022010500:TMP Temperature [K]:1000 mb:anl:
which should be
542:117403445:d=2022010500:TMP Temperature [K]:1000 mb:24 hour fcst:
Environment: Python 3.8 from conda-forge on centos7
pandas 1.3.4 cfgrib 0.9.9.1 xarray 0.20.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Conversion of netcdf file to grib - CDO
Hi As my data contain 21 levels of pressure and has gaussian Grid coordinates . I want to convert it into grib file....
Read more >pyg2p/README.md at master - GitHub
Console logger level is INFO by default and can be optionally set by using -l (or –loggerLevel) input argument. Possible logger level values...
Read more >GRIB decoding - ECMWF Confluence Wiki
Status of ECMWF migration to GRIB edition 2 ... The set of keys available changes from one message to another depending ... endStep...
Read more >GRIB decoding. Computer User Training Course Paul Dando ...
The set of keys available changes from one message to another depending on: - the GRIB edition - the content of the message...
Read more >Essential Fleet Manager - Issue 5 2021 by Essential ... - Issuu
Under its future fleet strategy, SPIE UK has set itself the target ... 450kgs and four cubic metres plus vehicle-togrid charging technology.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works!
Also, make sure you’re using cfgrib from the master branch - this fix was important but is not yet in a release: https://github.com/ecmwf/cfgrib/commit/3cc01e395cd66a376a279c0c603cbedcaeda7f50