Commit 09e7dfe1 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

rolled back some changes to interface of calls

parent 78370143
......@@ -26,15 +26,15 @@ from da.baseclasses.obs import Observation
class CtObservations(Observation):
""" an object that holds data + methods and attributes needed to manipulate mixing ratio values """
def Initialize(self, start, end, params):
self.startdate = start
self.enddate = end
def Initialize(self):
self.startdate = self.DaCycle['time.sample.start']
self.enddate = self.DaCycle['time.sample.end']
sfname = params['obs.input.fname']
sfname = self.DaCycle.DaSystem['obs.input.fname']
if sfname.endswith('.nc'):
filename = os.path.join(params['obs.input.dir'], sfname)
filename = os.path.join(self.DaCycle.DaSystem['obs.input.dir'], sfname)
else:
filename = os.path.join(params['obs.input.dir'], sfname + '.' + self.startdate.strftime('%Y%m%d') + '.nc')
filename = os.path.join(self.DaCycle.DaSystem['obs.input.dir'], sfname + '.' + self.startdate.strftime('%Y%m%d') + '.nc')
if not os.path.exists(filename):
msg = 'Could not find the required observation input file (%s) ' % filename
......@@ -136,14 +136,14 @@ class CtObservations(Observation):
logging.debug("Added %d simulated values to the Data list" % (len(ids) - len(missing_samples)))
def write_sample_info(self, dirinput, timestamp):
def write_sample_info(self):
"""
Write the information needed by the observation operator to a file. Return the filename that was written for later use
"""
import da.tools.io4 as io
obsinputfile = os.path.join(dirinput, 'observations_%s.nc' % timestamp)
obsinputfile = os.path.join(self.DaCycle['dir.input'], 'observations_%s.nc' % self.DaCycle['time.sample.stamp'])
f = io.CT_CDF(obsinputfile, method='create')
logging.debug('Creating new observations file for ObservationOperator (%s)' % obsinputfile)
......@@ -241,7 +241,7 @@ class CtObservations(Observation):
return obsinputfile
def add_model_data_mismatch(self, filename):
def add_model_data_mismatch(self):
"""
Get the model-data mismatch values for this cycle.
......@@ -253,7 +253,7 @@ class CtObservations(Observation):
"""
import da.tools.rc as rc
filename = self.DaCycle.DaSystem['obs.sites.rc']
if not os.path.exists(filename):
msg = 'Could not find the required sites.rc input file (%s)' % filename
......@@ -314,14 +314,14 @@ class CtObservations(Observation):
self.SiteInfo = SiteInfo
def write_obs_to_file(self, outdir, timestamp, filenam="oldstyle"):
def write_obs_to_file(self,filenam="oldstyle"):
"""
Write selected information contained in the Observation object to a file.
"""
import da.tools.io4 as io
outfile = os.path.join(outdir, 'sampleinfo_%s__%s.nc' % (timestamp, filenam))
outfile = os.path.join(self.DaCycle['dir.output'], 'sampleinfo_%s__%s.nc' % (self.DaCycle['time.sample.stamp'], filenam))
f = io.CT_CDF(outfile, method='create')
logging.debug('Creating new Sample output file for postprocessing (%s)' % outfile)
......
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