Commit 845f7c35 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

added increase of site altitude

parent 65700662
......@@ -29,7 +29,7 @@ import as rc
class ObsPackObservations(Observations):
""" an object that holds data + methods and attributes needed to manipulate mixing ratio values """
def initialize(self, dacycle):
def setup(self, dacycle):
self.startdate = dacycle['time.sample.start']
self.enddate = dacycle['time.sample.end']
......@@ -290,6 +290,7 @@ class ObsPackObservations(Observations):
site_info = {}
site_move = {}
site_hourly = {} # option added to include only certain hours of the day (for e.g. PAL) IvdL
site_incalt = {} # option to increase sampling altitude for sites specified in sites and weights file
for key, value in sites_weights.iteritems():
if 'co2_' in key or 'sf6' in key: # to be fixed later, do not yet know how to parse valid keys from rc-files yet.... WP
sitename, sitecategory = key, value
......@@ -302,6 +303,10 @@ class ObsPackObservations(Observations):
if 'site.hourly' in key:
identifier, hourfrom, hourto = value.split(';')
site_hourly[identifier.strip()] = (int(hourfrom), int(hourto))
if 'site.incalt' in key:
identifier, incalt = value.split(';')
site_incalt[identifier.strip()] = (int(incalt))
for obs in self.datalist: # loop over all available data points
......@@ -344,11 +349,20 @@ class ObsPackObservations(Observations):
logging.warning("Observation location for (%s, %d), is moved by %3.2f degrees latitude and %3.2f degrees longitude" % (identifier,, movelat, movelon))
if site_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,, incalt))
# Add site_info dictionary to the Observations object for future use
self.site_info = site_info
self.site_move = site_move
self.site_hourly = site_hourly
self.site_incalt = site_incalt
logging.debug("Added Model Data Mismatch to all samples ")
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