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
Container registry
Model registry
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
Smith, Naomi
CTDAS
Commits
6f592a55
Commit
6f592a55
authored
8 years ago
by
Tsurata, Aki
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
29154533
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
da/tm5/methaneobservationoperator.py
+91
-0
91 additions, 0 deletions
da/tm5/methaneobservationoperator.py
with
91 additions
and
0 deletions
da/tm5/methaneobservationoperator.py
0 → 100755
+
91
−
0
View file @
6f592a55
#!/usr/bin/env python
# tm5_tools.py
"""
Author : Aki
File created on Feb 2010.
"""
import
os
import
sys
import
logging
import
shutil
import
datetime
import
subprocess
from
string
import
join
import
glob
sys
.
path
.
append
(
os
.
getcwd
())
sys
.
path
.
append
(
"
../../
"
)
import
da.tools.rc
as
rc
from
da.tools.general
import
create_dirs
,
to_datetime
from
da.baseclasses.observationoperator
import
ObservationOperator
from
da.tm5.observationoperator
import
TM5ObservationOperator
def
validate_rc_methane
(
self
):
"""
Validate the contents of the tm_settings dictionary and add extra values. The required items for the TM5 rc-file
are specified in the tm5_tools module, as dictionary variable
"
needed_rc_items
"
.
"""
if
self
.
rcfiletype
==
'
pycasso
'
:
self
.
projectkey
=
'
my.project.dir
'
self
.
rundirkey
=
'
my.run.dir
'
self
.
outputdirkey
=
'
output.dir
'
self
.
savedirkey
=
'
restart.write.dir
'
self
.
timestartkey
=
'
timerange.start
'
self
.
timefinalkey
=
'
timerange.end
'
self
.
timelengthkey
=
'
jobstep.length
'
self
.
istartkey
=
'
istart
'
self
.
restartvalue
=
33
self
.
coldstartvalue
=
5
#Aki: read from mmix file
self
.
transitionvalue
=
61
self
.
mysourcedirs
=
'
my.source.dirs
'
self
.
addedsourcedirs
=
'
proj/levels/ml91/trunk proj/levels/ml91/tropo34/trunk
'
else
:
self
.
projectkey
=
'
runid
'
self
.
rundirkey
=
'
rundir
'
self
.
outputdirkey
=
'
outputdir
'
self
.
savedirkey
=
'
savedir
'
self
.
timestartkey
=
'
time.start
'
self
.
timefinalkey
=
'
time.final
'
self
.
timelengthkey
=
'
time.break.nday
'
self
.
istartkey
=
'
istart
'
self
.
restartvalue
=
3
self
.
coldstartvalue
=
9
self
.
transitionvalue
=
61
needed_rc_items
=
[
self
.
projectkey
,
self
.
rundirkey
,
self
.
outputdirkey
,
self
.
savedirkey
,
self
.
timestartkey
,
self
.
timefinalkey
,
self
.
timelengthkey
,
self
.
istartkey
]
for
k
,
v
in
self
.
tm_settings
.
iteritems
():
if
v
==
'
True
'
:
self
.
tm_settings
[
k
]
=
True
if
v
==
'
False
'
:
self
.
tm_settings
[
k
]
=
False
if
'
date
'
in
k
:
self
.
tm_settings
[
k
]
=
to_datetime
(
v
)
if
'
time.start
'
in
k
:
self
.
tm_settings
[
k
]
=
to_datetime
(
v
,
fmt
=
'
TM5
'
)
if
'
time.final
'
in
k
:
self
.
tm_settings
[
k
]
=
to_datetime
(
v
,
fmt
=
'
TM5
'
)
if
'
timerange.start
'
in
k
:
self
.
tm_settings
[
k
]
=
to_datetime
(
v
)
if
'
timerange.end
'
in
k
:
self
.
tm_settings
[
k
]
=
to_datetime
(
v
)
for
key
in
needed_rc_items
:
if
not
self
.
tm_settings
.
has_key
(
key
):
msg
=
'
Missing a required value in rc-file : %s
'
%
key
logging
.
error
(
msg
)
raise
IOError
,
msg
logging
.
debug
(
'
rc-file has been validated succesfully
'
)
TM5ObservationOperator
.
validate_rc
=
validate_rc_methane
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