From c333277d3068edcf30f32f8e4f2d7de3f13cc20b Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Tue, 6 May 2014 17:08:04 -0500 Subject: [PATCH] Issue #3101 fix some derived parameters on win64 platform Change-Id: I9de1d31e7f7c19af437aef834aa84f163bf36d86 Former-commit-id: 3aa9bfdca1a089ad7b30ffa87058bf293e1b37a0 [formerly 49d34cc4e4acb677d4f79e975e799c7dc60c9700] [formerly 5191b61b30f8e588052c95cdcd179c181ad61776] [formerly aa7c1fac905c86402db9a0ab6dea259165be4928 [formerly 5191b61b30f8e588052c95cdcd179c181ad61776 [formerly 4659c0240aa31b615bc50228906d514f47a72f94]]] Former-commit-id: aa7c1fac905c86402db9a0ab6dea259165be4928 Former-commit-id: e218d9c6b2e2544a412d7bf24b528ba73c8cd8fc [formerly 8c1748d3701b9d851b88e9a6ecb1b29e76a86f9b] Former-commit-id: 815aa21d8e7d99a604672430bed7eadee1f7e651 --- .../base/derivedParameters/functions/Cape.py | 19 +++++++++++++------ .../base/derivedParameters/functions/Dcape.py | 4 +++- .../derivedParameters/functions/Filter.py | 10 +++++++++- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Cape.py b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Cape.py index da98d5c111..d18b656da9 100644 --- a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Cape.py +++ b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Cape.py @@ -18,6 +18,14 @@ # further licensing information. ## +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# --/--/----- Initial creation +# May 06, 2014 3101 njensen Cast numpy shape values to int +# for cross platform compatibility + from com.raytheon.uf.common.derivparam.python.function import CapeFuncPythonAdapter as CapeFunc from numpy import zeros @@ -90,9 +98,8 @@ def __execute(*args): pressureValue = pressure pressure = zeros(temperatureValues.shape, temperatureValues.dtype) pressure[:] = pressureValue - if upperTerminationPressure is None: - threeDshape = pressureValues.shape - return CapeFunc.capeFunc(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, threeDshape[1], threeDshape[2], threeDshape[0]).__numpy__ - else: - threeDshape = pressureValues.shape - return CapeFunc.capeFuncTop(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, upperTerminationPressure, threeDshape[1], threeDshape[2], threeDshape[0]).__numpy__ + threeDshape = pressureValues.shape + if upperTerminationPressure is None: + return CapeFunc.capeFunc(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, int(threeDshape[1]), int(threeDshape[2]), int(threeDshape[0])).__numpy__ + else: + return CapeFunc.capeFuncTop(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, upperTerminationPressure, int(threeDshape[1]), int(threeDshape[2]), int(threeDshape[0])).__numpy__ diff --git a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Dcape.py b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Dcape.py index 778bab0f56..c8668c0b13 100644 --- a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Dcape.py +++ b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Dcape.py @@ -24,6 +24,8 @@ # ------------ ---------- ----------- -------------------------- # Feb 17, 2010 4502 jelkins Initial Creation. # Jun 05, 2013 2043 bsteffen Ported from meteolib C +# May 06, 2014 3101 njensen Cast numpy shape values to int +# for cross platform compatibility from numpy import zeros from com.raytheon.uf.common.derivparam.python.function import DCapeFuncPythonAdapter as DCapeFunc @@ -62,5 +64,5 @@ def execute(threeDtemperature, threeDdewpoint, pressure, potentialTemperature, s pressure = zeros(potentialTemperature.shape, potentialTemperature.dtype) pressure[:] = pressureValue threeDshape = threeDpressure.shape - return DCapeFunc.dcapeFunc(useVirtualTemp, threeDpressure, threeDtemperature[0], threeDdewpoint[0], pressure, potentialTemperature, specificHumidity, threeDshape[1], threeDshape[2], threeDshape[0], maxEvaporation, maxRelativeHumidity).__numpy__[0] + return DCapeFunc.dcapeFunc(useVirtualTemp, threeDpressure, threeDtemperature[0], threeDdewpoint[0], pressure, potentialTemperature, specificHumidity, int(threeDshape[1]), int(threeDshape[2]), int(threeDshape[0]), maxEvaporation, maxRelativeHumidity).__numpy__[0] diff --git a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Filter.py b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Filter.py index 3689fccf16..92f6e41ca8 100644 --- a/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Filter.py +++ b/edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Filter.py @@ -18,6 +18,14 @@ # further licensing information. ### +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# --/--/----- Initial creation +# May 06, 2014 3101 njensen Cast numpy shape values to int +# for cross platform compatibility + from numpy import ndarray, float32, NaN from numpy import sin, isnan, invert from com.raytheon.uf.common.derivparam.python.function import DistFilterPythonAdapter as DistFilter @@ -43,7 +51,7 @@ def execute(input, dist, dx, dy, times=1): #return executePython(input, npts, times) def executeJava(input, npts, times): - output = DistFilter.filter(input, npts, input.shape[1], input.shape[0], times).__numpy__[0] + output = DistFilter.filter(input, npts, int(input.shape[1]), int(input.shape[0]), times).__numpy__[0] output[output==1e37] = NaN return output