logging.debug("Observation found (%s, %d), mdm category is: %0.2f, scaled with number of observations per day (%i), final mdm applied is: %0.2f."%(identifier,obs.id,site_info[identifier]['error'],nr_obs_per_day,site_info[identifier]['error']*sqrt(nr_obs_per_day)))
logging.warning("Observation NOT found (%s, %d), please check sites.rc file (%s) !!!"%(identifier,obs.id,self.sites_file))
ifsite_move.has_key(identifier):
movelat,movelon=site_move[identifier]
obs.lat=obs.lat+movelat
obs.lon=obs.lon+movelon
logging.warning("Observation location for (%s, %d), is moved by %3.2f degrees latitude and %3.2f degrees longitude"%(identifier,obs.id,movelat,movelon))
ifsite_incalt.has_key(identifier):
incalt=site_incalt[identifier]
obs.height=obs.height+incalt
logging.warning("Observation location for (%s, %d), is moved by %3.2f meters in altitude"%(identifier,obs.id,incalt))
# Add site_info dictionary to the Observations object for future use
self.site_info=site_info
self.site_move=site_move
self.site_incalt=site_incalt
logging.debug("Added Model Data Mismatch to all samples ")
defwrite_sample_auxiliary(self,auxoutputfile):
"""
Write selected information contained in the Observations object to a file.
"""
f=io.CT_CDF(auxoutputfile,method='create')
logging.debug('Creating new auxiliary sample output file for postprocessing (%s)'%auxoutputfile)
dimid=f.add_dim('obs',len(self.datalist))
dim200char=f.add_dim('string_of200chars',200)
dim10char=f.add_dim('string_of10chars',10)
dimcalcomp=f.add_dim('calendar_components',6)
iflen(self.datalist)==0:
f.close()
#return outfile
forkey,valueinself.site_move.iteritems():
msg="Site is moved by %3.2f degrees latitude and %3.2f degrees longitude"%value