Skip to content

Commit

Permalink
Merge pull request #7 from UV-CDAT/isMonthly_cal_bug
Browse files Browse the repository at this point in the history
Is monthly cal bug
  • Loading branch information
doutriaux1 authored May 2, 2017
2 parents c32c24a + 226cf4f commit f021bc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Lib/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,11 @@ def isMonthly(s):
units=tim.units
monthly=1
for i in range(len(tim)-1):
month1=cdtime.reltime(tim[i],units).torel('months since 2000').value
month2=cdtime.reltime(tim[i+1],units).torel('months since 2000').value
month1=cdtime.reltime(tim[i],units).torel('months since 2000',tim.getCalendar()).value
month2=cdtime.reltime(tim[i+1],units).torel('months since 2000',tim.getCalendar()).value
if month2-month1!=1 : monthly=0
return monthly


def mergeTime(ds,statusbar=1,fill_value=1.e20):
'''
Merge chronologically a bunch of slab
Expand Down Expand Up @@ -776,7 +775,7 @@ def dayBasedSlicer(tim,arg=None):
subarg='feb-29'
else:
t=cdtime.reltime(index,'month since 1997')
t=t.tocomp()
t=t.tocomp(tim.getCalendar())
subarg=str(t.month)+'-'+str(t.day)
except:
raise Exception,"Error, dayBasedSlicer args must have '-' or '/' as month/day separator"
Expand Down
2 changes: 1 addition & 1 deletion share/test_data_files.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
http://uvcdat.llnl.gov/cdat/sample_data
https://uvcdat.llnl.gov/cdat/sample_data
aa51aa896ead44019335cebec68e7955 clt.nc
332feb65b3801d7ab25845976bd23d85 vertical.nc
0f928d5cc8b80e6a509a0a00f0fc87ad tas_mo.nc
Expand Down

0 comments on commit f021bc8

Please sign in to comment.