From f8220238e24ff02503c2b355c5cdb9662558b928 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Thu, 4 Mar 2021 16:40:33 -0600 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 56c058a6..6503173c 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -82,19 +82,18 @@ def run(): clvr_file = clvr_ds.get_file(time) if clvr_file is None: continue - if last_clvr_file is None: + if clvr_file != last_clvr_file: + try: + h5f = h5py.File(clvr_file, 'r') + except Exception: + h5f.close() + print('Problem with file: ', clvr_file) + continue + if last_h5f is not None: + last_h5f.close() + last_h5f = h5f last_clvr_file = clvr_file else: - if clvr_file == last_clvr_file: - hf5 = last_h5f - else: - last_h5f.close() - try: - h5f = h5py.File(clvr_file, 'r') - except Exception: - h5f.close() - print('Problem with file: ', clvr_file) - continue - last_h5f = hf5 + h5f = last_h5f gvals = get_grid_values(h5f, 'temp_11_0um_nom', ll[0], cc[0], 20) -- GitLab