ASM #15630 -- GFE: Missing ISC Wind Grids

Change-Id: I289f1fafac8e034faa38dcddf639d5744fabe901

Former-commit-id: 4c06eca38e [formerly 212fcd9eb4] [formerly a5791db7cb] [formerly 8de6be5219 [formerly a5791db7cb [formerly db678db964b46a46e062cd0602cf9ce8bc96e4cd]]]
Former-commit-id: 8de6be5219
Former-commit-id: 03b4c6c8cef618a591d76f5fb4be2659669776ef [formerly bf4d91c7db]
Former-commit-id: 14d7b5b41a
This commit is contained in:
Fay.Liang 2014-07-21 12:51:31 -04:00
parent 60e96a066d
commit 1c2766bd51

View file

@ -38,6 +38,7 @@ from com.raytheon.uf.common.time import TimeRange
from com.vividsolutions.jts.geom import Coordinate
from java.awt import Point
from com.raytheon.edex.plugin.gfe.server import GridParmManager
from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager
from com.raytheon.edex.plugin.gfe.smartinit import IFPDB
from com.raytheon.uf.common.dataplugin.gfe import GridDataHistory
@ -61,6 +62,7 @@ from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceData_CoordinateType as CoordinateType
from com.raytheon.uf.edex.database.cluster import ClusterLockUtils
from com.raytheon.uf.edex.database.cluster import ClusterTask
from java.lang import System
#
# Port of iscMosaic.py
@ -80,13 +82,10 @@ from com.raytheon.uf.edex.database.cluster import ClusterTask
# 05/23/13 1759 dgilling Remove unnecessary imports.
# 06/05/13 2063 dgilling Change __siteInDbGrid() to
# call IFPWE.history() like A1.
# 09/05/13 2307 dgilling Fix breakage caused by #2044.
# 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
# 11/05/13 2517 randerso Restructured logging so it coulde be used by WECache
# Changed WECache to limit the number of cached grids kept in memory
# 01/09/14 16952 randerso Fix regression made in #2517 which caused errors with overlapping grids
# 02/04/14 17042 ryu Check in changes for randerso.
# 04/11/2014 17242 David Gillingham (code checked in by zhao)
#
BATCH_DELAY = 0.0
@ -419,12 +418,18 @@ class WECache(object):
elif gridType == "VECTOR":
vecGrids = grid.__numpy__
return (vecGrids[0], vecGrids[1])
elif gridType == "WEATHER" or gridType =="DISCRETE":
elif gridType == "WEATHER":
keys = grid.getKeys()
keyList = []
for theKey in keys:
keyList.append(theKey.toString())
return (grid.__numpy__[0], keyList)
elif gridType == "DISCRETE":
keys = grid.getKey()
keyList = []
for theKey in keys:
keyList.append(theKey.toString())
return (grid.__numpy__[0], keyList)
def __encodeGridHistory(self, histories):
retVal = []
@ -726,6 +731,9 @@ class IscMosaic:
# process incoming grids
for i in xrange(len(inTimes)):
# update cluster lock time to avoid time out
ClusterLockUtils.updateLockTime("ISC Write Lock", parmName , System.currentTimeMillis())
# Put in a delay so we don't hammer the server so hard.
if self.__gridDelay > 0.0:
time.sleep(self.__gridDelay)
@ -747,7 +755,7 @@ class IscMosaic:
grid = self.__validateAdjustWeatherKeys(grid,
self.__parmName, tr)
grid = self.__remap(self.__dbwe, grid, inGeoDict, inFillV)
grid = self.__remap(self.__dbwe.getParmid(), grid, inGeoDict, inFillV)
# if rate parm, then may need to adjust the values
if self.__rateParm and inTimes[i] != tr:
@ -1224,12 +1232,13 @@ class IscMosaic:
return grid.astype(numpy.float32)
def __remap(self, we, grid, inGeoDict, inFillV):
gpi = we.getGpi()
def __remap(self, pid, grid, inGeoDict, inFillV):
gpi = GridParmManager.getGridParmInfo(pid).getPayload()
gridType = gpi.getGridType().toString()
gs = self.__decodeGridSlice(we, grid, TimeRange())
gs = self.__decodeGridSlice(pid, grid, TimeRange())
pd = self.__decodeProj(inGeoDict)
fill = inFillV
@ -1259,10 +1268,9 @@ class IscMosaic:
newGrid = mapper.remap(gs.getDiscreteGrid(), fill, fill)
return (newGrid.__numpy__[0], grid[1])
def __decodeGridSlice(self, we, value, tr, history=None):
pid = we.getParmid()
gpi = we.getGpi()
def __decodeGridSlice(self, pid, value, tr, history=None):
gpi = GridParmManager.getGridParmInfo(pid).getPayload()
gridType = gpi.getGridType().toString()
hist = ArrayList()