Skip to content

Commit

Permalink
made some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Anu-Ra-g committed Sep 28, 2024
1 parent b5ca9c0 commit cfc04e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kerchunk/grib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,12 @@ def scan_grib(
)
continue

if idx:
if idx and coord in ["time", "valid_time"]:
line = ""
if coord == "time":
time = dt.datetime.fromtimestamp(x, tz=pytz.UTC)
line = f"{count}:{offset}:d={time.strftime('%Y%m%d%H')}:{varName.upper()}"
count += 1
elif coord == "valid_time":
valid_time = dt.datetime.fromtimestamp(x, tz=pytz.UTC)
diff = int((valid_time - time).total_seconds() / 3600)
Expand Down

0 comments on commit cfc04e0

Please sign in to comment.