Commit fb2a70b7 authored by Florentie, Liesbeth's avatar Florentie, Liesbeth
Browse files

fixed an error that caused the new location of moved observation locations not to be saved

parent 8184dbc5
......@@ -69,6 +69,10 @@ class ObsPackObservations(Observations):
self.sites_file = dacycle.dasystem['obs.sites.rc']
def get_samples_type(self):
return 'flask'
def add_observations(self):
""" Returns a MoleFractionList holding individual MoleFractionSample objects for all obs in a file
......@@ -390,7 +394,9 @@ class ObsPackObservations(Observations):
else: species, site, method, lab, datasetnr = identifier.split('_')
if site_info.has_key(identifier):
if site_info[identifier]['category'] != 'do-not-use' and obs.flag != 99:
if site_info[identifier]['category'] == 'do-not-use' or obs.flag == 99:
obs.flag = 99
else:
if site_info[identifier]['category'] == 'aircraft':
nr_obs_per_day = 1
else:
......@@ -400,9 +406,6 @@ class ObsPackObservations(Observations):
obs.may_localize = site_info[identifier]['may_localize']
obs.may_reject = site_info[identifier]['may_reject']
obs.flag = 0
obs_to_keep.append(obs)
elif obs.flag == 99:
logging.info('Observation has flag 99, excluded from assimilation')
else:
logging.warning("Observation NOT found (%s, %d), please check sites.rc file (%s) !!!" % (identifier, obs.id, self.sites_file))
......@@ -417,11 +420,10 @@ class ObsPackObservations(Observations):
obs.height = obs.height + incalt
logging.warning("Observation location for (%s, %d), is moved by %3.2f meters in altitude" % (identifier, obs.id, incalt))
if advance == False:
if obs.flag > 80:
self.datalist.remove(obs)
logging.debug('Dropped observation from datalist, as it is not to be assimilated')
if advance == False and obs.flag > 80:
logging.debug('Dropped observation from datalist, as it is not to be assimilated')
else:
obs_to_keep.append(obs)
# Only keep obs in datalist that will be used in assimilation
self.datalist = obs_to_keep
......
Markdown is supported
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