Issue #3101 fix some derived parameters on win64 platform

Change-Id: I9de1d31e7f7c19af437aef834aa84f163bf36d86

Former-commit-id: 3aa9bfdca1 [formerly 49d34cc4e4] [formerly 5191b61b30] [formerly 3aa9bfdca1 [formerly 49d34cc4e4] [formerly 5191b61b30] [formerly aa7c1fac90 [formerly 5191b61b30 [formerly 4659c0240aa31b615bc50228906d514f47a72f94]]]]
Former-commit-id: aa7c1fac90
Former-commit-id: c333277d30 [formerly 815aa21d8e] [formerly e218d9c6b2e2544a412d7bf24b528ba73c8cd8fc [formerly 8c1748d370]]
Former-commit-id: a4bf8704f87869be96548083ce3e4e75a769e292 [formerly b708774e64]
Former-commit-id: cf09a6729c
This commit is contained in:
Nate Jensen 2014-05-06 17:08:04 -05:00
parent fb64a8684f
commit 9831077b42
3 changed files with 25 additions and 8 deletions

View file

@ -18,6 +18,14 @@
# further licensing information. # 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 com.raytheon.uf.common.derivparam.python.function import CapeFuncPythonAdapter as CapeFunc
from numpy import zeros from numpy import zeros
@ -90,9 +98,8 @@ def __execute(*args):
pressureValue = pressure pressureValue = pressure
pressure = zeros(temperatureValues.shape, temperatureValues.dtype) pressure = zeros(temperatureValues.shape, temperatureValues.dtype)
pressure[:] = pressureValue pressure[:] = pressureValue
if upperTerminationPressure is None: threeDshape = pressureValues.shape
threeDshape = pressureValues.shape if upperTerminationPressure is None:
return CapeFunc.capeFunc(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, threeDshape[1], threeDshape[2], threeDshape[0]).__numpy__ return CapeFunc.capeFunc(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, int(threeDshape[1]), int(threeDshape[2]), int(threeDshape[0])).__numpy__
else: else:
threeDshape = pressureValues.shape return CapeFunc.capeFuncTop(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, upperTerminationPressure, int(threeDshape[1]), int(threeDshape[2]), int(threeDshape[0])).__numpy__
return CapeFunc.capeFuncTop(useVirtualTemp, pressureValues, temperatureValues, pressure, potentialTemperature, specificHumidity, upperTerminationPressure, threeDshape[1], threeDshape[2], threeDshape[0]).__numpy__

View file

@ -24,6 +24,8 @@
# ------------ ---------- ----------- -------------------------- # ------------ ---------- ----------- --------------------------
# Feb 17, 2010 4502 jelkins Initial Creation. # Feb 17, 2010 4502 jelkins Initial Creation.
# Jun 05, 2013 2043 bsteffen Ported from meteolib C # 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 numpy import zeros
from com.raytheon.uf.common.derivparam.python.function import DCapeFuncPythonAdapter as DCapeFunc 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 = zeros(potentialTemperature.shape, potentialTemperature.dtype)
pressure[:] = pressureValue pressure[:] = pressureValue
threeDshape = threeDpressure.shape 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]

View file

@ -18,6 +18,14 @@
# further licensing information. # 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 ndarray, float32, NaN
from numpy import sin, isnan, invert from numpy import sin, isnan, invert
from com.raytheon.uf.common.derivparam.python.function import DistFilterPythonAdapter as DistFilter 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) #return executePython(input, npts, times)
def executeJava(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 output[output==1e37] = NaN
return output return output