How can I create index files for local GRIB files? #366
Answered
by
blaylockbk
blaylockbk
asked this question in
Q&A
|
I have some local GRIB files, but they don't have index files. How can I make the |
Answered by
blaylockbk
Aug 29, 2024
Replies: 1 comment
|
NCEP-style index files can be generated with wgrib2 -s file.grib2 > file.grib2.idxIf from pathlib import Path
from herbie import wgrib2
# Create list of grib2 files
files = sorted(Path("/user/data/my_local_urma_data").rglob("*/*.grb2*"))
# Generate an index file for each file
n = len(files)
for i, f in enumerate(files):
print(f"Create index file {i:,}/{n:,} ({i / n:.1%}).", end="\r")
wgrib2.create_inventory_file(f) |
0 replies
Answer selected by
blaylockbk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NCEP-style index files can be generated with
wgrib2.wgrib2 -s file.grib2 > file.grib2.idxIf
wgrib2is in your path, Herbie has a helper function to make the index files.