From 051b99dc672cd84d3833b1f399f8bdaaa357c9c0 Mon Sep 17 00:00:00 2001 From: devsjc <47188100+devsjc@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:29:29 +0100 Subject: [PATCH] fix(gfs-etl): Ignore grib errors --- containers/gfs/download_combine_gfs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/containers/gfs/download_combine_gfs.py b/containers/gfs/download_combine_gfs.py index a46bea3..0f1cd27 100644 --- a/containers/gfs/download_combine_gfs.py +++ b/containers/gfs/download_combine_gfs.py @@ -81,7 +81,14 @@ def convert_file(file: str, outfolder: str) -> str | None: """ # Convert the file try: - ds: list[xr.Dataset] = cfgrib.open_datasets(file, backend_kwargs={"indexpath": ""}) + ds: list[xr.Dataset] = cfgrib.open_datasets( + file, + backend_kwargs={ + "indexpath": "", + "grib_errors": "ignore", + "errors": "ignore", + }, + ) except Exception as e: log.error(f"Error opening dataset for file {file}: {e}") return None