Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/lee1043 mov modularize #1062

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bug fix
  • Loading branch information
lee1043 committed Feb 26, 2024
commit 65b69c45415c4fab2d4891b8f4fffcdaf8ef3f32
7 changes: 5 additions & 2 deletions pcmdi_metrics/variability_mode/lib/lib_variability_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def subset_time(
if not isinstance(eyear, int):
eyear = int(eyear)

time1 = cftime.datetime(syear, 1, 1, 0, 0, 0, 0)
time2 = cftime.datetime(eyear, 12, eday, 23, 59, 59, 0)
time1 = f"{syear}-01-01 00:00:00"
time2 = f"{eyear}-12-{eday} 23:59:59"
time_tuple = (time1, time2)

# First trimming
Expand Down Expand Up @@ -237,6 +237,9 @@ def pick_year_last_day(ds):
if "calendar" in ds[time_key].attrs.keys():
if "360" in ds[time_key]["calendar"]:
eday = 30
else:
if "360" in ds[time_key][0].values.item().calendar:
eday = 30
except Exception:
pass
return eday
Expand Down