Commit 423f9874 authored by Peters, Wouter's avatar Peters, Wouter
Browse files

update of io function names for reading/writing of netcdf data and attributes

parent 7b4208fa
......@@ -61,7 +61,7 @@ class CO2Observations(Observations):
For now, we will stick with option (1)
"""
ncf = io.CT_Read(self.obs_filename, 'read')
ncf = io.ct_read(self.obs_filename, 'read')
idates = ncf.get_variable('date_components')
dates = array([dtm.datetime(*d) for d in idates])
......@@ -108,7 +108,7 @@ class CO2Observations(Observations):
logging.error("...exiting")
raise IOError, msg
ncf = io.CT_Read(filename, method='read')
ncf = io.ct_read(filename, method='read')
ids = ncf.get_variable('obs_num')
simulated = ncf.get_variable('flask')
ncf.close()
......
......@@ -79,7 +79,7 @@ class ObsPackObservations(Observations):
for ncfile in ncfilelist:
infile = os.path.join(self.obspack_dir, 'data', 'nc', ncfile)
ncf = io.CT_Read(infile, 'read')
ncf = io.ct_read(infile, 'read')
idates = ncf.get_variable('time_components')
dates = array([dtm.datetime(*d) for d in idates])
......@@ -91,12 +91,12 @@ class ObsPackObservations(Observations):
evn = ncf.get_variable('obspack_id').take(subselect, axis=0)
evn = [s.tostring().lower() for s in evn]
evn = map(strip, evn)
site = ncf.GetAttribute('site_code')
site = ncf.get_attribute('site_code')
lats = ncf.get_variable('latitude').take(subselect, axis=0)
lons = ncf.get_variable('longitude').take(subselect, axis=0)
alts = ncf.get_variable('altitude').take(subselect, axis=0)
obs = ncf.get_variable('value').take(subselect, axis=0)
species = ncf.GetAttribute('dataset_parameter')
species = ncf.get_attribute('dataset_parameter')
#strategy = ncf.get_variable('sampling_strategy').take(subselect,axis=0)
strategy = 1
flags = ncf.get_variable('qc_flag').take(subselect, axis=0)
......@@ -122,7 +122,7 @@ class ObsPackObservations(Observations):
logging.error("...exiting")
raise IOError, msg
ncf = io.CT_Read(filename, method='read')
ncf = io.ct_read(filename, method='read')
ids = ncf.get_variable('obs_num')
simulated = ncf.get_variable('flask')
ncf.close()
......@@ -467,4 +467,4 @@ class MixingRatioSample(object):
if __name__ == "__main__":
pass
\ No newline at end of file
pass
......@@ -78,7 +78,7 @@ class ObsPackObservations(Observations):
for ncfile in ncfilelist:
infile = os.path.join(self.obspack_dir, 'data', 'nc', ncfile + '.nc')
ncf = io.CT_Read(infile, 'read')
ncf = io.ct_read(infile, 'read')
idates = ncf.get_variable('time_components')
dates = array([dtm.datetime(*d) for d in idates])
......@@ -95,7 +95,7 @@ class ObsPackObservations(Observations):
lons = ncf.get_variable('longitude').take(subselect, axis=0)
alts = ncf.get_variable('altitude').take(subselect, axis=0)
obs = ncf.get_variable('value').take(subselect, axis=0)
species = ncf.GetAttribute('dataset_parameter')
species = ncf.get_attribute('dataset_parameter')
flags = ncf.get_variable('obs_flag').take(subselect, axis=0)
ncf.close()
......@@ -117,7 +117,7 @@ class ObsPackObservations(Observations):
logging.error("...exiting")
raise IOError, msg
ncf = io.CT_Read(filename, method='read')
ncf = io.ct_read(filename, method='read')
ids = ncf.get_variable('obs_num')
simulated = ncf.get_variable('flask')
ncf.close()
......@@ -162,7 +162,7 @@ class ObsPackObservations(Observations):
for key, value in self.site_move.iteritems():
msg = "Site is moved by %3.2f degrees latitude and %3.2f degrees longitude" % value
f.AddAttribute(key, msg)
f.add_attribute(key, msg)
data = self.getvalues('id')
......@@ -372,7 +372,7 @@ class ObsPackObservations(Observations):
for key, value in self.site_move.iteritems():
msg = "Site is moved by %3.2f degrees latitude and %3.2f degrees longitude" % value
f.AddAttribute(key, msg)
f.add_attribute(key, msg)
data = self.getvalues('id')
......
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