Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
NearRealTimeCTDAS
CTDAS
Commits
7258a494
Commit
7258a494
authored
Oct 13, 2014
by
Peters, Wouter
Browse files
now only consider .nc files in averaging
parent
e425949d
Changes
1
Hide whitespace changes
Inline
Side-by-side
da/analysis/time_avg_fluxes.py
View file @
7258a494
...
@@ -67,7 +67,7 @@ def daily_avg(dacycle,avg):
...
@@ -67,7 +67,7 @@ def daily_avg(dacycle,avg):
os
.
makedirs
(
daydir
)
os
.
makedirs
(
daydir
)
files
=
os
.
listdir
(
weekdir
)
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
=
{}
fileinfo
=
{}
for
filename
in
files
:
for
filename
in
files
:
...
@@ -101,7 +101,7 @@ def monthly_avg(dacycle,avg):
...
@@ -101,7 +101,7 @@ def monthly_avg(dacycle,avg):
files
=
os
.
listdir
(
daydir
)
# get daily files
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
:
if
len
(
files
)
<
28
:
print
'No month is yet complete, skipping monthly average'
print
'No month is yet complete, skipping monthly average'
...
@@ -155,7 +155,7 @@ def yearly_avg(dacycle,avg):
...
@@ -155,7 +155,7 @@ def yearly_avg(dacycle,avg):
os
.
makedirs
(
yeardir
)
os
.
makedirs
(
yeardir
)
files
=
os
.
listdir
(
monthdir
)
# get monthly files
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
:
if
not
files
:
print
"No full year finished yet, skipping yearly average..."
print
"No full year finished yet, skipping yearly average..."
...
@@ -205,7 +205,7 @@ def longterm_avg(dacycle,avg):
...
@@ -205,7 +205,7 @@ def longterm_avg(dacycle,avg):
os
.
makedirs
(
longtermdir
)
os
.
makedirs
(
longtermdir
)
files
=
os
.
listdir
(
yeardir
)
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
:
if
not
files
:
print
"No full year finished yet, skipping longterm average..."
print
"No full year finished yet, skipping longterm average..."
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment