Commit abc9a172 authored by Fabian Wachsmann's avatar Fabian Wachsmann
Browse files

Include get varname into other functions

parent 5ac1bbbe
......@@ -27,8 +27,8 @@ class Tzis():
self.store=SwiftStore(os_container, prefix=os_name, storage_options=self.auth)
self.verbose=verbose
#
self.varname=varname
self.mf_dset=self.open_mf_dataset(mf_dset, xarray_kwargs=xarray_kwargs)
self.varname=self._get_varname(varname)
def open_mf_dataset(self, mf, xarray_kwargs=None):
#if type(mf) != list and type(mf) != str :
......@@ -42,18 +42,13 @@ class Tzis():
coords='minimal',
compat='override',
**xarray_kwargs)
if not self.varname :
self.varname = self.mf_dset.variables
if self.verbose :
print("We use variable {0} in case we need to rechunk.".format(varname))
return self.mf_dset
return None
def _get_varname(self,
varname=None):
if not varname and self.mf_dset :
if self.mf_dset.variables :
varname=self.mf_dset.variables[0]
if varname and self.verbose :
print("We use variable {0} in case we need to rechunk.".format(varname))
return varname
def open_store(self, os_name):
self.store.prefix=os_name
return self.store
......
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