Skip to content

Commit

Permalink
fix for updated time coordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
laestrada committed Jan 19, 2023
1 parent a319945 commit 1cef122
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcpy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ def get_diff_of_diffs(
ref = ref[varlist]
dev = dev[varlist]
if 'nf' not in ref.dims and 'nf' not in dev.dims:
# if the coords do not align then set time dimensions equal
try:
xr.align(dev, ref, join='exact')
except:
ref.coords["time"] = dev.coords["time"]
with xr.set_options(keep_attrs=True):
absdiffs = dev - ref
fracdiffs = dev / ref
Expand Down

0 comments on commit 1cef122

Please sign in to comment.