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