Commit 7245a99b authored by Jeff Piollé's avatar Jeff Piollé

updated old-style classes

parent 4fad655b
<component name="ProjectDictionaryState">
<dictionary name="jfpiolle">
<words>
<w>cerbere</w>
<w>xarray</w>
</words>
</dictionary>
</component>
\ No newline at end of file
......@@ -43,11 +43,11 @@ class ECMWF05NCFile(NCFile):
super(ECMWF05NCFile, self).__init__(url=url,center_on_greenwhich=True, **kwargs)
return
def open(self,
view=None,
datamodel=None,
datamodel_geolocation_dims=None):
handler = super(ECMWF05NCFile, self).open(view=view,datamodel='Grid',datamodel_geolocation_dims=datamodel_geolocation_dims)
def _open(self,
view=None,
datamodel=None,
datamodel_geolocation_dims=None):
handler = super(ECMWF05NCFile, self)._open(view=view, datamodel='Grid', datamodel_geolocation_dims=datamodel_geolocation_dims)
return handler
def get_fieldnames(self):
......
......@@ -44,9 +44,9 @@ class GHRSSTNCFile(Dataset):
self.__collection_id = None
def open(self, **kwargs):
def _open(self, **kwargs):
# url needs to be opened first in order to guess default datamodel
super().open(**kwargs)
super()._open(**kwargs)
# recompose and unpack time variable if required
self._unsplit_time_coord(split_time=('time', 'sst_dtime'), unpack=True)
......
......@@ -78,7 +78,7 @@ class GribFile(AbstractMapper):
logging.debug("opening in mode : %s", self._mode)
logging.debug("url : %s", url)
# print "START", url
self._handler = pygrib.open(url)
self._handler = pygrib._open(url)
# print "OPEN"
# get list of fields
self._handler.seek(0)
......
......@@ -82,7 +82,7 @@ class GribFile(AbstractMapper):
logging.debug("opening in mode : %s", self._mode)
logging.debug("url : %s", url)
# print "START", url
self._handler = pygrib.open(url)
self._handler = pygrib._open(url)
# print "OPEN"
# get list of fields
self._handler.seek(0)
......
......@@ -48,7 +48,7 @@ logging.info("")
logging.info("Open file")
f = classreader(url=infile)
f.open()
f._open()
logging.info("OK")
logging.info("")
......
......@@ -61,7 +61,7 @@ def test_lonlat(hh):
# sensinle_heat = hh.read_values('shtfl')
def recup_var_names_with_pygrib(ff):
grbs=pygrib.open(ff)
grbs=pygrib._open(ff)
print dir(grbs)
grbs.message(6).data()[1].shape
for dodo in range(grbs.messages):
......
......@@ -22,7 +22,7 @@ elif 'S3A_OL_2_WRR' in fname or 'S3A_OL_2_WFR' in fname:
ncf = SAFEOLFile(url=fname)
print 'OPEN'
ncf.open()
ncf._open()
print '\n\nFIELDS :'
fields = ncf.get_fieldnames()
......
......@@ -61,7 +61,7 @@ else:
print 'OPEN'
ncf.open()
ncf._open()
print '\n\nFIELDS :'
fields = ncf.get_fieldnames()
......
......@@ -10,7 +10,7 @@ f = '/home/cerdata/provider/ncep/model/cfsr/monthly/1999/03/pgbhnl.gdas.199903.g
gribm = mapper.gribfile.GribFile(url=f)
gribm.open()
gribm._open()
attrs = gribm.read_field_attributes('msl')
for k in attrs:
......
Markdown is supported
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