Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CTDAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NearRealTimeCTDAS
CTDAS
Commits
d78702de
Commit
d78702de
authored
11 years ago
by
Peters, Wouter
Browse files
Options
Downloads
Patches
Plain Diff
longterm mean fluxes now also averaged
parent
99a96009
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
da/analysis/time_avg_fluxes.py
+8
-6
8 additions, 6 deletions
da/analysis/time_avg_fluxes.py
with
8 additions
and
6 deletions
da/analysis/time_avg_fluxes.py
+
8
−
6
View file @
d78702de
...
@@ -17,11 +17,12 @@ import datetime
...
@@ -17,11 +17,12 @@ import datetime
from
da.analysis.daily_fluxes
import
daily_avg
from
da.analysis.daily_fluxes
import
daily_avg
from
da.analysis.monthly_fluxes
import
monthly_avg
from
da.analysis.monthly_fluxes
import
monthly_avg
from
da.analysis.yearly_fluxes
import
yearly_avg
from
da.analysis.yearly_fluxes
import
yearly_avg
from
da.analysis.longterm_fluxes
import
longterm_avg
def
time_avg
(
dacycle
,
avg
=
'
transcom
'
):
def
time_avg
(
dacycle
,
avg
=
'
transcom
'
):
"""
Function to create a set of averaged files in a folder, needed to make longer term means
"""
"""
Function to create a set of averaged files in a folder, needed to make longer term means
"""
if
avg
not
in
[
'
transcom
'
,
'
olson
'
,
'
country
'
]:
if
avg
not
in
[
'
transcom
'
,
'
olson
'
,
'
country
'
,
'
flux1x1
'
]:
raise
IOError
,
'
Choice of averaging invalid
'
raise
IOError
,
'
Choice of averaging invalid
'
analysisdir
=
dacycle
[
'
dir.analysis
'
]
analysisdir
=
dacycle
[
'
dir.analysis
'
]
...
@@ -37,6 +38,8 @@ def time_avg(dacycle,avg='transcom'):
...
@@ -37,6 +38,8 @@ def time_avg(dacycle,avg='transcom'):
if
new_year
(
dacycle
):
if
new_year
(
dacycle
):
yearly_avg
(
analysisdir
,
avg
)
yearly_avg
(
analysisdir
,
avg
)
longterm_avg
(
analysisdir
,
avg
)
def
new_month
(
dacycle
):
def
new_month
(
dacycle
):
"""
check whether we just entered a new month
"""
"""
check whether we just entered a new month
"""
...
@@ -63,9 +66,8 @@ if __name__ == "__main__":
...
@@ -63,9 +66,8 @@ if __name__ == "__main__":
dacycle
.
setup
()
dacycle
.
setup
()
dacycle
.
parse_times
()
dacycle
.
parse_times
()
while
dacycle
[
'
time.end
'
]
<
dacycle
[
'
time.finish
'
]:
time_avg
(
dacycle
,
avg
=
'
transcom
'
)
time_avg
(
dacycle
,
avg
=
'
olson
'
)
time_avg
(
dacycle
,
avg
=
'
transcom
'
)
time_avg
(
dacycle
,
avg
=
'
country
'
)
time_avg
(
dacycle
,
avg
=
'
olson
'
)
time_avg
(
dacycle
,
avg
=
'
flux1x1
'
)
dacycle
.
advance_cycle_times
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment