Skip to content
Snippets Groups Projects
Commit b0023cc6 authored by ivar's avatar ivar
Browse files

added code to have different model-data mismatch in summer and winter

parent 3279f01c
Branches
No related tags found
No related merge requests found
......@@ -370,12 +370,13 @@ class ObsPackObservations(Observations):
site_categories = {}
for key in cats:
name, error, may_localize, may_reject = sites_weights[key].split(';')
name, error_summer, error_winter , may_localize, may_reject = sites_weights[key].split(';')
name = name.strip().lower()
error = float(error)
error_summer = float(error_summer)
error_winter = float(error_winter)
may_reject = ("TRUE" in may_reject.upper())
may_localize = ("TRUE" in may_localize.upper())
site_categories[name] = {'category': name, 'error': error, 'may_localize': may_localize, 'may_reject': may_reject}
site_categories[name] = {'category': name, 'error_summer': error_summer, 'error_winter': error_winter ,'may_localize': may_localize, 'may_reject': may_reject}
site_info = {}
site_move = {}
......@@ -432,26 +433,23 @@ class ObsPackObservations(Observations):
else:
logging.warning("Observation in hourly dataset EXCLUDED, while UTC sampling time %s was outside local %s:00-%s:00"%(obs.xdate.time(),hourf,hourt))
exclude_hourly = True
if site_info[identifier]['category'] == 'do-not-use' or exclude_hourly or exclude_footprint:
if site_info[identifier]['category'] == 'do-not-use' or site_info[identifier]['category'] == 'do-not-simulate' or exclude_hourly or exclude_footprint:
logging.warning("Site found (%s, %d), but data point not used in assimilation !!!" % (identifier, obs.id))
obs.mdm = site_info[identifier]['error'] * self.global_R_scaling
obs.may_localize = site_info[identifier]['may_localize']
obs.may_reject = site_info[identifier]['may_reject']
obs.flag = 99
if site_info[identifier]['category'] == 'do-not-simulate' or exclude_hourly or exclude_footprint:
logging.warning("Site found (%s, %d), but data point not used in simulation !!!" % (identifier, obs.id))
obs.mdm = site_info[identifier]['error'] * self.global_R_scaling
if int(obs.xdate.month) > 3 and int(obs.xdate.month) < 10:
obs.mdm = site_info[identifier]['error_summer'] * self.global_R_scaling
else:
obs.mdm = site_info[identifier]['error_winter'] * self.global_R_scaling
obs.may_localize = site_info[identifier]['may_localize']
obs.may_reject = site_info[identifier]['may_reject']
obs.flag = 99
do_not_simulate.append(i)
#print s_index
#self.datalist.remove(self.datalist[s_index])
#del self.datalist[s_index]
#removed = self.datalist.pop(s_index)
if site_info[identifier]['category'] == 'do-not-simulate':
do_not_simulate.append(i)
else:
logging.debug("Site found (%s, %d)" % (identifier, obs.id))
obs.mdm = site_info[identifier]['error'] * self.global_R_scaling
if int(obs.xdate.month) > 3 and int(obs.xdate.month) < 10:
obs.mdm = site_info[identifier]['error_summer'] * self.global_R_scaling
else:
obs.mdm = site_info[identifier]['error_winter'] * self.global_R_scaling
obs.may_localize = site_info[identifier]['may_localize']
obs.may_reject = site_info[identifier]['may_reject']
obs.flag = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment