diff --git a/cave/build/static/common/cave/etc/aviation/python/GridData.py b/cave/build/static/common/cave/etc/aviation/python/GridData.py index 7b8c538680..0480d8dded 100644 --- a/cave/build/static/common/cave/etc/aviation/python/GridData.py +++ b/cave/build/static/common/cave/etc/aviation/python/GridData.py @@ -538,8 +538,14 @@ def _retrieveMapData(siteIDs, timeSeconds, parameters=Parameters): for p in parameters: task.addParameter(p) pdcs = GuidanceUtil.getGFEPointsData(task) - i = 0 results = {} + if pdcs is None : + for siteId in siteIDs: + _Logger.info('Data not available for %s', siteID) + results[siteID] = None + return results + + i = 0 for siteID in siteIDs: pdc = pdcs.getContainer(i) if i < pdcs.getSize() : diff --git a/cave/build/static/common/cave/etc/aviation/python/GridMonitor.py b/cave/build/static/common/cave/etc/aviation/python/GridMonitor.py index a8249b1a68..b519b28320 100644 --- a/cave/build/static/common/cave/etc/aviation/python/GridMonitor.py +++ b/cave/build/static/common/cave/etc/aviation/python/GridMonitor.py @@ -133,7 +133,7 @@ #* Date Ticket# Engineer Description #* ------------ ---------- ----------- -------------------------- #* Initial creation. -#* Mar 07, 2013 1735 rferrel Use SiteGridManger to limit calls to server. +#* Mar 07, 2013 1735 rferrel Use SiteGridManager to limit calls to server. ## import logging, time, cPickle diff --git a/cave/build/static/common/cave/etc/aviation/python/LLWSData.py b/cave/build/static/common/cave/etc/aviation/python/LLWSData.py index 0372a66d60..fcc5e43533 100644 --- a/cave/build/static/common/cave/etc/aviation/python/LLWSData.py +++ b/cave/build/static/common/cave/etc/aviation/python/LLWSData.py @@ -48,6 +48,16 @@ # Title: AvnFPS: Incorrect file permission on ISH files # # +#** +#* +#* +#*
+#* SOFTWARE HISTORY
+#* Date         Ticket#     Engineer    Description
+#* ------------ ----------  ----------- --------------------------
+#*                                      Initial creation.
+#* Mar 25, 2013 1735        rferrel     Retrieve only the last 24 hours of acars records.
+##  
 
 from com.raytheon.viz.aviation.monitor import LlwsManager
 import logging, os, time
@@ -96,12 +106,17 @@ def retrieve(siteID, info):
     profilerIds = th.processProfilerData(siteID)
     for profilerId in profilerIds:
         try :
-	    shear = th.genShear(siteID, profilerId)
-	    d[profilerId] = shear
-    	except LLWSThread.InValid:
-    	    pass
+            shear = th.genShear(siteID, profilerId)
+            d[profilerId] = shear
+        except LLWSThread.InValid:
+            pass
     
-    acarsRec = LlwsManager.getAcarsRecord(siteID, 0)
+    # This gets all acarsRec in the database since 0 retrieves from the epoch.
+    # This may be ok if database is purged frequently.
+    # How far back should it go 1, 6, 12, 24 hours?
+    #    acarsRec = LlwsManager.getAcarsRecord(siteID, 0)
+    refTime = long((time.time() - (24.0*3600.0)) * 1000.0)
+    acarsRec = LlwsManager.getAcarsRecord(siteID, refTime)
     if acarsRec:
         acarsId = siteID[1:]
         th.processAcarsData(acarsId,acarsRec)
@@ -111,7 +126,7 @@ def retrieve(siteID, info):
         except LLWSThread.InValid:
             pass
     else:
-		_Logger.info('Missing ACARS Sounding data for %s.', siteID)
+        _Logger.info('Missing ACARS Sounding data for %s.', siteID)
     radars = info['sites']['radars']
     for radar in radars:
         vwp = LlwsManager.getVerticalWindProfile(radar, 0)
diff --git a/cave/build/static/common/cave/etc/aviation/python/LLWSThread.py b/cave/build/static/common/cave/etc/aviation/python/LLWSThread.py
index 6bb755b890..11cba9dc83 100644
--- a/cave/build/static/common/cave/etc/aviation/python/LLWSThread.py
+++ b/cave/build/static/common/cave/etc/aviation/python/LLWSThread.py
@@ -159,6 +159,17 @@
 #       	Status:           CLOSED
 #       	Title:             AvnFPS:  AvnFPS regression based lightning forecast to use LAMP
 #       
+#**
+#* 
+#* 
+#* 
+#* SOFTWARE HISTORY
+#* Date         Ticket#     Engineer    Description
+#* ------------ ----------  ----------- --------------------------
+#*                                      Initial creation.
+#* Mar 25, 2013 1735        rferrel     __initializeLLWSDictsLists now reads cfg data only for 
+#*                                      desired site instead of all sites. So it is O(n) instead of O(n**2)
+##  
 #
 import logging, os, Queue, re, time, math, sys
 import Avn, AvnParser, LLWSData, MetarData
@@ -184,7 +195,6 @@ class Server(object):
    __TimeOut = 10.0
 
    def __init__(self, info):     
-      #self.name = info['name']
       self.profilerList = []
       self.radarList = []
       self.metarList = []
@@ -207,7 +217,8 @@ class Server(object):
       rList = []
       aList = []
 
-      for m in AvnParser.getTafHeaders():
+      m = info['ident']
+      if m is not None:
          siteDict = AvnParser.getTafSiteCfg(m)
          try:
             radars = siteDict['sites']['radars']
@@ -226,17 +237,16 @@ class Server(object):
          except KeyError:
             acars = []
 
-         if profilers == [] and radars == [] and acars == []:
-            continue
-         #
-         # This TAF site needs to be monitored
-         self.metarList.append(m)
-         self.siteVWPsDict[m] = [radars,profilers,radar_cutoff,profiler_cutoff]
-         self.acarsDict[m] = [acars]
-         #
-         pList.extend(profilers)
-         rList.extend(radars)
-         aList.extend(acars)
+         if len(profilers) > 0 or len(radars) > 0 or len(acars) > 0 :
+             #
+             # This TAF site needs to be monitored
+             self.metarList.append(m)
+             self.siteVWPsDict[m] = [radars,profilers,radar_cutoff,profiler_cutoff]
+             self.acarsDict[m] = [acars]
+             #
+             pList.extend(profilers)
+             rList.extend(radars)
+             aList.extend(acars)
       #
       # Find all unique radars and profilers to monitor
       self.profilerList = dict.fromkeys(pList).keys()
diff --git a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java
index 58504dbd38..d55c329f7d 100644
--- a/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java
+++ b/cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/monitor/TafSiteComp.java
@@ -101,7 +101,7 @@ import com.raytheon.viz.avnconfig.IStatusSettable;
  */
 public class TafSiteComp {
     /**
-     * 
+     * Grid monitor class name.
      */
     public static final String GRID_MONITOR_CLASS = "GridMonitor";