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 |
Beta Was this translation helpful? Give feedback.
Answered by
blaylockbk
Aug 29, 2024
Replies: 1 comment
-
NCEP-style index files can be generated with wgrib2 -s file.grib2 > file.grib2.idx If 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) |
Beta Was this translation helpful? Give feedback.
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.idx
If
wgrib2
is in your path, Herbie has a helper function to make the index files.