Skip to content

Commit

Permalink
Update global_mean_timeseries.py
Browse files Browse the repository at this point in the history
Fix bug when variable doesn't exist in reference files and allow for model vs obs to continue, just plotting the test case.
  • Loading branch information
justin-richling authored Nov 19, 2024
1 parent 72942db commit d8241db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/plotting/global_mean_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def global_mean_timeseries(adfobj):
for field in adfobj.diag_var_list:
# reference time series (DataArray)
ref_ts_da = adfobj.data.load_reference_timeseries_da(field)
if ref_ts_da is None:
print(
f"\t Variable named {field} provides Nonetype. Skipping this variable"
)
continue
# check if this is a "2-d" varaible:
has_lat_ref, has_lev_ref = pf.zm_validate_dims(ref_ts_da)
if has_lev_ref:
Expand Down

0 comments on commit d8241db

Please sign in to comment.