From ab0444cfea0cf7e94caa3c93bf2e265d25d3ea28 Mon Sep 17 00:00:00 2001 From: Ed Safford <62339196+EdwardSafford-NOAA@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:29:12 -0400 Subject: [PATCH] Handle missing station data file rather than exiting with an exception (#198) Add zeroed data if a station data file is missing to ensure continued execution. Resolves #197 ## Dependencies Not a huge deal but I started this branch from my fix for #196 so that should be merged before this change. --------- Co-authored-by: Cory Martin --- src/eva/data/mon_data_space.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/eva/data/mon_data_space.py b/src/eva/data/mon_data_space.py index f4ed722..a8837a2 100644 --- a/src/eva/data/mon_data_space.py +++ b/src/eva/data/mon_data_space.py @@ -799,6 +799,10 @@ def read_stn_ieee(self, file_name, coords, dims, ndims_used, dims_arr, dims['ydef'] = numobs f.close() + else: + rtn_array = np.zeros((len(vars), 1, 1), float) + dims['ydef'] = 1 + rtn_lat = np.asarray(lat).reshape(-1) rtn_lon = np.asarray(lon).reshape(-1)