Commit 42dd26fc authored by ivar's avatar ivar
Browse files

Added a CO filter to exclude observations with high levels of carbon monoxide

parent 5d709b54
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment