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
7a8de66c
Commit
7a8de66c
authored
9 years ago
by
Ingrid Luijkx
Browse files
Options
Downloads
Patches
Plain Diff
Faster method to look up obs_nums, especially useful for GLOBALVIEWplus ObsPack hourly time series
parent
97b8c37c
No related branches found
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/analysis/expand_molefractions.py
+7
-13
7 additions, 13 deletions
da/analysis/expand_molefractions.py
with
7 additions
and
13 deletions
da/analysis/expand_molefractions.py
+
7
−
13
View file @
7a8de66c
...
...
@@ -41,10 +41,9 @@ def write_mole_fractions(dacycle):
"""
dirname
=
create_dirs
(
os
.
path
.
join
(
dacycle
[
'
dir.analysis
'
],
'
data_molefractions
'
))
#
# Some help variables
#
dectime0
=
date2num
(
datetime
(
2000
,
1
,
1
))
#
# Some help variables
#
dt
=
dacycle
[
'
cyclelength
'
]
startdate
=
dacycle
[
'
time.start
'
]
enddate
=
dacycle
[
'
time.end
'
]
...
...
@@ -78,7 +77,6 @@ def write_mole_fractions(dacycle):
for
ff
in
infiles1
:
infiles
.
append
(
ff
.
replace
(
d2
,
d1
))
#infiles = [join(s.compressed(),'') for s in infilename]
ncf_in
.
close
()
...
...
@@ -112,7 +110,6 @@ def write_mole_fractions(dacycle):
filesitecode
=
ncf_fc_in
.
get_variable
(
'
sitecode
'
)
fc_sitecodes
=
netCDF4
.
chartostring
(
filesitecode
).
tolist
()
#fc_sitecodes = [join(s.compressed(),'') for s in filesitecode]
ncf_fc_in
.
close
()
...
...
@@ -278,11 +275,8 @@ def write_mole_fractions(dacycle):
for
num
in
selected_obs_nums
:
model_index
=
obs_num
.
tolist
().
index
(
num
)
file_index
=
file_obs_nums
.
tolist
().
index
(
num
)
#var = ncf_out.variables['modeldatamismatch'] # Take from optimizer.yyyymmdd.nc file instead
#var[file_index] = mdm[model_index]
model_index
=
np
.
where
(
obs_num
==
num
)[
0
][
0
]
file_index
=
np
.
where
(
file_obs_nums
==
num
)[
0
][
0
]
var
=
ncf_out
.
variables
[
'
modelsamplesmean
'
]
var
[
file_index
]
=
simulated
[
model_index
,
0
]
...
...
@@ -301,8 +295,8 @@ def write_mole_fractions(dacycle):
for
num
in
selected_fc_obs_nums
:
model_index
=
fc_obs_num
.
tolist
().
index
(
num
)
file_index
=
file_obs_nums
.
tolist
().
index
(
num
)
model_index
=
np
.
where
(
fc_obs_num
==
num
)[
0
][
0
]
file_index
=
np
.
where
(
file_obs_nums
==
num
)[
0
][
0
]
var
=
ncf_out
.
variables
[
'
modeldatamismatch
'
]
var
[
file_index
]
=
np
.
sqrt
(
fc_r
[
model_index
])
...
...
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