You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conda install -c conda-forge eccodes and pip install eccodes-python
If I try to write an index file off the same grib file twice:
importeccodesgrib_name='era5-levels-members.grib'foriinrange(2):
index_name=grib_name+f'.idx{i}'witheccodes.GribIndex(grib_name, ['level']) asindex:
index.write(index_name)
witheccodes.GribIndex(file_index=index_name) asindex:
msgs=index.select({'level': 500}) # Fails here on second run of loop.print(f'Using {index_name}: {len(msgs)} messages')
I get an ecCodes assertion error:
Using era5-levels-members.grib.idx0: 192 messages
ecCodes assertion failed: `field->file' in /home/conda/feedstock_root/build_artifacts/eccodes_1579074340882/work/src/grib_index.c:1470Aborted (core dumped)
The two index files written are not identical:
cmp era5-levels-members.grib.idx0 era5-levels-members.grib.idx1
era5-levels-members.grib.idx0 era5-levels-members.grib.idx1 differ: byte 36, line 1
However, if I replace index.write with a command line call to grib_index_build, it works:
importsubprocessimporteccodesgrib_name='era5-levels-members.grib'foriinrange(2):
index_name=grib_name+f'.idx{i}'subprocess.call(f'grib_index_build -o {index_name} -k level {grib_name}'.split(' '))
witheccodes.GribIndex(file_index=index_name) asindex:
msgs=index.select({'level': 500}) # Fails here on second run of loop.print(f'Using {index_name}: {len(msgs)} messages')
Output:
--- grib_index_build: processing era5-levels-members.grib
--- grib_index_build: keys included in the index file era5-levels-members.grib.idx0:
--- level
--- level = { 500, 850 }
--- 160 messages indexed
Using era5-levels-members.grib.idx0: 192 messages
--- grib_index_build: processing era5-levels-members.grib
--- grib_index_build: keys included in the index file era5-levels-members.grib.idx1:
--- level
--- level = { 500, 850 }
--- 160 messages indexed
Using era5-levels-members.grib.idx1: 192 messages
Seems like some state is being retained incorrectly after the first call?
The text was updated successfully, but these errors were encountered:
18.04.3 LTS
2.16.0
conda install -c conda-forge eccodes
andpip install eccodes-python
If I try to write an index file off the same grib file twice:
I get an ecCodes assertion error:
The two index files written are not identical:
However, if I replace
index.write
with a command line call togrib_index_build
, it works:Output:
Seems like some state is being retained incorrectly after the first call?
The text was updated successfully, but these errors were encountered: