Commit 014618e8 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

provision for empty obs lists made

parent a1747d9d
......@@ -170,10 +170,14 @@ class CtObservations(Observation):
msg = 'Creating new observations file for ObservationOperator (%s)' % obsinputfile ; logging.debug(msg)
dimid = f.AddDim('obs',len(self.Data))
dim50char = f.AddDim('string_of50chars',50)
dim200char = f.AddDim('string_of200chars',200)
dim10char = f.AddDim('string_of10chars',10)
dimcalcomp = f.AddDim('calendar_components',6)
if len(self.Data) == 0:
f.close()
return obsinputfile
data = self.Data.getvalues('id')
savedict = io.std_savedict.copy()
......@@ -251,7 +255,7 @@ class CtObservations(Observation):
savedict['dtype'] = "char"
savedict['name'] = "obs_id"
savedict['units'] = "NOAA database identifier"
savedict['dims'] = dimid+dim50char
savedict['dims'] = dimid+dim200char
savedict['values'] = data
savedict['missing_value'] = '-'
savedict['_FillValue'] = '-'
......@@ -355,10 +359,14 @@ class CtObservations(Observation):
msg = 'Creating new Sample output file for postprocessing (%s)' % outfile ; logging.debug(msg)
dimid = f.AddDim('obs',len(self.Data))
dim200char = f.AddDim('string_of50chars',200)
dim200char = f.AddDim('string_of200chars',200)
dim10char = f.AddDim('string_of10chars',10)
dimcalcomp = f.AddDim('calendar_components',6)
if len(self.Data) == 0:
f.close()
return outfile
data = self.Data.getvalues('id')
savedict = io.std_savedict.copy()
......
......@@ -182,6 +182,10 @@ class ObsPackObservations(Observation):
dim10char = f.AddDim('string_of10chars',10)
dimcalcomp = f.AddDim('calendar_components',6)
if len(self.Data) == 0:
f.close()
return obsinputfile
data = self.Data.getvalues('id')
savedict = io.std_savedict.copy()
......@@ -370,10 +374,14 @@ class ObsPackObservations(Observation):
msg = 'Creating new Sample output file for postprocessing (%s)' % outfile ; logging.debug(msg)
dimid = f.AddDim('obs',len(self.Data))
dim200char = f.AddDim('string_of50chars',200)
dim200char = f.AddDim('string_of200chars',200)
dim10char = f.AddDim('string_of10chars',10)
dimcalcomp = f.AddDim('calendar_components',6)
if len(self.Data) == 0:
f.close()
return outfile
data = self.Data.getvalues('id')
savedict = io.std_savedict.copy()
......
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