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
CTDAS
CTDAS
Commits
313fd30b
Commit
313fd30b
authored
13 years ago
by
ivar
Browse files
Options
Downloads
Patches
Plain Diff
added MixingratioToPermil
parent
53c24486
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/ctc13/obspack.py
+9
-17
9 additions, 17 deletions
da/ctc13/obspack.py
with
9 additions
and
17 deletions
da/ctc13/obspack.py
+
9
−
17
View file @
313fd30b
...
...
@@ -138,8 +138,10 @@ class ObsPackObservations(Observation):
"""
Adds model simulated values to the mixing ratio objects
"""
import
da.tools.io4
as
io
import
da.tools.MixingratioToPermil
as
mtp
from
numpy
import
array
if
not
os
.
path
.
exists
(
filename
):
msge
=
"
Sample output filename for observations could not be found : %s
"
%
filename
;
logging
.
error
(
msge
)
msg
=
"
Did the sampling step succeed?
"
;
logging
.
error
(
msg
)
...
...
@@ -169,21 +171,11 @@ class ObsPackObservations(Observation):
trjoin
=
[
''
.
join
(
trspecies
[
i
,:])]
tr_species
.
append
(
trjoin
[
0
].
strip
())
tr_species
=
array
(
tr_species
)
print
obs_species
print
'
obs_species
'
,
obs_species
print
'
trspecies
'
,
tr_species
simulated
=
simulated
*
1.e6
trlength
=
len
(
simulated
[
0
,:])
memlength
=
trlength
/
2
print
simulated
[:,
0
:
memlength
]
print
simulated
[:,
memlength
:
trlength
]
print
simulated
[:,
39
]
print
simulated
[:,
79
]
print
1000.
*
((
simulated
[:,
79
]
/
simulated
[:,
39
]
/
0.011112
)
-
1.
)
simulated
[:,
memlength
:
trlength
]
=
1000.
*
((
simulated
[:,
memlength
:
trlength
]
/
simulated
[:,
0
:
memlength
]
/
0.011112
)
-
1.
)
print
simulated
simulated
=
mtp
.
MixingratioToPermil
(
filename
,
simulated
)
for
id
,
obs_specie
,
val
in
zip
(
ids
,
obs_species
,
simulated
):
print
id
,
obs_ids
print
obs_specie
,
tr_species
...
...
@@ -589,17 +581,17 @@ if __name__ == "__main__":
import
logging
from
da.tools.initexit
import
CycleControl
from
da.ct.dasystem
import
CtDaSystem
from
da.ct
gridded
.statevector
import
Ct
Gridded
StateVector
from
da.ct.statevector
import
CtStateVector
sys
.
path
.
append
(
'
../../
'
)
logging
.
root
.
setLevel
(
logging
.
DEBUG
)
DaCycle
=
CycleControl
(
args
=
{
'
rc
'
:
'
../../da
griddedjet
.rc
'
})
DaCycle
=
CycleControl
(
args
=
{
'
rc
'
:
'
../../da.rc
'
})
DaCycle
.
Initialize
()
DaCycle
.
ParseTimes
()
DaSystem
=
CtDaSystem
(
'
../
rc
/carbontracker.rc
'
)
DaSystem
=
CtDaSystem
(
'
../
..
/carbontracker.rc
'
)
DaSystem
.
Initialize
()
DaCycle
.
DaSystem
=
DaSystem
...
...
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