From fe606833fcaba2f2165c456b850d167e536f409b Mon Sep 17 00:00:00 2001 From: justin-richling Date: Mon, 9 Dec 2024 11:55:10 -0700 Subject: [PATCH] Add check for aod panel obs If either obs file for AOD 4-panel plots is missing, just skip this plot --- scripts/plotting/global_latlon_map.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/plotting/global_latlon_map.py b/scripts/plotting/global_latlon_map.py index b11546aef..e8d7f5f8f 100644 --- a/scripts/plotting/global_latlon_map.py +++ b/scripts/plotting/global_latlon_map.py @@ -443,6 +443,10 @@ def aod_latlon(adfobj): file_merra2 = os.path.join(obs_dir, 'MERRA2_192x288_AOD_2001-2020_climo.nc') file_mod08_m3 = os.path.join(obs_dir, 'MOD08_M3_192x288_AOD_2001-2020_climo.nc') + if (not Path(file_merra2).is_file()) or (not Path(file_mod08_m3).is_file()): + print("\t ** AOD Panel plots not made, missing MERRA2 and/or MODIS file") + return + ds_merra2 = xr.open_dataset(file_merra2) ds_merra2 = ds_merra2['TOTEXTTAU'] ds_merra2['lon'] = ds_merra2['lon'].round(5)