Skip to content

How can I create index files for local GRIB files? #366

Answered by blaylockbk
blaylockbk asked this question in Q&A
Discussion options

You must be logged in to vote

Index files can be generated with wgrib2.

wgrib2 -s file.grib2 > file.grib2.idx

If wgrib2 is in your path, Herbie has a helper function to make the index files.

from pathlib import Path
import herbie.wgrib2

# list of grib2 files
files = sorted(Path("/user/data/my_urma_data").rglob("*/urma2p5*wexp"))

# generate an index file for each file
for f in files:
    herbie.wgrib2.create_inventory_file(f)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by blaylockbk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant