Commit 4835ceec authored by ivar's avatar ivar
Browse files

Removed bug in add_model_data_mismatch. Without the do-not-simulate flag in...

Removed bug in add_model_data_mismatch. Without the  do-not-simulate flag in sites_and_weights.rc file the complete data list was returned instead the trimmed down list that is filtered.
parent 2e090e13
......@@ -421,48 +421,6 @@ class ObsPackObservations(Observations):
eventids=array(eventids)
logging.info('eventids %s'%eventids)
paired_flag=zeros((len(self.datalist)),)
paired_flag[:]=False
filtered_obs=zeros((len(self.datalist)),)
counter=1.
counter2=1.
for i,obs in enumerate(self.datalist):
psite=obs.code
pday=obs.xdate.day
pobs=obs.obs
if i >0:
if pday == pday_old and psite == psite_old
paired_flag[i]= True
paired_flag[i-1]= True
if pobs -pobs_prev <1.0:
pobs_avr=(pobs+pobs_avr)
counter = counter+1.
counter2 = counter2+1.
filtered_obs[i] =0.
else:
filtered_obs[i]=0.
counter2 = counter2+1.
else:
pday_prev= pday
psite_prev = psite
pobs_prev = pobs
paired_flag[i]=False
filtered_obs[i-counter2]=pobs_avr/counter
counter=1.
counter2=1.
else:
pday_prev= pday
psite_prev = psite
pobs_prev = pobs
paired_flag[i] = False
pobs_avr = pobs
filtered_obs[i] = pobs
logging.info("Boolean list paired observations: %s"%paired_flag)
logging.info("Obs list paired observations: %s"%filtered_obs)
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
......@@ -550,7 +508,6 @@ class ObsPackObservations(Observations):
self.datalist = [self.datalist[k] for k in do_simulate]
logging.info("After multple filters observations list now holds %d values" % len(self.datalist))
# Add site_info dictionary to the Observations object for future use
self.site_info = site_info
......
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