Omaha #4259 Fix error in SmartScript.getGrids that caused scalar grids to fail.

Change-Id: Ief6e27abe1824c326550837e2bc0a8ab2e276a98

Former-commit-id: 686ab4bd37aa6cc656fdb1e8622a87a84872529a
This commit is contained in:
Ron Anderson 2015-07-08 12:42:54 -05:00
parent 4626fd62a9
commit 5eac3a423a

View file

@ -504,14 +504,14 @@ class SmartScript(BaseTool.BaseTool):
else: else:
result = result[0]; result = result[0];
slice = result.getGridSlice() slice = result.getGridSlice()
result = slice.getNDArray() retVal = slice.getNDArray()
if type(result) is ndarray and result.dtype == numpy.int8: if type(retVal) is ndarray and retVal.dtype == numpy.int8:
# discrete or weather # discrete or weather
keys = JUtil.javaObjToPyVal(slice.getKeyList()) keys = JUtil.javaObjToPyVal(slice.getKeyList())
retVal = (result, keys) retVal = (retVal, keys)
elif type(result) is not numpy.ndarray and len(result) == 2: elif type(retVal) is not numpy.ndarray and len(retVal) == 2:
# vector # vector
retVal = tuple(result) retVal = tuple(retVal)
if retVal is None or retVal == []: if retVal is None or retVal == []:
if noDataError == 1: if noDataError == 1: