PYTHON: Make sure dataset() accepts maxlev > 9.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
c2c9c37b45
commit
b7496e0b3d
@ -899,7 +899,7 @@ class Amun:
|
|||||||
return dset
|
return dset
|
||||||
|
|
||||||
|
|
||||||
def dataset(self, dataset_name, extent=None, maxlev=-1, shrink=1, \
|
def dataset(self, dataset_name, extent=None, maxlev=None, shrink=1, \
|
||||||
interpolation='rebin', order=3, progress=False):
|
interpolation='rebin', order=3, progress=False):
|
||||||
"""
|
"""
|
||||||
Function returns dataset of the requested variable resampled to
|
Function returns dataset of the requested variable resampled to
|
||||||
@ -933,7 +933,8 @@ class Amun:
|
|||||||
if any(slo > dup) or any(sup < dlo) or any (slo >= sup):
|
if any(slo > dup) or any(sup < dlo) or any (slo >= sup):
|
||||||
raise Exception("Wrong order of the dimensions in the argument 'extent'!")
|
raise Exception("Wrong order of the dimensions in the argument 'extent'!")
|
||||||
|
|
||||||
if isinstance(maxlev,int):
|
if maxlev != None:
|
||||||
|
if isinstance(maxlev, (int, np.int32)):
|
||||||
if 1 <= maxlev <= self.attributes['maxlev']:
|
if 1 <= maxlev <= self.attributes['maxlev']:
|
||||||
shrink = 2**(self.attributes['maxlev']-maxlev)
|
shrink = 2**(self.attributes['maxlev']-maxlev)
|
||||||
elif maxlev > self.attributes['maxlev']:
|
elif maxlev > self.attributes['maxlev']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user