Skip to content

Commit

Permalink
Log eccodes.WrongStepUnitError on coordinates with invalid endstep at…
Browse files Browse the repository at this point in the history
…tribute and continue
  • Loading branch information
emfdavid committed Oct 5, 2023
1 parent 2aa69ba commit cd2d5c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kerchunk/grib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ def scan_grib(
coord2 = {"latitude": "latitudes", "longitude": "longitudes"}.get(
coord, coord
)
x = m.get(coord2)
try:
x = m.get(coord2)
except eccodes.WrongStepUnitError as e:
logger.warning("Ignoring coordinate '%s' for varname '%s', raises: eccodes.WrongStepUnitError(%s)", coord2, varName, e)
continue

if x is None:
continue
coordinates.append(coord)
Expand Down

0 comments on commit cd2d5c6

Please sign in to comment.