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
Smith, Naomi
CTDAS
Commits
42dd26fc
Commit
42dd26fc
authored
Aug 24, 2015
by
ivar
Browse files
Added a CO filter to exclude observations with high levels of carbon monoxide
parent
5d709b54
Changes
1
Hide whitespace changes
Inline
Side-by-side
da/stilt/obspack.py
View file @
42dd26fc
...
...
@@ -338,7 +338,7 @@ class ObsPackObservations(Observations):
def
add_model_data_mismatch
(
self
,
filename
):
def
add_model_data_mismatch
(
self
,
filename
,
filename_cofilter
):
"""
Get the model-data mismatch values for this cycle.
...
...
@@ -405,6 +405,18 @@ class ObsPackObservations(Observations):
#for obs in self.datalist:
do_not_simulate
=
[]
do_simulate
=
[]
eventids
=
[]
for
line
in
open
(
filename_cofilter
):
columns
=
line
.
split
()
if
columns
[
0
]
==
"eventid"
:
pass
else
:
eventids
.
append
(
columns
[
0
])
eventids
=
array
(
eventids
)
logging
.
info
(
'eventids %s'
%
eventids
)
for
i
,
obs
in
enumerate
(
self
.
datalist
):
obs
.
mdm
=
1000.0
# default is very high model-data-mismatch, until explicitly set by script
obs
.
flag
=
99
# default is do-not-use , until explicitly set by script
...
...
@@ -414,6 +426,8 @@ class ObsPackObservations(Observations):
identifier
=
obs
.
code
species
,
site
,
method
,
lab
,
datasetnr
=
identifier
.
split
(
'_'
)
if
site_info
.
has_key
(
identifier
):
if
site_foot
.
has_key
(
identifier
):
path_foot
=
site_foot
[
identifier
]
...
...
@@ -422,6 +436,9 @@ class ObsPackObservations(Observations):
str_id
=
'%s'
%
obs
.
id
if
any
(
str_id
in
s
for
s
in
files_foot
):
logging
.
info
(
"id in footprint %s"
%
str_id
)
if
any
(
str_id
in
t
for
t
in
eventids
):
exclude_footprint
=
True
logging
.
info
(
"id in CO list, exclude this observation %s"
%
str_id
)
else
:
exclude_footprint
=
True
logging
.
info
(
"id not in footprint %s"
%
str_id
)
...
...
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