From 696ab4993ef14b2d489227a47adb4de6820e3cbf Mon Sep 17 00:00:00 2001 From: Lucas A Estrada <63303345+laestrada@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:37:58 -0500 Subject: [PATCH] print out where corrupted GC files are (#288) --- src/inversion_scripts/operators/operator_utilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/inversion_scripts/operators/operator_utilities.py b/src/inversion_scripts/operators/operator_utilities.py index 969bb747..818a9d0f 100644 --- a/src/inversion_scripts/operators/operator_utilities.py +++ b/src/inversion_scripts/operators/operator_utilities.py @@ -222,7 +222,11 @@ def concat_tracers(run_id, gc_date, config, sv_elems, n_elements, baserun=False) ds_concat = xr.concat([dsmf[v] for v in keepvars], "element").rename("ch4") ds_concat = ds_concat.to_dataset().assign_attrs(dsmf.attrs) - ds_concat = ds_concat.isel(time=gc_date.hour, drop=True) # subset hour of interest + try: + ds_concat = ds_concat.isel(time=gc_date.hour, drop=True) # subset hour of interest + except Exception as e: + print(f"Run id {run_id}. Failed at {gc_date} with error: {e}", flush=True) + raise e if not baserun: ds_concat = ds_concat.assign_coords({"element": sv_elems}) return ds_concat