Commit 7258a494 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

now only consider .nc files in averaging

parent e425949d
......@@ -67,7 +67,7 @@ def daily_avg(dacycle,avg):
os.makedirs(daydir)
files = os.listdir(weekdir)
files = [f for f in files if '-' in f]
files = [f for f in files if '-' in f and f.endswith('.nc')]
fileinfo = {}
for filename in files:
......@@ -101,7 +101,7 @@ def monthly_avg(dacycle,avg):
files = os.listdir(daydir) # get daily files
files = [f for f in files if '-' in f]
files = [f for f in files if '-' in f and f.endswith('.nc')]
if len(files) < 28:
print 'No month is yet complete, skipping monthly average'
......@@ -155,7 +155,7 @@ def yearly_avg(dacycle,avg):
os.makedirs(yeardir)
files = os.listdir(monthdir) # get monthly files
files = [f for f in files if '-' in f]
files = [f for f in files if '-' in f and f.endswith('.nc')]
if not files:
print "No full year finished yet, skipping yearly average..."
......@@ -205,7 +205,7 @@ def longterm_avg(dacycle,avg):
os.makedirs(longtermdir)
files = os.listdir(yeardir)
files = [f for f in files if avg in f]
files = [f for f in files if '-' in f and f.endswith('.nc')]
if not files:
print "No full year finished yet, skipping longterm average..."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment