Merge branch 'master_15.1.1'(master_15.1.1-12) into field_15.1.1

Conflicts:
	cave/com.raytheon.viz.volumebrowser/localization/menus/volumebrowser/fields/planview-timeseries/sfc2d/aviation.xml
	rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template

Change-Id: I9c737b735af5d1066448c71e1ffc09a1129f7435

Former-commit-id: 1f5ab00d137a3e5e75a20b15a65c4b34596a9b38
This commit is contained in:
Ana Rivera 2015-05-21 13:39:59 +00:00
commit 9f6958d69b
81 changed files with 996 additions and 1058 deletions

View file

@ -22,7 +22,8 @@
<list>
<value>com.raytheon.uf.common.dataplugin.text</value>
<value>com.raytheon.uf.common.dataplugin.shef</value>
<value>com.raytheon.edex.plugin.shef</value>
<value>com.raytheon.edex.plugin.shef</value>
<value>com.raytheon.uf.common.bmh</value>
</list>
</property>
</bean>

View file

@ -54,6 +54,7 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
* May 23, 2012 mpduff Initial creation
* Aug 08, 2012 863 jpiatt Added new interface method.
* Jul 28, 2013 2236 mpduff Made resizable.
* May 04, 2015 4419 rferrel Sort {@link #roleDualList}.
*
* </pre>
*
@ -208,6 +209,7 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
roleConfig.setSelectedList(selectedList);
roleConfig.setFullList(fullList);
roleConfig.setMenuData(menuData);
roleConfig.setSortList(true);
roleDualList = new DualList(stackComp, SWT.NONE, roleConfig, this);
@ -240,6 +242,7 @@ public class ManageUserDlg extends CaveSWTDialog implements IUpdate {
permConfig.setSelectedList(selectedPermList);
permConfig.setFullList(fullPermList);
permConfig.setMenuData(menuData2);
permConfig.setSortList(true);
permDualList = new DualList(stackComp, SWT.NONE, permConfig, this);

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.viz.useradmin.ui;
import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@ -54,11 +55,11 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* Main User Administration Dialog.
*
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 23, 2012 mpduff Initial creation.
@ -70,9 +71,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* is selected. Better enable/disable edit
* and delete buttons. Give delete dialogs
* a title.
*
* May 04, 2015 4419 rferrel Sort {@link #userPermList}.
*
* </pre>
*
*
* @author mpduff
* @version 1.0
*/
@ -109,7 +111,7 @@ public class UserAdminSelectDlg extends CaveSWTDialog implements
/**
* Constructor.
*
*
* @param parent
* The parent shell
*/
@ -232,7 +234,7 @@ public class UserAdminSelectDlg extends CaveSWTDialog implements
/*
* (non-Javadoc)
*
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialog#preOpened()
*/
@Override
@ -544,7 +546,10 @@ public class UserAdminSelectDlg extends CaveSWTDialog implements
rp.add(perm);
}
userPermList.setItems(rp.toArray(new String[rp.size()]));
String[] rpArray = rp.toArray(new String[rp.size()]);
Arrays.sort(rpArray);
userPermList.setItems(rpArray);
}
}

View file

@ -65,7 +65,8 @@ import com.raytheon.viz.avnconfig.AvnConfigConstants.triggerType;
* Feb 16, 2011 7878 rferrel Modifications to use ids.cfg file.
* Apr 08, 2011 8856 rferrel Can now make a new station's templates
* May 24, 2011 9060 rferrel Limit downloading of localization files.
* Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
* Aug 09, 2013 2033 mschenke Switched File.separator to IPathManager.SEPARATOR
* May 04, 2015 17417 yteng Get all sites from product
*
* </pre>
*
@ -299,13 +300,10 @@ public class TafSiteConfigIni implements ITafSiteConfig {
HierarchicalINIConfiguration config = getProductConfig(product);
if (config != null) {
config.setDelimiterParsingDisabled(true);
String sites = config.getString("sites.idents");
if (sites != null) {
String[] idents = config.getString("sites.idents").split(
"\\s*,\\s*", 0);
for (String id : idents) {
siteList.add(id);
String[] sites = config.getStringArray("sites.idents");
if (sites != null && sites.length > 0) {
for (String site : sites) {
siteList.add(site);
}
}
}

View file

@ -99,7 +99,7 @@ def executeFromJava(databaseID, site, username, dataMgr, forecastList, logFile,
forecasts = runFormatter(databaseID=databaseID, site=site, forecastList=forecastList, testMode=testMode,
cmdLineVarDict=cmdLineVarDict, vtecMode=vtecMode, username=username,
dataMgr=dataMgr, drtTime=drtTime)
dataMgr=dataMgr, drtTime=drtTime, vtecActiveTable=vtecActiveTable)
elapsedTime = (time.time() - startTime)*1000
logger.info("Text Formatter Finished, took: %d ms",elapsedTime)

View file

@ -47,6 +47,7 @@ import VTECTableUtil, VTECTable
import TimeRange, AbsTime, ActiveTableVtec
import JUtil
from java.util import ArrayList
from com.raytheon.uf.common.activetable import ActiveTableMode
from com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID as JavaDatabaseID
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID
from com.raytheon.uf.common.dataplugin.gfe.discrete import DiscreteKey
@ -82,9 +83,14 @@ class HazardsTable(VTECTableUtil.VTECTableUtil):
self.filterMethod = filterMethod
self.__activeTable = None
self.__allGEOActiveTable = None #not filtered by edit areas
self.__activeTableName = activeTableName
self.__vtecMode = vtecMode
self.__etnCache = {}
if activeTableName == "PRACTICE":
self.__activeTableMode = ActiveTableMode.PRACTICE
else:
self.__activeTableMode = ActiveTableMode.OPERATIONAL
if hazardEndTime is None:
self.__hazardEndTime = None
else:
@ -721,7 +727,7 @@ class HazardsTable(VTECTableUtil.VTECTableUtil):
# Local WFOs do not assign these numbers, so they should have
# numbers < 1000
if phensig not in self.__tpcKeys or self.__siteID4 in self.__sitesIgnoreNatlEtn:
etn_base = GFEVtecUtil.getNextEtn(self.__siteID4, '.'.join(phensig), False).getNextEtn() - 1
etn_base = GFEVtecUtil.getNextEtn(self.__siteID4, '.'.join(phensig), False, self.__activeTableMode).getNextEtn() - 1
else:
presentyear = time.gmtime(self.__time)[0]
for active in activeTable:
@ -922,13 +928,9 @@ class HazardsTable(VTECTableUtil.VTECTableUtil):
def __getActiveTable(self):
#Uses the IFPClient interface to get the VTEC active table from
#the server. Returns None on failure.
from com.raytheon.uf.common.activetable import ActiveTableMode
try:
if self.__activeTableName != "PRACTICE":
table = self.__ifpClient.getVTECActiveTable(self.__dataMgr.getSiteID())
else:
table = self.__ifpClient.getVTECActiveTable(self.__dataMgr.getSiteID(), ActiveTableMode.PRACTICE)
table = self.__ifpClient.getVTECActiveTable(self.__dataMgr.getSiteID(), self.__activeTableMode)
table = ActiveTableVtec.transformActiveTableToPython(table)
return table

View file

@ -27,6 +27,14 @@
#
# Author: hansen
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 04/28/2016 4027 randerso Changes for mixed case
#
##
import PhraseBuilder
import ModuleAccessor
@ -2059,7 +2067,7 @@ class DiscretePhrases(PhraseBuilder.PhraseBuilder):
# test mode
if argDict.get('testMode', 0):
phrase = 'TEST ' + name #test mode, prepend "TEST"
phrase = 'Test ' + name #test mode, prepend "TEST"
else:
phrase = name

View file

@ -25,13 +25,13 @@
# SRF_850, SRF_853, SRF_856
#
# surfAreas:
# NorthCoast1 (listed with FLZ039), SouthCoast (along GMZ850)
# NorthCoast2 (listed with FLZ042), SouthCoast (along GMZ850)
# NorthCoast1 (listed with FLZ139), SouthCoast (along GMZ850)
# NorthCoast2 (listed with FLZ142), SouthCoast (along GMZ850)
#
# TBW always runs with the same combinations:
# FLZ039-FLZ042-FLZ048-FLZ049
# FLZ050-FLZ051-FLZ055-FLZ060
# FLZ062-FLZ065
# FLZ139-FLZ142-FLZ148-FLZ149
# FLZ050-FLZ151-FLZ155-FLZ160
# FLZ162-FLZ165
# Thus, additional entries need only be listed for at least one zone
# in each combination.
#
@ -39,6 +39,15 @@
# for each zone and the system will take care to combine them appropriately.
# For example, note that the "surfAreas" are listed for both FLZ039 and FLZ042.
# When they are combined, the surfAreas are reported just once, as desired.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 04/28/2016 4027 randerso Changes for mixed case
#
##
AreaDictionary = {
@ -91,7 +100,7 @@ AreaDictionary = {
'FLZ050': {'fullStateName': 'Florida',
'partOfState': 'west central',
'stateAbbr': 'FL',
'ugcCityString': '...Bradenton Beach...Clearwater Beach...Siesta Key...Saint pete Beach...Venice Beach',
'ugcCityString': '...Bradenton Beach...Clearwater Beach...Siesta Key...Saint Pete Beach...Venice Beach',
'ugcCode': 'FLZ050',
'ugcName': 'Pinellas',
'ugcTimeZone': 'EST5EDT',

View file

@ -71,30 +71,30 @@ class WeatherSubKey:
return self.__key.getVisibility()
def attributes(self):
return JUtil.javaStringListToPylist(self.__key.getAttributes())
return JUtil.javaObjToPyVal(self.__key.getAttributes())
def wxDef(self):
return WxDefinition.WxDefinition(self.__key.wxDef())
def availableCoverages(dataMgr, wxType):
siteId = dataMgr.getSiteID()
return JUtil.javaStringListToPylist(JavaWeatherSubKey.availableCoverages(siteId, wxType))
return JUtil.javaObjToPyVal(JavaWeatherSubKey.availableCoverages(siteId, wxType))
def availableAttributes(dataMgr, wxType):
siteId = dataMgr.getSiteID()
return JUtil.javaStringListToPylist(JavaWeatherSubKey.availableAttributes(siteId, wxType))
return JUtil.javaObjToPyVal(JavaWeatherSubKey.availableAttributes(siteId, wxType))
def availableIntensities(dataMgr, wxType):
siteId = dataMgr.getSiteID()
return JUtil.javaStringListToPylist(JavaWeatherSubKey.availableIntensities(siteId, wxType))
return JUtil.javaObjToPyVal(JavaWeatherSubKey.availableIntensities(siteId, wxType))
def availableVisibilities(dataMgr):
siteId = dataMgr.getSiteID()
return JUtil.javaStringListToPylist(JavaWeatherSubKey.availableVisibilities(siteId))
return JUtil.javaObjToPyVal(JavaWeatherSubKey.availableVisibilities(siteId))
def availableWxTypes(dataMgr):
siteId = dataMgr.getSiteID()
return JUtil.javaStringListToPylist(JavaWeatherSubKey.availableWxTypes(siteId))
return JUtil.javaObjToPyVal(JavaWeatherSubKey.availableWxTypes(siteId))
def weatherSubKey(dataMgr, coverage, wxType, intensity, vis, attrList):
siteId = dataMgr.getSiteID()

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WEGroup name="NWPS">
<WEItem relativeCycleNumber="0" parmID="WaveHeight_SFC:xxx_GRID__nwpsCG1_00000000_0000"/>
<WEItem relativeCycleNumber="0" parmID="Period_SFC:xxx_GRID__nwpsCG1_00000000_0000"/>
<WEItem relativeCycleNumber="0" parmID="SwanSwell_SFC:xxx_GRID__nwpsCG1_00000000_0000"/>
</WEGroup>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WEGroup name="nwpsTrackingCG0">
<WEItem parmID="Period1_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period2_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period3_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period4_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period5_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period6_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period7_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period8_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period9_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Period10_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave1_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave2_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave3_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave4_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave5_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave6_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave7_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave8_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave9_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
<WEItem parmID="Wave10_SFC:xxx_GRID__nwpsTrkngCG0_20150207_0600" relativeCycleNumber="0"/>
</WEGroup>

View file

@ -24,7 +24,7 @@
# Edit Areas: solicited from user
# Weather Elements: You must have these Weather elements defined in
# your server: Sky, LAL, RelHum, MaxT, MinT, FreeWind,
# Haines, TransWind, MixHgt(ft agl)
# Haines, TransWind, MixHgt(ft AGL)
# To Run:
# Set GFE Time Range
# Products-->Generate Products
@ -36,7 +36,7 @@
## Fire Period Table for Feb 29 00 17:00:00 GMT - Mar 01 00 11:00:00 GMT.
## Edit Area Sky (%) LAL RelHum (%) MaxT MinT FreeWind(mph) Haines TransWind(mph) MixHgt(ft agl)
## Edit Area Sky (%) LAL RelHum (%) MaxT MinT FreeWind(mph) Haines TransWind(mph) MixHgt(ft AGL)
## COAdams 36-23 46 26
## COArapahoe 34-24 46 26
@ -102,7 +102,7 @@ Definition = {
"vectorRange",
"range2Value",
"Vector", 1, "ktToMph"),
("MixHgt", "MixHgt(ft agl)",
("MixHgt", "MixHgt(ft AGL)",
"minMax",
"range2Value",
"Scalar",10,None),

View file

@ -297,7 +297,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
if digit > 3 or digit <= 9:
RH1 = ten + 5
RH2 = RH1 + 10
words = `RH1` + " TO " + `RH2` + " PERCENT"
words = `RH1` + " to " + `RH2` + " percent"
return self.setWords(node, words)
def _windChill_heatIndex_compoundPhrase(self):
@ -316,7 +316,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
if words is None:
return
if words == "":
words = "NOT A FACTOR"
words = "not a factor"
node.set("descriptor", "")
statsWC = tree.stats.get("WindChill", node.getTimeRange(),
node.getAreaLabel(), mergeMethod="Min")
@ -364,11 +364,11 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
maxWind, dir = self.getValue(stats, "Max", self.VECTOR())
chopphrase = ""
if maxWind >= 26.1:
chopphrase = "HEAVY CHOP EXPECTED ON AREA RIVERS AND LAKES"
chopphrase = "Heavy chop expected on area rivers and lakes"
elif maxWind >= 21.7:
chopphrase = "MODERATE CHOP EXPECTED ON AREA RIVERS AND LAKES"
chopphrase = "Moderate chop expected on area rivers and lakes"
elif maxWind >= 17.4:
chopphrase = "LIGHT CHOP EXPECTED ON AREA RIVERS AND LAKES"
chopphrase = "Light chop expected on area rivers and lakes"
if chopphrase != "":
words = words + ". " + chopphrase
return self.setWords(node, words)
@ -408,10 +408,10 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
QPFwords = "\n"
words = WXwords
elif (QPFrange0 == "0.0"):
QPFwords = "AMOUNTS UP TO " + QPFrange1 + " OF AN INCH"
QPFwords = "Amounts up to " + QPFrange1 + " of an inch"
words = WXwords + ". " + QPFwords
else:
QPFwords = "AMOUNTS BETWEEN " + QPFrange0 + " AND " + QPFrange1 + " OF AN INCH"
QPFwords = "Amounts between " + QPFrange0 + " and " + QPFrange1 + " of an inch"
words = WXwords + ". " + QPFwords
return self.setWords(node, words)
@ -441,15 +441,15 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
if wxType == "T":
cov = subkey.coverage()
if cov in ["Num", "Wide", "Ocnl", "Brf", "Frq", "Pds", "Inter", "Lkly", "Def"]:
words = "LIKELY"
elif cov in ["Sct", "Chc"] and words not in ["LIKELY"]:
words = "SCATTERED"
elif cov in ["Iso", "SChc"] and words not in ["LIKELY", "SCATTERED"]:
words = "ISOLATED"
elif words not in ["LIKELY", "SCATTERED", "ISOLATED"]:
words = "POSSIBLE"
elif words not in ["LIKELY", "SCATTERED", "ISOLATED", "POSSIBLE"]:
words = "NONE"
words = "likely"
elif cov in ["Sct", "Chc"] and words not in ["likely"]:
words = "scattered"
elif cov in ["Iso", "SChc"] and words not in ["likely", "scattered"]:
words = "isolated"
elif words not in ["likely", "scattered", "isolated"]:
words = "possible"
elif words not in ["likely", "scattered", "isolated", "possible"]:
words = "none"
#print words
return self.setWords(node, words)

View file

@ -166,6 +166,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 01/28/2015 #4018 randerso Code cleanup.
* 02/04/2014 17039 ryu Removed menu item related to the HighlighFramingCodes feature.
* 04/20/2015 4027 randerso Renamed ProductStateEnum with an initial capital
* Expunged Calendar from ActiveTableRecord
* </pre>
*
* @author lvenable
@ -1388,7 +1389,7 @@ public class ProductEditorComp extends Composite implements
// check if the segment is still valid
int started = 0;
for (ActiveTableRecord atr : activeRecs) {
if (atr.getStartTime().getTimeInMillis() <= transmissionTime
if (atr.getStartTime().getTime() <= transmissionTime
.getTime()) {
started++;
}
@ -1420,7 +1421,7 @@ public class ProductEditorComp extends Composite implements
for (ActiveTableRecord r : activeRecs) {
// need to change the action to CON if
// the end time did not change
if (r.getEndTime().getTimeInMillis() == vtecEnd
if (r.getEndTime().getTime() == vtecEnd
.getTime()) {
if (!newActions.contains("CON")) {
newActions.add("CON");

View file

@ -22,6 +22,7 @@ package com.raytheon.viz.gfe.textformatter;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.SimulatedTime;
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.tasks.TaskManager;
* Feb 12, 2014 2591 randerso Passed dataMgr instance to FormatterUtil.runFormatterScript
* Removed call to TextProductManager.reloadModule
* Apr 20, 2015 4027 randerso Renamed ProductStateEnum with an initial capital
* Fixed hard coded active table mode in runFormatterScript
*
* </pre>
*
@ -80,8 +82,12 @@ public class FormatterUtil {
String vtecMode, TextProductFinishListener finish) {
int testMode = 0;
if (dataMgr.getOpMode().equals(CAVEMode.TEST)) {
ActiveTableMode atMode = ActiveTableMode.OPERATIONAL;
CAVEMode caveMode = dataMgr.getOpMode();
if (caveMode.equals(CAVEMode.TEST)) {
testMode = 1;
} else if (caveMode.equals(CAVEMode.PRACTICE)) {
atMode = ActiveTableMode.PRACTICE;
}
String shortVtec = null;
@ -104,7 +110,6 @@ public class FormatterUtil {
String varDict = productMgr.getVarDict(productName, dataMgr, dbId);
if (varDict != null) {
// run the formatter with the normal active table
String time = null;
if (!SimulatedTime.getSystemTime().isRealTime()) {
SimpleDateFormat gmtFormatter = new SimpleDateFormat(
@ -114,7 +119,7 @@ public class FormatterUtil {
time = gmtFormatter.format(SimulatedTime.getSystemTime()
.getTime());
}
runFormatterScript(name, shortVtec, dbId, varDict, "Operational",
runFormatterScript(name, shortVtec, dbId, varDict, atMode.name(),
time, testMode, finish);
} else {
finish.textProductFinished("Formatter canceled",

View file

@ -29,6 +29,7 @@ import java.util.Map;
import java.util.regex.Matcher;
import com.google.common.collect.ImmutableSet;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.activetable.response.GetNextEtnResponse;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.util.StringUtil;
@ -63,6 +64,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* Dec 18, 2013 #2641 dgilling Force ordering of items returned by
* getVtecLinesThatNeedEtn().
* Feb 05, 2014 #2774 dgilling Additional correction to previous fix.
* Apr 28, 2015 #4027 randerso Added getNextEtn parameter to specify ActiveTableMode
*
* </pre>
*
@ -134,6 +136,33 @@ public class GFEVtecUtil {
return getNextEtn(office, phensig, lockEtn, false, false, null);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @param mode
* Indicates which active table to query
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurred sending the request to the server.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, ActiveTableMode mode) throws VizException {
return getNextEtn(office, phensig, lockEtn, false, false, null, mode);
}
/**
* Gets the next available ETN for a specific product and office.
*
@ -206,6 +235,50 @@ public class GFEVtecUtil {
reportOnlyConflict, etnOverride);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @param performISC
* Whether or not to collaborate with neighboring sites to
* determine the next ETN. See {@link
* GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode,
* String, Calendar, List<IRequestRouter>)} for more information.
* @param reportOnlyConflict
* Affects which kinds of errors get reported back to the
* requestor. If true, only cases where the value of
* <code>etnOverride</code> is less than or equal to the last ETN
* used by this site or any of its partners will be reported.
* Else, all significant errors will be reported back.
* @param etnOverride
* Allows the user to influence the next ETN assigned by using
* this value unless it is less than or equal to the last ETN
* used by this site or one of its partners.
* @param mode
* Indicates which active table to query
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurred sending the request to the server.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, boolean performISC, boolean reportOnlyConflict,
Integer etnOverride, ActiveTableMode mode) throws VizException {
return VtecUtil.getNextEtn(office, phensig, lockEtn, performISC,
reportOnlyConflict, etnOverride, mode);
}
/**
* Reads through a GFE VTEC product and returns VTEC lines with NEW action
* codes that need to be assigned an ETN.

View file

@ -48,6 +48,7 @@ import com.raytheon.viz.ghg.monitor.data.GhgConfigData.SelectionEnum;
* ------------ ---------- ----------- --------------------------
* 25 MAR 2008 N/A lvenable Initial creation
* 30 JUL 2010 6721 mpduff WFO now from officeid column.
* 28 APR 2015 4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -234,13 +235,13 @@ public class GhgData implements Comparable<GhgData> {
sig = warning.getSig();
hazard = getHazardDescription(getPhenSig());
try {
startDate = warning.getStartTime().getTime();
startDate = warning.getStartTime();
} catch (Exception e) {
startDate = now;
}
endDate = warning.getEndTime().getTime();
purgeDate = warning.getPurgeTime().getTime();
issueTime = warning.getIssueTime().getTime();
endDate = warning.getEndTime();
purgeDate = warning.getPurgeTime();
issueTime = warning.getIssueTime();
pil = warning.getPil();
segNum = String.valueOf(warning.getSeg());
wfo = warning.getOfficeid();
@ -933,7 +934,7 @@ public class GhgData implements Comparable<GhgData> {
@Override
public int hashCode() {
int hash = 1;
hash = hash * 31 + hazard.hashCode();
hash = (hash * 31) + hazard.hashCode();
return hash;
}

View file

@ -35,10 +35,14 @@ import org.opengis.coverage.grid.GridEnvelope;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
import com.raytheon.uf.common.numeric.filter.UnsignedFilter;
import com.raytheon.uf.common.numeric.source.DataSource;
import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IGraphicsTarget;
@ -60,12 +64,13 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 19, 2013 mschenke Initial creation
* Jun 19, 2014 3238 bsteffen Add method to create a DataSource for
* a tile level.
* Oct 15, 2014 3681 bsteffen Allow asynchronous interrogation.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 19, 2013 mschenke Initial creation
* Jun 19, 2014 3238 bsteffen Add method to create a DataSource for
* a tile level.
* Oct 15, 2014 3681 bsteffen Allow asynchronous interrogation.
* May 04, 2015 4426 bsteffen Fix unsigned interrogation.
*
* </pre>
*
@ -248,6 +253,11 @@ public class SatTileSetRenderable extends RecordTileSetRenderable {
Rectangle rect = tile.getRectangle();
DataSource source = BufferWrapper.wrap(data.getBuffer(),
rect.width, rect.height);
if (data.getDataType() == ColorMapDataType.BYTE) {
source = UnsignedFilter.apply((ByteBufferWrapper) source);
} else if (data.getDataType() == ColorMapDataType.UNSIGNED_SHORT) {
source = UnsignedFilter.apply((ShortBufferWrapper) source);
}
dataValue = source.getDataValue(tilex, tiley);
dataUnit = data.getDataUnit();
}

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.activetable.GetActiveTableResponse;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.core.mode.CAVEMode;
@ -52,6 +53,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* tables names.
* Dec 20, 2010 7210 cjeanbap Added non-blocking dialog.
* Apr 25, 2014 DR 16668 D. Friedman Handle partial cancellations
* Apr 28, 2015 4027 randerso Expunged Calendar from ActiveTableRecord
* </pre>
*
* @author jsanchez
@ -65,7 +67,7 @@ public class NotifyExpirationTask extends TimerTask {
/**
* Miliseconds in two days
*/
private static final long TWO_DAYS = 48 * 60 * 60 * 1000;
private static final long TWO_DAYS = 2 * TimeUtil.MILLIS_PER_DAY;
private String office;
@ -90,9 +92,11 @@ public class NotifyExpirationTask extends TimerTask {
+ dateFormat.format(vtecObject.getEndTime().getTime());
}
@Override
public void run() {
if (!isCanceled()) {
parentShell.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
SWTMessageBox mb = new SWTMessageBox(
NotifyExpirationTask.this.parentShell,
@ -126,8 +130,8 @@ public class NotifyExpirationTask extends TimerTask {
activeTable = resp.getActiveTable();
} catch (VizException e) {
statusHandler.handle(Priority.ERROR,
"Error querying active table for " + office + "."
+ phenSig + "." + etn, e);
"Error querying active table for " + office + "." + phenSig
+ "." + etn, e);
}
if (activeTable != null) {
@ -135,16 +139,17 @@ public class NotifyExpirationTask extends TimerTask {
for (ActiveTableRecord record : activeTable) {
if (record != null) {
/*
* textNotifyExpiration.tcl ln 106: If any of the found products are
* less than 48 hours old,return true.
* textNotifyExpiration.tcl ln 106: If any of the found
* products are less than 48 hours old,return true.
*/
if ("CAN".equals(record.getAct())
&& (System.currentTimeMillis()
- record.getIssueTime().getTimeInMillis() < TWO_DAYS)) {
&& ((System.currentTimeMillis() - record
.getIssueTime().getTime()) < TWO_DAYS)) {
haveCAN = true;
} else if ("CON".equals(record.getAct())) {
/* If there CANs and the event is still active, there
* should be some CONs. Thus, it is not necessary to
/*
* If there CANs and the event is still active, there
* should be some CONs. Thus, it is not necessary to
* check for every other kind of non-terminal action.
*/
return false;
@ -160,7 +165,7 @@ public class NotifyExpirationTask extends TimerTask {
private String pad(int value) {
String rval = "";
String str = Integer.toString(value);
for (int i = 0; i < 4 - str.length(); i++) {
for (int i = 0; i < (4 - str.length()); i++) {
rval += "0";
}

View file

@ -20,6 +20,7 @@
package com.raytheon.viz.texteditor.util;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
@ -46,6 +47,9 @@ import com.raytheon.viz.core.mode.CAVEMode;
* May 08, 2013 #1842 dgilling Code cleanup.
* Aug 29, 2013 #1843 dgilling Use new GetNextEtnRequest constructor.
* Oct 21, 2013 #1843 dgilling Use new GetNextEtnResponse.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
* Added getNextEtn method with parameter to specify
* activeTableMode
*
* </pre>
*
@ -103,7 +107,7 @@ public class VtecUtil {
return message;
}
VtecObject vtec = parseMessage(message);
if (vtec == null || vtec.getAction() == null) {
if ((vtec == null) || (vtec.getAction() == null)) {
return message;
}
@ -181,13 +185,57 @@ public class VtecUtil {
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, boolean performISC, boolean reportOnlyConflict,
Integer etnOverride) throws VizException {
Calendar currentTime = Calendar.getInstance();
currentTime.setTime(SimulatedTime.getSystemTime().getTime());
ActiveTableMode activeTable = (CAVEMode.getMode()
.equals(CAVEMode.PRACTICE)) ? ActiveTableMode.PRACTICE
ActiveTableMode mode = (CAVEMode.getMode().equals(CAVEMode.PRACTICE)) ? ActiveTableMode.PRACTICE
: ActiveTableMode.OPERATIONAL;
GetNextEtnRequest req = new GetNextEtnRequest(office, activeTable,
phensig, currentTime, lockEtn, performISC, reportOnlyConflict,
return getNextEtn(office, phensig, lockEtn, performISC,
reportOnlyConflict, etnOverride, mode);
}
/**
* Gets the next available ETN for a specific product and office.
*
* @param office
* The 4-character site ID of the office.
* @param phensig
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
* next number after determining the next ETN for this request.
* If false, the next ETN will be returned, but it will not
* increment the server's running sequence, so the ETN return
* could be used by another client that makes a
* GetNextEtnRequest.
* @param performISC
* Whether or not to collaborate with neighboring sites to
* determine the next ETN. See {@link
* GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode,
* String, Calendar, List<IRequestRouter>)} for more information.
* @param reportOnlyConflict
* Affects which kinds of errors get reported back to the
* requestor. If true, only cases where the value of
* <code>etnOverride</code> is less than or equal to the last ETN
* used by this site or any of its partners will be reported.
* Else, all significant errors will be reported back.
* @param etnOverride
* Allows the user to influence the next ETN assigned by using
* this value unless it is less than or equal to the last ETN
* used by this site or one of its partners.
* @param mode
* Indicates which active table to query
* @return The next ETN in sequence, given the office and phensig.
* @throws VizException
* If an error occurs while submitting or processing the remote
* request.
*/
public static GetNextEtnResponse getNextEtn(String office, String phensig,
boolean lockEtn, boolean performISC, boolean reportOnlyConflict,
Integer etnOverride, ActiveTableMode mode) throws VizException {
Date currentTime = SimulatedTime.getSystemTime().getTime();
GetNextEtnRequest req = new GetNextEtnRequest(office, mode, phensig,
currentTime, lockEtn, performISC, reportOnlyConflict,
etnOverride);
GetNextEtnResponse resp = (GetNextEtnResponse) ThriftClient
@ -197,6 +245,13 @@ public class VtecUtil {
return rval;
}
/**
* Parse a VTEC message
*
* @param message
* the message
* @return the parsed VtecObject
*/
public static VtecObject parseMessage(String message) {
VtecObject rval = null;
Matcher m = VTEC_REGEX.matcher(message);
@ -215,7 +270,7 @@ public class VtecUtil {
*
* @param message
* the message to modify
* @param obj
* @param vtec
* new VTEC for the message
*
* @return the modified message

View file

@ -30,4 +30,4 @@
<contribute xsi:type="menuItem" menuText="Icing Severity" key="ICSEV" indentText="false" />
<contribute xsi:type="menuItem" menuText="Supercooled Large Droplet Threat" key="SIPD" indentText="false" />
<contribute xsi:type="menuItem" menuText="Supercooled Large Droplet (SLD) Probability" key="SLDP" indentText="false" />
</menuTemplate>
</menuTemplate>

View file

@ -35,7 +35,9 @@ import javax.jms.Session;
import com.raytheon.uf.common.dataplugin.text.request.InsertStdTextProductRequest;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.comm.JMSConnection;
@ -60,6 +62,7 @@ import com.raytheon.viz.texteditor.util.SiteAbbreviationUtil;
* 02Aug2010 2187 cjeanbap Update variable/method signature to be consistent.
* 04Oct2010 7193 cjeanbap Add time-to-live value to MessageProducer.
* Sep 13, 2013 2368 rjpeter Set delivery mode to PERSISTENT.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author mschenke
@ -70,6 +73,9 @@ public class WarningSender implements IWarngenObserver {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(WarningSender.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private final String hostName = null;
private boolean notifyError;
@ -105,8 +111,8 @@ public class WarningSender implements IWarngenObserver {
long t0 = System.currentTimeMillis();
String siteNode = SiteAbbreviationUtil.getSiteNode(LocalizationManager
.getInstance().getCurrentSite());
statusHandler.debug("Get site node time: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Get site node time",
System.currentTimeMillis() - t0);
if (host == null) {
statusHandler.handle(Priority.ERROR,
"Text Workstation host not set in preferences.");
@ -144,7 +150,7 @@ public class WarningSender implements IWarngenObserver {
m.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
mp.send(m);
long t1 = System.currentTimeMillis();
statusHandler.debug(id + " sent to text workstation in "
perfLog.log(id + " sent to text workstation in "
+ (t1 - t0) + "ms in " + (connectCount + 1)
+ (connectCount > 0 ? " tries" : " try"));
messageNotSent = false;
@ -260,8 +266,8 @@ public class WarningSender implements IWarngenObserver {
ThriftClient.sendRequest(new InsertStdTextProductRequest(id, warning,
operationalMode));
statusHandler.debug(id + " saved to textdb in "
+ (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration(id + " save to textdb",
System.currentTimeMillis() - t0);
}
public static String getCurTimeString() {

View file

@ -27,6 +27,8 @@ import com.raytheon.uf.common.geospatial.ISpatialQuery.SearchMode;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
import com.raytheon.uf.common.geospatial.SpatialQueryResult;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.maps.rsc.DbMapQueryFactory;
import com.raytheon.viz.core.map.GeoUtil;
@ -53,6 +55,7 @@ import com.vividsolutions.jts.geom.Point;
* Feb 12, 2013 1600 jsanchez Used adjustAngle method from AbstractStormTrackResource.
* Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting.
* Mar 26, 2013 1819 jsanchez Allowed points to be not be based on point source inclusion constraints.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
*
* </pre>
*
@ -61,6 +64,9 @@ import com.vividsolutions.jts.geom.Point;
*/
abstract public class AbstractDbSourceDataAdaptor {
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private static final String transformedKey = "com.raytheon.transformed";
private static final String GEOM_FIELD = "the_geom";
@ -176,8 +182,8 @@ abstract public class AbstractDbSourceDataAdaptor {
ptFields.toArray(new String[ptFields.size()]),
searchArea, filter, SearchMode.INTERSECTS);
}
System.out.println("Retrieve location data for '" + pointSource
+ "' = " + (System.currentTimeMillis() - t0));
perfLog.logDuration("Retrieve location data for '" + pointSource + "'",
System.currentTimeMillis() - t0);
} catch (SpatialException e) {
throw new VizException("Error querying " + pointSource + " table: "
+ e.getLocalizedMessage(), e);

View file

@ -44,7 +44,9 @@ import com.raytheon.uf.common.geospatial.ISpatialQuery.SearchMode;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
import com.raytheon.uf.common.geospatial.SpatialQueryResult;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.exception.VizException;
@ -87,6 +89,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometry;
* Sep 14, 2014 ASM #641 dhuffman Filtered out cases where Areas do not match Zones by using
* refactored WarngenLayer::filterArea.
* Mar 9, 2014 ASM #17190 D. Friedman Use fipsField and areaField for unique area ID.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author chammack
@ -96,6 +99,9 @@ public class Area {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(Area.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
/**
* If an area greater than this percentage of the area is covered, no
* direction is included
@ -167,6 +173,7 @@ public class Area {
// Query for points within polygon
SpatialQueryResult[] ptFeatures = null;
long t0 = System.currentTimeMillis();
if (pointField != null) {
try {
ptFeatures = SpatialQueryFactory.create().query(pointSource,
@ -177,6 +184,8 @@ public class Area {
e);
}
}
perfLog.logDuration("affected areas '" + areaConfig.getVariable()
+ "' spatial query", System.currentTimeMillis() - t0);
Abbreviation abbreviation = null;
@ -194,6 +203,7 @@ public class Area {
List<String> uniqueAreaIDs = new ArrayList<String>();
List<AffectedAreas> areas = new ArrayList<AffectedAreas>();
long t0f = System.currentTimeMillis();
for (GeospatialData regionFeature : countyMap.values()) {
Geometry regionGeom = regionFeature.geometry;
PreparedGeometry preparedRegionGeom = regionFeature.prepGeom;
@ -284,6 +294,8 @@ public class Area {
areas.add(area);
}
}
perfLog.logDuration("affected areas '" + areaConfig.getVariable()
+ "' features", System.currentTimeMillis() - t0f);
// Perform Sort
if (fields.size() > 0) {

View file

@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.geom.PrecisionModel;
import com.vividsolutions.jts.geom.TopologyException;
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
@ -89,6 +90,9 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
* 06/27/2014 DR 17443 D. Friedman Fix some odd cases in which parts of a polygon not covering a
* hatched area would be retained after redrawing.
* 07/22/2014 DR 17475 Qinglu Lin Updated createPolygonByPoints() and created second createPolygonByPoints().
* 04/29/2015 DR 17310 D. Friedman Use Geometry.buffer() to fix self-intersections. Fix bug in alterVertexes.
* 05/07/2015 DR 17438 D. Friedman Clean up debug and performance logging.
* 05/08/2015 DR 17310 D. Friedman Prevent reducePoints from generating invalid polygons.
* </pre>
*
* @author mschenke
@ -543,12 +547,27 @@ public class PolygonUtil {
GeometryFactory gf = new GeometryFactory();
points.add(new Coordinate(points.get(0)));
truncate(points, 2);
Polygon rval = gf.createPolygon(gf.createLinearRing(points
.toArray(new Coordinate[points.size()])), null);
if (!rval.isValid()) {
statusHandler.handle(Priority.DEBUG, String.format(
"Polygon %s is invalid. Attempting to fix...", rval));
String resultMessage = null;
try {
Polygon p2 = (Polygon) rval.buffer(0.0);
rval = gf.createPolygon((LinearRing) p2.getExteriorRing());
resultMessage = String.format(" ...fixed. Result: %s", rval);
} catch (TopologyException e) {
resultMessage = " ...fix failed";
} catch (ClassCastException e) {
resultMessage = " ...resulted in something other than a polygon";
}
statusHandler.handle(Priority.DEBUG, resultMessage);
}
if (rval.isValid() == false) {
System.out.println("Fixing intersected segments");
statusHandler.handle(Priority.DEBUG, "Fixing intersected segments");
Coordinate[] coords = rval.getCoordinates();
adjustVertex(coords);
PolygonUtil.round(coords, 2);
@ -799,6 +818,7 @@ public class PolygonUtil {
int npts = pts.length;
double xavg = 0, yavg = 0;
int[] yesList = new int[npts];
boolean[] excludeList = new boolean[npts];
int nyes = 0;
int k, k1, k2, kn, y, simple;
double bigDis, maxDis, dis, dx, dy, dx0, dy0, bas;
@ -863,6 +883,8 @@ public class PolygonUtil {
k = 0;
if (k == k2)
break;
if (excludeList[k])
continue;
dx = pts[k].x - pts[k1].x;
dy = pts[k].y - pts[k1].y;
dis = dx * dx0 + dy * dy0;
@ -870,6 +892,8 @@ public class PolygonUtil {
dis = -dis;
else
dis -= bas;
double newMaxDis = maxDis;
int newSimple = simple;
if (dis <= 0) {
if (simple == 0)
continue;
@ -877,15 +901,30 @@ public class PolygonUtil {
if (dis < 0)
dis = -dis;
} else if (simple != 0)
maxDis = simple = 0;
if (dis < maxDis)
newMaxDis = newSimple = 0;
if (dis < newMaxDis) {
maxDis = newMaxDis;
continue;
}
if (! checkReducePointsValid(pts, yesList, nyes, k)) {
excludeList[k] = true;
continue;
}
simple = newSimple;
maxDis = dis;
kn = k;
}
k1 = k2;
}
Arrays.fill(excludeList, false);
if (kn < 0) {
statusHandler.debug(
String.format("reducePoints(..., %d): Unable to find a valid point\npoints: %s",
maxNpts, points));
break;
}
if (simple != 0 && nyes > 2) {
if (maxDis * 40 < bigDis)
break;
@ -909,6 +948,24 @@ public class PolygonUtil {
points.addAll(Arrays.asList(Arrays.copyOf(pts, npts)));
}
private boolean checkReducePointsValid(Coordinate[] pts, int[] yesList, int nyes, int k) {
Coordinate[] verts = new Coordinate[nyes + 2];
int vi = 0;
for (int i = 0; i < nyes; ++i) {
if (k >= 0 && k < yesList[i]) {
verts[vi++] = pts[k];
k = -1;
}
verts[vi++] = pts[yesList[i]];
}
if (k >= 0) {
verts[vi++] = pts[k];
}
verts[verts.length - 1] = new Coordinate(verts[0]);
GeometryFactory gf = new GeometryFactory();
return gf.createPolygon(verts).isValid();
}
/**
* A1 ported point reduction method 2
*
@ -1675,8 +1732,8 @@ public class PolygonUtil {
if (intersectCoord != null) {
index1 = calcShortestDistance(intersectCoord, ls1);
index2 = calcShortestDistance(intersectCoord, ls2);
Coordinate c = new Coordinate(0.5*(coord[index1].x + coord[2+index2].x),
0.5*(coord[index1].y + coord[2+index2].y));
Coordinate c = new Coordinate(0.5*(coord[index[index1]].x + coord[index[2+index2]].x),
0.5*(coord[index[index1]].y + coord[index[2+index2]].y));
PolygonUtil.round(c, 2);
coord[index[index1]] = new Coordinate(c);
coord[index[2+index2]] = new Coordinate(c);

View file

@ -51,7 +51,9 @@ import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
@ -85,6 +87,8 @@ import com.vividsolutions.jts.geom.Polygon;
* /missing (part of state, state abbreviation) which resulted from
* extension of a watch to counties which are of same/different fe_area.
* Sep 25, 2014 ASM #16783 D. Friedman Do not use VTEC action to determine Watch uniqueness.
* Apr 28, 2015 RODO #4027 randerso Expunged Calendar from ActiveTableRecord
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author jsanchez
@ -95,6 +99,9 @@ public class WatchUtil {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(WatchUtil.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private static final UnitConverter milesToKilometer = NonSI.MILE
.getConverterTo(SI.KILOMETER);
@ -229,8 +236,8 @@ public class WatchUtil {
Polygon watchArea = (Polygon) warningPolygon
.buffer(milesToKilometer.convert(watchAreaBuffer)
/ KmToDegrees);
System.out.println("create watch area buffer time: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Create watch area buffer time",
System.currentTimeMillis() - t0);
HashSet<String> validUgcZones = new HashSet<String>(
warngenLayer.getUgcsForWatches(watchArea,
GeoFeatureType.COUNTY));
@ -324,12 +331,12 @@ public class WatchUtil {
* fixed the underlying system. request.addConstraint("act", new
* RequestConstraint("CAN", ConstraintType.NOT_EQUALS));
*/
if (action != WarningAction.CAN && action != WarningAction.EXP) {
if ((action != WarningAction.CAN) && (action != WarningAction.EXP)) {
ActiveTableRecord record = entityClass.newInstance();
record.setIssueTime((Calendar) result.get(ISSUE_TIME_FIELD));
record.setStartTime((Calendar) result.get(START_TIME_FIELD));
record.setEndTime((Calendar) result.get(END_TIME_FIELD));
record.setEndTime((Calendar) result.get(END_TIME_FIELD));
record.setIssueTime((Date) result.get(ISSUE_TIME_FIELD));
record.setStartTime((Date) result.get(START_TIME_FIELD));
record.setEndTime((Date) result.get(END_TIME_FIELD));
record.setEndTime((Date) result.get(END_TIME_FIELD));
record.setUgcZone(String.valueOf(result.get(UGC_ZONE_FIELD)));
record.setPhensig(String.valueOf(result.get(PHEN_SIG_FIELD)));
record.setEtn(String.valueOf(result.get(ETN)));
@ -348,10 +355,12 @@ public class WatchUtil {
}
}
// remove ActiveTableRecord from records whose etn, ugcZone, and phensig is same as
// canceled or expired.
/*
* remove ActiveTableRecord from records whose etn, ugcZone, and phensig
* is same as canceled or expired.
*/
String etn, ugczone, phensig;
for (Pair<String, String> etnPhensig: removedUgczones.keySet()) {
for (Pair<String, String> etnPhensig : removedUgczones.keySet()) {
ugczones = removedUgczones.get(etnPhensig);
etn = etnPhensig.getFirst();
phensig = etnPhensig.getSecond();
@ -361,8 +370,9 @@ public class WatchUtil {
Iterator<ActiveTableRecord> iterator = records.iterator();
while (iterator.hasNext()) {
ActiveTableRecord atr = iterator.next();
if (atr.getEtn().equals(etn) && atr.getUgcZone().equals(ugczone) &&
atr.getPhensig().equals(phensig)) {
if (atr.getEtn().equals(etn)
&& atr.getUgcZone().equals(ugczone)
&& atr.getPhensig().equals(phensig)) {
iterator.remove();
}
}
@ -371,9 +381,12 @@ public class WatchUtil {
Collections.sort(records, PEUI);
// Filters out extra ActiveTableRecords that have same phenSig, etn, and ugcZone.
/*
* Filters out extra ActiveTableRecords that have same phenSig, etn, and
* ugcZone.
*/
Map<String, ActiveTableRecord> atrMap = new LinkedHashMap<String, ActiveTableRecord>();
for (ActiveTableRecord atr: records) {
for (ActiveTableRecord atr : records) {
String key = atr.getPhensig() + atr.getEtn() + atr.getUgcZone();
atrMap.put(key, atr);
}
@ -419,7 +432,7 @@ public class WatchUtil {
String ugcZone = ar.getUgcZone();
String state = null;
if (marineUgcs != null && marineUgcs.contains(ugcZone)) {
if ((marineUgcs != null) && marineUgcs.contains(ugcZone)) {
// Just leave state == null
} else {
state = getStateName(ugcZone.substring(0, 2));
@ -430,12 +443,11 @@ public class WatchUtil {
String phenSig = ar.getPhensig();
String etn = ar.getEtn();
Date startTime = ar.getStartTime().getTime();
Date endTime = ar.getEndTime().getTime();
Date startTime = ar.getStartTime();
Date endTime = ar.getEndTime();
if (validUgcZones.contains(ugcZone)) {
Watch watch = new Watch(state, phenSig, etn, startTime,
endTime);
Watch watch = new Watch(state, phenSig, etn, startTime, endTime);
List<String> areas = map.get(watch);
if (areas == null) {
areas = new ArrayList<String>();
@ -460,9 +472,9 @@ public class WatchUtil {
}
}
/* Sorts the watches based on ETN, then state. Marine areas
* have a null state value so they appear at the end of each
* watch.
/*
* Sorts the watches based on ETN, then state. Marine areas have a null
* state value so they appear at the end of each watch.
*/
Collections.sort(watches, new Comparator<Watch>() {
@ -471,37 +483,44 @@ public class WatchUtil {
String etn1 = watch1.getEtn();
String etn2 = watch2.getEtn();
int c;
if (etn1 == etn2)
if (etn1 == etn2) {
c = 0;
else if (etn1 == null)
} else if (etn1 == null) {
return 1;
else if (etn2 == null)
} else if (etn2 == null) {
return -1;
else
} else {
c = etn1.compareTo(etn2);
if (c != 0)
}
if (c != 0) {
return c;
}
String state1 = watch1.getState();
String state2 = watch2.getState();
if (state1 == state2)
if (state1 == state2) {
return 0;
else if (state1 == null)
} else if (state1 == null) {
return 1; // null state is greater; put at end
else if (state2 == null)
} else if (state2 == null) {
return -1;
else
} else {
return state1.compareTo(state2);
}
}
});
// Filters out extra Watches that have different startTime but same phenSig, etn, state, partOfState, endTime, and marineArea.
/*
* Filters out extra Watches that have different startTime but same
* phenSig, etn, state, partOfState, endTime, and marineArea.
*/
Map<String, Watch> watchMap = new LinkedHashMap<String, Watch>();
for (Watch w: watches) {
List<String> pos = w.getPartOfState() != null ?
new ArrayList<String>(w.getPartOfState()) : null;
if (pos != null)
for (Watch w : watches) {
List<String> pos = w.getPartOfState() != null ? new ArrayList<String>(
w.getPartOfState()) : null;
if (pos != null) {
Collections.sort(pos);
}
String key = String.valueOf(w.getPhenSig())
+ String.valueOf(w.getEtn()) + String.valueOf(w.getState())
+ String.valueOf(pos) + String.valueOf(w.getEndTime());
@ -540,9 +559,10 @@ public class WatchUtil {
return affectedPortions;
}
private List<Watch> generateMarineWatchItems(Watch template, List<String> areas) {
private List<Watch> generateMarineWatchItems(Watch template,
List<String> areas) {
ArrayList<Watch> result = new ArrayList<Watch>();
for (String area: areas) {
for (String area : areas) {
Watch watch = new Watch(template.getState(), template.getPhenSig(),
template.getEtn(), template.getStartTime(),
template.getEndTime());
@ -553,7 +573,7 @@ public class WatchUtil {
}
private List<String> determineMarineAreas(List<String> areas) {
HashSet<Pair<Integer, String>> groupedAreas = new HashSet<Pair<Integer,String>>();
HashSet<Pair<Integer, String>> groupedAreas = new HashSet<Pair<Integer, String>>();
for (String area : areas) {
int entryIndex = 0;
for (MarineWordingEntry entry : marineWordingConfig.getEntries()) {
@ -573,9 +593,12 @@ public class WatchUtil {
entryIndex++;
}
}
ArrayList<Pair<Integer, String>> sorted = new ArrayList<Pair<Integer,String>>(groupedAreas);
ArrayList<Pair<Integer, String>> sorted = new ArrayList<Pair<Integer, String>>(
groupedAreas);
Collections.sort(sorted, new Comparator<Pair<Integer, String>>() {
public int compare(Pair<Integer, String> o1, Pair<Integer, String> o2) {
@Override
public int compare(Pair<Integer, String> o1,
Pair<Integer, String> o2) {
int r = o1.getFirst().compareTo(o2.getFirst());
return r != 0 ? r : o1.getSecond().compareTo(o2.getSecond());
};
@ -702,7 +725,7 @@ public class WatchUtil {
if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) {
return abrev;
}
if (nnn + sss + eee + www == 3) {
if ((nnn + sss + eee + www) == 3) {
if (www == 0) {
abrev = "e";
} else if (eee == 0) {
@ -724,7 +747,7 @@ public class WatchUtil {
return abrev;
}
}
if (m == 1 + cc) {
if (m == (1 + cc)) {
abrev += partAbrev + " ";
return abrev;
}

View file

@ -64,7 +64,9 @@ import com.raytheon.uf.common.geospatial.ISpatialQuery.SearchMode;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
import com.raytheon.uf.common.geospatial.SpatialQueryResult;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.exception.VizException;
@ -118,6 +120,7 @@ import com.vividsolutions.jts.geom.Point;
* Dec 4, 2013 2604 jsanchez Refactored GisUtil.
* Apr 29, 2014 3033 jsanchez Updated method to retrieve files in localization.
* Jun 17, 2014 DR 17390 Qinglu Lin Updated getClosestPoints().
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author chammack
@ -127,6 +130,9 @@ public class Wx {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(Wx.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private long wwaStopTime;
private long wwaStartTime;
@ -531,8 +537,8 @@ public class Wx {
pathcasts.remove(pathcasts.size() - 1);
}
System.out.println("Time to get pathcast = "
+ (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration("Get pathcast",
System.currentTimeMillis() - t0);
return pathcasts.toArray(new PathCast[pathcasts.size()]);
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
@ -608,8 +614,8 @@ public class Wx {
+ variable + "'", t);
}
}
System.out.println("Time to get closestPoints = "
+ (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration("Get closestPoints",
System.currentTimeMillis() - t0);
return pointsMap;
}
@ -729,8 +735,8 @@ public class Wx {
localizedSite));
}
long t1 = System.currentTimeMillis();
System.out.println("getClosestPoint.dbQuery took " + (t1 - t0)
+ " for point source " + pointConfig.getPointSource());
perfLog.logDuration("getClosestPoints.dbQuery for point source "
+ pointConfig.getPointSource(), t1 - t0);
}
// Convert searchArea to a local projection

View file

@ -67,7 +67,9 @@ import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.config.BulletActionGroup;
import com.raytheon.uf.common.dataplugin.warning.config.DamInfoBullet;
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.SimulatedTime;
@ -159,6 +161,11 @@ import com.vividsolutions.jts.geom.Polygon;
* Jul 01, 2014 DR 17450 D. Friedman Use list of templates from backup site.
* Jul 21, 2014 3419 jsanchez Created a hidden button to make recreating polygons easier.
* Feb 26, 2015 3353 rjpeter Fixed NPE on clear.
* Apr 27, 2015 DR 17359 Qinglu Lin Updated changeTemplate(). The approach for solving slowness issue while switching from
* one marine product to another is to skip computing hatching area. The hatching area might
* not be as expected if percentage/area is different between the two products. But the
* chance for that to occur is trivial.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author chammack
@ -169,6 +176,9 @@ public class WarngenDialog extends CaveSWTDialog implements
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(WarngenDialog.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
/*
* This flag allows a hidden button to appear to help recreating warning
* polygons that had issues in the feed.
@ -1111,6 +1121,7 @@ public class WarngenDialog extends CaveSWTDialog implements
* Action for OK button
*/
private void okPressed() {
final long t0okPressed = System.currentTimeMillis();
if (checkDamSelection() == false) {
return;
} else if (warngenLayer.getWarningArea() == null) {
@ -1165,9 +1176,9 @@ public class WarngenDialog extends CaveSWTDialog implements
@Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
long t0 = System.currentTimeMillis();
try {
monitor.beginTask("Generating product", 1);
long t0 = System.currentTimeMillis();
String result = TemplateRunner.runTemplate(
warngenLayer, startTime.getTime(),
endTime.getTime(), selectedBullets,
@ -1178,8 +1189,6 @@ public class WarngenDialog extends CaveSWTDialog implements
while (m.find()) {
totalSegments++;
}
System.out.println("Time to run template = "
+ (System.currentTimeMillis() - t0));
} catch (Exception e) {
statusHandler.handle(
Priority.PROBLEM,
@ -1187,19 +1196,23 @@ public class WarngenDialog extends CaveSWTDialog implements
+ e.getLocalizedMessage(), e);
} finally {
monitor.done();
perfLog.logDuration("Run template",
System.currentTimeMillis() - t0);
perfLog.logDuration("click to finish template",
System.currentTimeMillis() - t0okPressed);
}
}
});
System.out.println(WarningSender.getCurTimeString()
+ ": Creating Transmitting Warning Job");
statusHandler.handle(Priority.DEBUG,
"Creating Transmitting Warning Job");
new Job("Transmitting Warning") {
@Override
protected IStatus run(IProgressMonitor monitor) {
System.out.println(WarningSender.getCurTimeString()
+ ": Transmitting Warning Job Running");
statusHandler.debug(
": Transmitting Warning Job Running");
// Launch the text editor display as the warngen editor
// dialog using the result aka the warngen text product.
@ -1218,6 +1231,8 @@ public class WarngenDialog extends CaveSWTDialog implements
"Error sending warning: "
+ e.getLocalizedMessage(), e);
}
perfLog.logDuration("click to finish sending",
System.currentTimeMillis() - t0okPressed);
return Status.OK_STATUS;
}
}.schedule();
@ -1657,14 +1672,17 @@ public class WarngenDialog extends CaveSWTDialog implements
.equalsIgnoreCase(lastAreaSource);
boolean snapHatchedAreaToPolygon = isDifferentAreaSources;
boolean preservedSelection = !isDifferentAreaSources;
// If template has a different hatched area source from the previous
// template, then the warned area would be based on the polygon and not
// preserved.
try {
warngenLayer.updateWarnedAreas(snapHatchedAreaToPolygon,
preservedSelection);
} catch (VizException e1) {
statusHandler.handle(Priority.PROBLEM, "WarnGen Error", e1);
if (isDifferentAreaSources || !warngenLayer.getConfiguration()
.getHatchedAreaSource().getAreaSource().toLowerCase().equals("marinezones")) {
// If template has a different hatched area source from the previous
// template, then the warned area would be based on the polygon and not
// preserved.
try {
warngenLayer.updateWarnedAreas(snapHatchedAreaToPolygon,
preservedSelection);
} catch (VizException e1) {
statusHandler.handle(Priority.PROBLEM, "WarnGen Error", e1);
}
}
// Properly sets the "Create Text" button.
setInstructions();

View file

@ -81,7 +81,9 @@ import com.raytheon.uf.common.jms.notification.INotificationObserver;
import com.raytheon.uf.common.jms.notification.NotificationException;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
@ -236,6 +238,8 @@ import com.vividsolutions.jts.io.WKTReader;
* 02/09/2015 3954 dlovely Only draw "W" if the county is displayed.
* 02/25/2014 3353 rjpeter Fix synchronized use case, updated to not create dialog before init is finished.
* 04/24/2015 ASM #17394 D. Friedman Fix geometries that become invalid in local coordinate space.
* 05/07/2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* 05/08/2015 ASM #17310 D. Friedman Log input polygon when output of AreaHatcher is invalid.
* </pre>
*
* @author mschenke
@ -246,6 +250,9 @@ public class WarngenLayer extends AbstractStormTrackResource {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(WarngenLayer.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
String uniqueFip = null;
String backupOfficeShort = null;
@ -490,9 +497,11 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
if ((warningArea != null) && (warningPolygon != null)) {
long t0 = System.currentTimeMillis();
Polygon inputWarningPolygon = warningPolygon;
Polygon outputHatchedArea = null;
Geometry outputHatchedWarningArea = null;
String adjustmentMessage = null;
try {
warningPolygon = PolygonUtil
.removeDuplicateCoordinate(warningPolygon);
@ -512,11 +521,12 @@ public class WarngenLayer extends AbstractStormTrackResource {
GeometryFactory gf = new GeometryFactory();
LinearRing lr = gf.createLinearRing(coords);
outputHatchedArea = gf.createPolygon(lr, null);
long tadj0 = System.currentTimeMillis();
int adjustPolygon_counter = 0;
while (!outputHatchedArea.isValid()
&& (adjustPolygon_counter < 1)) {
System.out.println("Calling adjustPolygon #"
+ adjustPolygon_counter);
adjustmentMessage = "adjustPolygon #"
+ adjustPolygon_counter;
PolygonUtil.adjustPolygon(coords);
PolygonUtil.round(coords, 2);
coords = PolygonUtil
@ -529,16 +539,11 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
int counter = 0;
if (!outputHatchedArea.isValid() && (counter < 2)) {
System.out
.println("calling adjustVertex & alterVertexes: loop #"
+ counter);
int adjustVertex_counter = 0;
lr = gf.createLinearRing(coords);
outputHatchedArea = gf.createPolygon(lr, null);
while (!outputHatchedArea.isValid()
&& (adjustVertex_counter < 5)) {
System.out.println(" Calling adjustVertex #"
+ adjustVertex_counter);
coords = PolygonUtil.adjustVertex(coords);
coords = PolygonUtil
.removeDuplicateCoordinate(coords);
@ -549,12 +554,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
adjustVertex_counter += 1;
}
int inner_counter = 0;
System.out.println("");
while (!outputHatchedArea.isValid()
&& (inner_counter < 5)) {
System.out
.println(" Calling alterVertexes #"
+ inner_counter);
coords = PolygonUtil.alterVertexes(coords);
coords = PolygonUtil
.removeDuplicateCoordinate(coords);
@ -564,7 +565,15 @@ public class WarngenLayer extends AbstractStormTrackResource {
outputHatchedArea = gf.createPolygon(lr, null);
inner_counter += 1;
}
counter += 1;
adjustmentMessage = String.format(
"adjustVertex & alterVertexes: %d, %d",
adjustVertex_counter, inner_counter);
}
if (adjustmentMessage != null) {
perfLog.logDuration("Vertex adjustments", System.currentTimeMillis() - tadj0);
statusHandler.debug(adjustmentMessage);
}
for (Coordinate c : outputHatchedArea.getCoordinates()) {
if (Double.isNaN(c.x) || Double.isNaN(c.y)) {
@ -575,6 +584,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
outputHatchedWarningArea = createWarnedArea(
latLonToLocal(outputHatchedArea),
latLonToLocal(warningArea));
if (! outputHatchedArea.isValid()) {
statusHandler.debug(String.format("Input %s redrawn to invalid %s",
inputWarningPolygon, outputHatchedArea));
}
}
this.hatchedArea = outputHatchedArea;
this.hatchedWarningArea = outputHatchedWarningArea;
@ -587,9 +600,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
* priority in getHatchedAreas().
*/
statusHandler.handle(Priority.DEBUG, String.format(
"Error redrawing polygon: %s\n Input: %s\n",
e.getLocalizedMessage(), inputWarningPolygon), e);
"Error redrawing polygon: %s\n Input: %s\nAdjustments: %s\n",
e.getLocalizedMessage(), inputWarningPolygon, adjustmentMessage), e);
}
perfLog.logDuration("AreaHatcher total", System.currentTimeMillis() - t0);
}
return Status.OK_STATUS;
@ -610,6 +624,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
public synchronized Geometry[] getHatchedAreas() {
long t0 = System.currentTimeMillis();
while (getState() != Job.NONE) {
try {
join();
@ -617,6 +632,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
return new Geometry[] { null, null };
}
}
long t1 = System.currentTimeMillis();
if (t1 - t0 > 250) {
perfLog.logDuration("Wait for AreaHatcher", t1 - t0);
}
if (getResult() == null) {
return null;
}
@ -1259,8 +1278,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
this.configuration = config;
}// end synchronize
System.out.println("Total time to init warngen config = "
+ (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration("Init warngen config",
System.currentTimeMillis() - t0);
}
private void initializeGeomUpdateObserver() {
@ -1459,8 +1478,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
gData.localGridGeometry = new GeneralGridGeometry(range, ge);
System.out.println("Time to lookup geospatial data "
+ (System.currentTimeMillis() - tq0));
perfLog.logDuration("Lookup geospatial data",
System.currentTimeMillis() - tq0);
siteMap.put(currKey, gData);
GeospatialData[] timezones = GeospatialFactory.getTimezones();
@ -1957,8 +1976,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
: null);
updateWarnedAreaState(newWarningArea, snapHatchedAreaToPolygon);
System.out.println("determining hatchedArea took "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Determining hatchedArea",
System.currentTimeMillis() - t0);
}
/**
@ -2664,8 +2683,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
return true;
}
long t0 = System.currentTimeMillis();
try {
long t0 = System.currentTimeMillis();
Polygon hatched = state.getWarningPolygon();
Geometry hatchedArea = state.getWarningArea();
if (areaHatcher != null) {
@ -2713,13 +2732,13 @@ public class WarngenLayer extends AbstractStormTrackResource {
issueRefresh();
result = false;
}
System.out.println("Time to createWarningPolygon: "
+ (System.currentTimeMillis() - t0) + "ms");
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Error hatching polygon", e);
result = false;
}
perfLog.logDuration("redrawBoxFromHatched",
System.currentTimeMillis() - t0);
issueRefresh();
}
return result;

View file

@ -62,7 +62,9 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
@ -145,6 +147,7 @@ import com.vividsolutions.jts.io.WKTReader;
* Aug 28, 2014 ASM #15551 Qinglu Lin Replaced 1200 PM/1200 AM by NOON/MIDNIGHT, removed days in
* included tornado/severe thunderstorm watch message.
* Sep 18, 2014 ASM #15465 Qinglu Lin For backup, get officeShort and officeLoc from backup WFO's config.xml.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author njensen
@ -155,6 +158,9 @@ public class TemplateRunner {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(TemplateRunner.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private static final String LOGIN_NAME_KEY = "LOGNAME";
private static final Pattern BBB_PATTERN = Pattern
@ -295,15 +301,15 @@ public class TemplateRunner {
t0 = System.currentTimeMillis();
areas = area.findAffectedAreas(config, warnPolygon, warningArea,
threeLetterSiteId);
System.out.println("Time to get areas = "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("runTemplate get areas",
System.currentTimeMillis() - t0);
context.put(config.getHatchedAreaSource().getVariable(), areas);
t0 = System.currentTimeMillis();
intersectAreas = area.findInsectingAreas(config, warnPolygon,
warningArea, threeLetterSiteId, warngenLayer);
System.out.println("Time to get intersecting areas = "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("runTemplate get intersecting areas",
System.currentTimeMillis() - t0);
for (String ia : intersectAreas.keySet()) {
context.put(ia, intersectAreas.get(ia));
}
@ -380,9 +386,8 @@ public class TemplateRunner {
"Either timezoneGeom or/and warningArea is null. "
+ "Timezone cannot be determined.");
}
System.out
.println("Time to do size computation = "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("runTemplate size computation",
System.currentTimeMillis() - t0);
if (totalSize > minSize) {
timeZones.add(oneLetterTZ[i]);
}
@ -544,8 +549,8 @@ public class TemplateRunner {
context.put("eventLocation", coords);
t0 = System.currentTimeMillis();
ToolsDataManager.getInstance().setStormTrackData(std);
System.out.println("save storm track data: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Save storm track data",
System.currentTimeMillis() - t0);
} else {
// Retrieve the old Warning
// Example: s[0-5] = T.CON-KLWX.SV.W.0123
@ -601,8 +606,8 @@ public class TemplateRunner {
std.setMotionSpeed(oldWarn.getMotspd());
t0 = System.currentTimeMillis();
ToolsDataManager.getInstance().setStormTrackData(std);
System.out.println("save storm track data: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Save storm track data",
System.currentTimeMillis() - t0);
}
}
@ -859,8 +864,7 @@ public class TemplateRunner {
WatchUtil watchUtil = new WatchUtil(warngenLayer);
List<Watch> watches = watchUtil.getWatches(config, warnPolygon,
simulatedTime);
System.out.println("getWatches time: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("getWatches", System.currentTimeMillis() - t0);
if (watches != null && watches.isEmpty() == false) {
context.put("watches", watches);
}
@ -875,8 +879,7 @@ public class TemplateRunner {
long tz0 = System.currentTimeMillis();
String script = createScript(warngenLayer.getTemplateName() + ".vm",
context);
System.out.println("velocity time: "
+ (System.currentTimeMillis() - tz0));
perfLog.logDuration("velocity", System.currentTimeMillis() - tz0);
String text = script.toString();
WarningTextHandler handler = WarningTextHandlerFactory.getHandler(

View file

@ -23,6 +23,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.viz.warngen.gis.AffectedAreas;
/**
@ -36,6 +38,7 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
* ------------ ---------- ----------- --------------------------
* Sep 24, 2012 15322 jsanchez Initial creation
* Jan 8, 2013 15664 Qinglu Lin Appended WarningAction to handle()'s parameter list, etc.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
*
* </pre>
*
@ -43,6 +46,8 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
* @version 1.0
*/
public class WarningTextHandler {
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
private AbstractLockingBehavior lockingBehavior;
@ -69,8 +74,8 @@ public class WarningTextHandler {
text = clean(text);
System.out.println("Time to handle the text: "
+ (System.currentTimeMillis() - t0));
perfLog.logDuration("Handle the text",
System.currentTimeMillis() - t0);
return text;
}

View file

@ -41,7 +41,9 @@ import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.site.SiteMap;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
@ -78,6 +80,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Aug 14, 2013 DR 16483 Qinglu Lin Fixed no option issue in WarnGen dropdown menu after
* issuance of an CANCON and restart of CAVE.
* Oct 16, 2013 2439 rferrel Restrict retrieval of warnings to prevent getting future warnings.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* </pre>
*
* @author mschenke
@ -88,6 +91,9 @@ public class CurrentWarnings {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CurrentWarnings.class);
private static final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("WG:");
public static interface IWarningsArrivedListener {
public void warningsArrived();
}
@ -244,8 +250,8 @@ public class CurrentWarnings {
long t0 = System.currentTimeMillis();
List<AbstractWarningRecord> warnings = requestRecords(constraints);
System.out.println("Time to request CurrentWarnings records: "
+ (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration("Request CurrentWarnings records",
System.currentTimeMillis() - t0);
processRecords(warnings);
}
@ -542,8 +548,8 @@ public class CurrentWarnings {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
System.out.println("Time to prepare " + records.size()
+ " records = " + (System.currentTimeMillis() - t0) + "ms");
perfLog.logDuration("Prepare " + records.size() + " records",
System.currentTimeMillis() - t0);
}
return prepared;

View file

@ -68,6 +68,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Mar 04, 2014 2832 njensen Moved disposeInternal() to abstract class
* Apr 07, 2014 2959 njensen Correct handling of color change
* Apr 14, 2014 DR 17257 D. Friedman Redo time matching on per-minute refresh.
* Apr 28, 2015 ASM #15008 D. Friedman Create polygon for EXTs even if original product is not found.
*
* </pre>
*
@ -268,9 +269,11 @@ public class WarningsResource extends AbstractWWAResource {
}
}
}
// create the new polygon for the CON outside of the above
// for loop
if (createShape != null) {
/* Create a new polygon for the follow-up to the original
* product found in the above loop. Also create a polygon
* for EXT actions even if the original was not found.
*/
if (createShape != null || act == WarningAction.EXT) {
initShape(target, warnrec);
}
} else {

View file

@ -22,8 +22,8 @@ package com.raytheon.edex.plugin.gfe.isc;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@ -31,11 +31,20 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.edex.plugin.gfe.server.IFPServer;
import com.raytheon.uf.common.dataplugin.gfe.request.IscDataRecRequest;
import com.raytheon.uf.common.python.concurrent.IPythonJobListener;
import com.raytheon.uf.common.python.concurrent.PythonJobCoordinator;
@ -44,7 +53,6 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.common.util.file.FilenameFilters;
import com.raytheon.uf.edex.site.SiteAwareRegistry;
/**
* ISC data receive service. Takes incoming request and executes iscDataRec
@ -60,6 +68,7 @@ import com.raytheon.uf.edex.site.SiteAwareRegistry;
* Mar 12, 2013 #1759 dgilling Re-implement using IscScript.
* Mar 14, 2013 #1794 djohnson Consolidate common FilenameFilter implementations.
* Dec 10, 2014 #4953 randerso Properly handle single file reception
* May 06, 2015 #4383 dgilling Properly XML parse incoming XML file.
*
* </pre>
*
@ -68,9 +77,12 @@ import com.raytheon.uf.edex.site.SiteAwareRegistry;
*/
public class IscReceiveSrv {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(IscReceiveSrv.class);
private static final String ISC_REQUEST = "iscrequest";
private static final String METHOD_NAME = "main";
private static final FilenameFilter docFileFilter = FilenameFilters
@ -113,6 +125,9 @@ public class IscReceiveSrv {
} catch (GfeConfigurationException e) {
statusHandler.error("Error getting GFE configuration", e);
return;
} catch (SAXException | ParserConfigurationException e) {
statusHandler.error("Error parsing received XML file.", e);
return;
}
for (Entry<String, String[]> siteArgs : siteArgMap.entrySet()) {
@ -132,7 +147,9 @@ public class IscReceiveSrv {
}
private Map<String, String[]> prepareIscDataRec(String[] args)
throws IOException, InterruptedException, GfeConfigurationException {
throws IOException, InterruptedException,
GfeConfigurationException, SAXException,
ParserConfigurationException {
Map<String, String[]> siteMap = new HashMap<String, String[]>();
String[] incomingFiles = args[2].split(",");
@ -145,26 +162,21 @@ public class IscReceiveSrv {
xmlFileName = incomingFiles[1];
}
// TODO properly decode the xml
final File incomingXMLFile = new File(xmlFileName);
String fileContents = FileUtil.file2String(incomingXMLFile);
Pattern siteTagRegEx = Pattern.compile("<site>(.*?)</site>");
Matcher matcher = siteTagRegEx.matcher(fileContents);
List<String> siteList = new ArrayList<String>();
while (matcher.find()) {
siteList.add(matcher.group(1));
}
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(incomingXMLFile);
doc.getDocumentElement().normalize();
List<String> activeSites = Arrays.asList(SiteAwareRegistry
.getInstance().getActiveSites());
if (fileContents.contains("<iscrequest>")) {
// Need to copy the request file if more than 1 site is active
// on this EDEX server. Otherwise, the file will be deleted
// after the first site has processed the request file
siteList.remove(siteList.size() - 1);
Collection<String> siteList = getXMLDestinations(doc);
Set<String> activeSites = IFPServer.getActiveSites();
for (int i = 0; i < siteList.size(); i++) {
final String siteId = siteList.get(i);
if (ISC_REQUEST.equals(doc.getDocumentElement().getNodeName())) {
/*
* This case is for processing an ISC Request/Reply message
* requesting our site's grids.
*/
for (String siteId : siteList) {
if (activeSites.contains(siteId)) {
if (IFPServerConfigManager.getServerConfig(siteId)
.requestISC()) {
@ -180,11 +192,8 @@ public class IscReceiveSrv {
}
incomingXMLFile.delete();
} else {
// Remove the source site
siteList.remove(0);
Set<String> siteSet = new HashSet<String>(siteList);
try {
for (String site : siteSet) {
for (String site : siteList) {
if (activeSites.contains(site)
&& IFPServerConfigManager.getServerConfig(site)
.requestISC()) {
@ -272,4 +281,46 @@ public class IscReceiveSrv {
return siteMap;
}
private Collection<String> getXMLDestinations(final Document doc)
throws SAXException, IOException, ParserConfigurationException {
Collection<String> destinations = new HashSet<>();
// Expected XML format:
// <isc>
// <source></source>
// <destinations>
// <address>
// <site>SITE_ID</site>
// </address>
// </destinations>
// </isc>
NodeList destNodes = doc.getElementsByTagName("destinations");
if (destNodes.getLength() > 0) {
Node destNode = destNodes.item(0);
if (destNode.getNodeType() == Node.ELEMENT_NODE) {
Element destElement = (Element) destNode;
NodeList addrNodes = destElement
.getElementsByTagName("address");
for (int i = 0; i < addrNodes.getLength(); i++) {
Node addrNode = addrNodes.item(i);
if (addrNode.getNodeType() == Node.ELEMENT_NODE) {
Element addrElement = (Element) addrNode;
NodeList siteIdNodes = addrElement
.getElementsByTagName("site");
if (siteIdNodes.getLength() > 0) {
Node siteIDNode = siteIdNodes.item(0);
String siteID = siteIDNode.getTextContent();
destinations.add(siteID);
}
}
}
}
}
return destinations;
}
}

View file

@ -35,17 +35,16 @@ class TextProduct(MultipleElementTable.TextProduct):
Definition = copy.deepcopy(MultipleElementTable.TextProduct.Definition)
Definition["displayName"] = "MultipleElementTable"
Definition["database"] = "Official"
#Definition["outputFile"] = "/awips/GFESuite/products/TEXT/MultipleElementTable.txt"
#Definition["defaultEditAreas"] = [
#Definition["regionList"] = [
# ("area1","AREA 1"),
# ("area2","AREA 2"),
# ("area3","AREA 3"),
# ]
# ],
#Definition["regionList"] = [
# ("/33",["AREA 1","AREA 2"]),
# ("/19",["AREA 3"])
# ]
# ],
#Definition["elementList"] = ["Temp", "PoP"] # Default
#Definition["elementList"] = ["Temp", "Humidity"]

View file

@ -1,206 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
########################################################################
# RDFcst
#
########################################################################
## EXAMPLE OUTPUT:
##
## 24 Hour Tabular Forecast for Boulder for 12 AM MST Mar 21 TO 12 PM MST Mar 21.
##
## Weather Element 12 AM 3 AM 6 AM 9 AM
##
## Temperature 30 28 29
## Dew Point 25 23 25
## Wind (mph) NW 4 NW 5 NW 6
## Sky Cover(%) MOSTLY MOSTLY MOSTLY
## CLOUDY CLOUDY CLOUDY
## Rainfall Amount(in.) 0.00 0.00 0.00 0.00
## Weather RAIN RAIN
## Snowfall(in.) 0 0 0 0
##
## This forecast was generated from a gridded database.
# Forecast Definition
RDFcst = {
## General Set-Up
"type": "table",
"displayName": "RDFcst", # for Product Generation Menu
"database": "Official",
# Output file for product results
"outputFile": "/home/ifp/release/products/TEXT/RDFcst.txt", # default output file
"runTimeOutputFile": "no", # If yes, ask user at run time
# Language
"language": "english", # default
"runTimeLanguage": "no", # If yes, ask user at run time
# Line Length for resulting Product
"lineLength": 79, # default
"runTimeLineLength": "no", # If yes, ask user at run time
# Text to preceed and follow the text product.
# Remember to add spacing lines backslash n.
# The variables: %TimePeriod, %EditArea, and %WeatherElement
# can be included to be filled in with constant variables.
# For phrase and combo, only %EditArea and %TimePeriod
# can be filled in.
"timePeriodMethod": "localTRLabel", ## localRangeLabel
"editAreaLoopBegText": "24 Hour Tabular Forecast for %EditArea for %TimePeriod. \n\n",
"editAreaLoopEndText": "\n",
"endingText": "\nThis forecast was generated from a gridded database.\n\n\n",
## Table Layout
# A table is a combination of three variables:
# edit areas, weather elements, and time periods
# One of these variables is held constant,
# one is assigned to rows and the other to columns.
"constantVariable": "EditArea", ## "TimePeriod",
"rowVariable": "WeatherElement", ## "EditArea",
"columnVariable": "TimePeriod", ## "WeatherElement",
"columnJustification":"Right",
## Edit Areas
# If the edit area is the constant variable, specify
# one area and whether to ask user at run time.
# runTimeEditArea can be a list of areas and/or edit area
# groups (groups will be expanded into areas) from which
# the user will be able to choose.
"defaultEditAreas": [
("area1", "Area1"),
("area2", "Area2"),
("area3", "Area3"),
("area4", "Area4")],
"runTimeEditAreas": "yes",
"areaType" : "Edit Area", # E.g. City, County, Basin, etc.
# Time Ranges
"defaultRanges": ["Today"],
"runTimeRanges" : "no", # if yes, ask user at run time
## Weather Elements
# elementList: List of Weather Element tuples:
# Weather Element Name
# Weather Element Label
# If you want the label to appear on multiple lines,
# use vertical bars as separators e.g. Maximum|Temperature
# Analysis method -- Method to produce statistics from the data
# ReportAs Method -- Method to format the analyzed value(s)
# DataType: Scalar or Vector or Weather
# Rounding increment e.g. 5 = round final value to
# nearest multiple of 5
# Conversion method
# e.g. "mphToKt" converts from mph to knots
#
# If the weather element is the constant variable, only one
# should be given.
# Name , Label , Analysis Method , ReportAs Method ,
# DataType , Rounding , Conversion
"elementList": [
("T","Temperature",
"avg",
"singleValue",
"Scalar", 1, None),
("Td","Dew Point",
"avg",
"singleValue",
"Scalar", 1, None),
("RH","Relative Humidity(%)",
"avg",
"singleValue",
"Scalar", 1, None),
("WindChill","Wind Chill(F)",
"avg",
"singleValue",
"Scalar", 1, None),
("Wind","Wind (mph)",
"vectorRange",
"avgValue",
"Vector", 1, "ktToMph"),
("Sky","Sky Cover(%)",
"avg",
"cloudCover",
"Scalar", 5, None),
("QPF","Rainfall Amount(in.)",
"avg",
"singleValue",
"Scalar", .01, None),
("Wx","Weather ",
"dominantWx",
"short_weather_phrase",
"Scalar", 1, None),
("SnowAmt","Snowfall(in.)",
"avg",
"singleValue",
"Scalar", 1, None),
("PoP", "Precip (%)",
"avg",
"singleValue",
"Scalar", 1, None),
],
## Time Period (If rows or columns vary with TimePeriod
# timePeriod: This is the interval in hours for sampling the data
# e.g. every 3 hours.
# (Can be floating point e.g. 1.5 hour TimePeriods)
"timePeriod": 3,
# timeSpan: This is the amount of data to sample at each
# interval.
# If you want the data analyzed (e.g averaged) over the
# entire period, the timeSpan should be set to "timePeriod".
# If you only want data for the beginning of each timePeriod,
# the timeSpan should be set to number of hours over which
# to analyze the data e.g. 1 hour
"timeSpan": 1,
"runTimePeriod": "no", # If yes, ask user at run time for period
# Method to label periods given a time range
# periodLabel -- GMT time hourZ/day e.g. 15Z/4
# localTimeLabel -- local time e.g. 6 AM
# localRangeLabel -- local time range e.g. 6AM-9AM
"periodLabelMethod": "localTimeLabel",
## User-supplied Methods
# loopMethod: Method to be called for each row.
# Such a method might keep ongoing statistics about table data.
# Arguments: (rowLabel, rowEntries, userDict, argDict)
# Returns: nothing
# "rowEntries" is a list of (colValue, value) tuples
# describing the entries in this row.
# "userDict" is a dictionary set up for user-defined
# callback methods so they can keep ongoing data as
# the table is being produced.
# It is not modified by the TextFormatter code.
"loopMethod": None,
# endMethod: Method to be called after table is complete.
# Arguments: (table, userDict, argDict)
# Returns: table (could be modified)
# The table can be modified to report summary statistics
# gathered in userDict.
#
"endMethod": None,
}

View file

@ -1,311 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#-------------------------------------------------------------------------
# Description: This product creates a Smart Element Table.
# The possible elements are Temperature (MaxT, MinT), Humidity (MinRH, MaxRH), and PoP
#-------------------------------------------------------------------------
# Copying:
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#-------------------------------------------------------------------------
# Standard and Local file names and Locations:
# MultipleElementTableTable, MultipleElementTable_Local, MultipleElementTable_Aux_Local
#-------------------------------------------------------------------------
# User Configurable Variables:
#-------------------------------------------------------------------------
# Weather Elements Needed:
#-------------------------------------------------------------------------
# Edit Areas Needed:
#-------------------------------------------------------------------------
# Associated Utilities Files e.g. Combinations file:
#-------------------------------------------------------------------------
# Component Products:
#-------------------------------------------------------------------------
# Programmers and Support including product team leader's email:
#-------------------------------------------------------------------------
# Development tasks that are identified and in progress:
#-------------------------------------------------------------------------
# Additional Information:
#-------------------------------------------------------------------------
import TextRules
import SampleAnalysis
import string, time, types
class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
VariableList = [
("Forecast Product" , "Morning", "radio",
["Morning","Afternoon"]),
]
Definition = {
"type": "smart",
"displayName": "None",
"database": "Official",
"outputFile": "/awips/GFESuite/products/TEXT/SmartElementTable.txt",
"defaultEditAreas": [
("area1","AREA 1"),
("area2","AREA 2"),
("area3","AREA 3"),
],
# Product-specific variables
"regionList" : [
("/33",["AREA 1","AREA 2"]),
("/19",["AREA 3"])
],
# Possible elements are:
# "Temp" -- lists MaxT for daytime, MinT for nighttime
# "PoP"
# "Humidity" -- lists MinRH for daytime, MaxRH for nighttime
"elementList" : ["Temp", "PoP"],
# If set to 1, only one value for each element is listed
"includeTitle": 1,
"introLetters": ".<",
}
def __init__(self):
TextRules.TextRules.__init__(self)
SampleAnalysis.SampleAnalysis.__init__(self)
def generateForecast(self, argDict):
# Generate formatted product for a list of edit areas
# Get variables from varDict and Definition
self._getVariables(argDict)
# Get the areaList -- derived from defaultEditAreas and
# may be solicited at run-time from the user if desired
self._areaList = self.getAreaList(argDict)
# Determine time ranges for which the data will be sampled
self._determineTimeRanges(argDict)
# Sample the data
self._sampleData(argDict)
# Initialize the output string
fcst = ""
fcst = self._preProcessProduct(fcst, argDict)
# Generate the product for each edit area in the list
for editArea, areaLabel in self._areaList:
fcst = self._preProcessArea(fcst, editArea, areaLabel, argDict)
fcst = self._makeProduct(fcst, editArea, areaLabel, argDict)
fcst = self._postProcessArea(fcst, editArea, areaLabel, argDict)
fcst = self._postProcessProduct(fcst, argDict)
return fcst
def _getVariables(self, argDict):
# Determine whether Morning or Afternoon product type
varDict = argDict["varDict"]
self._productType = varDict["Forecast Product"]
# Make argDict accessible
self.__argDict = argDict
# Set up any other product-specific variables from the Definition
self._definition = argDict["forecastDef"]
for key in self._definition.keys():
exec "self._" + key + "= self._definition[key]"
self._currentRegion = None
# The analysisList tells which weather elements and statistics
# are desired for the product.
self._analysisList = self._getAnalysisList()
def _determineTimeRanges(self, argDict):
# Determine time ranges for product
# Sets up self._timeRangeList
if self._productType == "Morning":
timeRange = self.getTimeRange("Today", argDict)
numPeriods = 3
else:
timeRange = self.getTimeRange("Tonight", argDict)
numPeriods = 4
self._timeRangeList = self.getPeriods(timeRange, 12, 12, numPeriods)
return
def _sampleData(self, argDict):
# Sample the data
self._sampler = self.getSampler(argDict,
(self._analysisList, self._timeRangeList, self._areaList))
return
def _preProcessProduct(self, fcst, argDict):
# Set up format spacing and title line spacing
numElements = len(self._elementList)
if numElements > 2:
self._spaceStr = ""
else:
self._spaceStr = " "
if self._includeTitle == 0:
return fcst
self._titles = self._titleDict()
if numElements > 2:
if self._productType == "Morning":
self._headingLen = 15
else:
self._headingLen = 19
else:
if self._productType == "Morning":
self._headingLen = 21
else:
self._headingLen = 28
# Create title line
title = self._introLetters + " "
index = 0
for element in self._elementList:
title = title + string.center(
self._titles[element], self._headingLen)
if index < len(self._elementList)-1:
title = title + "/"
index += 1
return fcst + title + "\n"
def _preProcessArea(self, fcst, editArea, areaLabel, argDict):
# If we are in a new region, add region header
for region, areaList in self._regionList:
if areaLabel in areaList:
break
if region != self._currentRegion:
if self._currentRegion is not None:
# End the Region
fcst = fcst + "\n$$\n\n"
self._currentRegion = region
fcst = fcst + region
return fcst + "\n" + string.ljust(areaLabel, 10)
def _makeProduct(self, fcst, editArea, areaLabel, argDict):
# Get the Statistics
statList = self.getStatList(self._sampler, self._analysisList,
self._timeRangeList, editArea)
numElements = len(self._elementList)
index = 0
for element in self._elementList:
exec "fcst = fcst + self._get" + element + \
"Values(statList, argDict)"
if index < numElements-1:
fcst = fcst + " /"
index += 1
return fcst
def _postProcessArea(self, fcst, editArea, areaLabel, argDict):
return fcst
def _postProcessProduct(self, fcst, argDict):
fcst = fcst + "\n"
return fcst
########################################################################
# PRODUCT-SPECIFIC METHODS
########################################################################
def _getAnalysisList(self):
return [
("MinT", self.avg),
("MaxT", self.avg),
("MinRH", self.avg),
("MaxRH", self.avg),
("PoP", self.stdDevMaxAvg),
]
def _titleDict(self):
return {
"Temp": "TEMPERATURE",
"PoP": "PRECIPITATION",
"Humidity":"HUMIDITY",
}
def _getTempValues(self, statList, argDict):
# Return a string of Temperature values given statList
stats1 = statList[0]
if self._productType == "Morning":
stats2 = statList[1]
stats3 = statList[2]
t1 = self.getScalarVal(stats1["MaxT"])
t2 = self.getScalarVal(stats2["MinT"])
t3 = self.getScalarVal(stats3["MaxT"])
str = " " + t1+ self._spaceStr +t2+ self._spaceStr +t3
return str
else:
stats2 = statList[1]
stats3 = statList[2]
stats4 = statList[3]
t1 = self.getScalarVal(stats1["MinT"])
t2 = self.getScalarVal(stats2["MaxT"])
t3 = self.getScalarVal(stats3["MinT"])
t4 = self.getScalarVal(stats4["MaxT"])
str = " " +t1+ self._spaceStr +t2+ self._spaceStr +t3+ \
self._spaceStr+t4
return str
def _getHumidityValues(self, statList, argDict):
# Return a string of Humidity values given statList
stats1 = statList[0]
if self._productType == "Morning":
stats2 = statList[1]
stats3 = statList[2]
t1 = self.getScalarVal(stats1["MinRH"])
t2 = self.getScalarVal(stats2["MaxRH"])
t3 = self.getScalarVal(stats3["MinRH"])
return " " +t1+ self._spaceStr +t2+ self._spaceStr+t3
else:
stats2 = statList[1]
stats3 = statList[2]
stats4 = statList[3]
t1 = self.getScalarVal(stats1["MaxRH"])
t2 = self.getScalarVal(stats2["MinRH"])
t3 = self.getScalarVal(stats3["MaxRH"])
t4 = self.getScalarVal(stats4["MinRH"])
return " " +t1+ self._spaceStr +t2+ self._spaceStr +t3+ self._spaceStr +t4
def _getPoPValues(self, statList, argDict):
# Return a string of PoP values in the statList
pop = []
popStr = ""
index = 0
for stats in statList:
val = self._getPoPValue(stats)
if index < len(statList)-1:
popStr = popStr + val + self._spaceStr
else:
popStr = popStr + val
index += 1
popStr = popStr + " "
return popStr
def _getPoPValue(self, stats):
pop = self.getStats(stats,"PoP")
if pop is None:
val = " "
else:
max = self.round(pop, "Nearest", 10)
val = self.getScalarVal(max)
return val

View file

@ -1,59 +0,0 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
########################################################################
# SmartElementTable_Local
#
# Type: smart
# Local product:
# SmartElementTable_Local(type: smart)
# To customize this product for your site:
# Set up SmartElementTable_Local (see template below)
# to override variables, definitions, thresholds, and methods
##
##########################################################################
import SmartElementTable
import string, time, re, os, types, copy
class TextProduct(SmartElementTable.TextProduct):
Definition = copy.deepcopy(SmartElementTable.TextProduct.Definition)
Definition["displayName"] = "TEST_SmartElementTable"
#Definition["outputFile"] = "/awips/GFESuite/products/TEXT/SmartElementTable.txt"
#Definition["defaultEditAreas"] = [
# ("area1","AREA 1"),
# ("area2","AREA 2"),
# ("area3","AREA 3"),
# ]
#Definition["regionList"] = [
# ("/33",["AREA 1","AREA 2"]),
# ("/19",["AREA 3"])
# ]
#Definition["elementList"] = ["Temp", "PoP"] # Default
#Definition["elementList"] = ["Temp", "Humidity"]
#Definition["elementList"] = ["Temp", "Humidity", "PoP"]
#Definition["elementList"] = ["Temp", "PoP", "Humidity"]
#Definition["elementList"] = ["PoP", "Humidity", "Temp"]
#Definition["introLetters"] = ".<"
def __init__(self):
SmartElementTable.TextProduct.__init__(self)

View file

@ -97,9 +97,8 @@
<alias base="GFS161">gfs161</alias>
<alias base="GFS199">gfs161</alias>
<alias base="RUC130">ruc130</alias>
<alias base="RTMA">rtmaNDFD</alias>
<alias base="RTMA25">rtmaNDFD</alias>
<alias base="URMA25">urmaNDFD</alias>
<alias base="RTMA-Mosaic">rtmaNDFD</alias>
<alias base="AK-RTMA">aKrtmaNDFD</alias>
<alias base="NamDNG5">NamDNG5</alias>
<alias base="GlobalWave">GlobalWave</alias>
@ -143,8 +142,6 @@
<alias base="SREF243">sref243</alias>
<alias base="RTGSST">RTGSST235</alias>
<alias base="GFSGuide">gfsGuide232</alias>
<alias base="RTMA">rtmaNDFD</alias>
<alias base="RTMA-Mosaic">rtmaNDFD</alias>
<alias base="AK-RTMA">aKrtmaNDFD</alias>
<alias base="AK-RTMA3">aKrtmaNDFD</alias>
<alias base="HI-RTMA">HIrtmaNDFD</alias>

View file

@ -333,6 +333,7 @@
<alias base="tp6c6">tp6c6</alias>
<alias base="tp6c7">tp6c7</alias>
<alias base="tp6c8">tp6c8</alias>
<alias base="TCCerranl">tccerranl</alias>
<alias base="TP6mean">tpmean6</alias>
<alias base="TP6sprd">tpsprd6</alias>
<alias base="TP-ECMWF">tpecmwf</alias>

View file

@ -65,7 +65,7 @@
# being off
# being off
# 04/20/2015 #4414 dgilling Add missing NWPSTrkngCG0 weather elements.
#
# 05/12/2015 #17144 bhunder Added RTMA model
########################################################################
#----------------------------------------------------------------------------
@ -316,6 +316,8 @@ VisUnc = ("VisUnc", SCALAR, "SM", "Vsby Anl Uncertainty", 10.0, 0.0, 2, NO)
PressUnc = ("PressUnc", SCALAR, "Pa", "Press Anl Uncertainty", 110000.0, 0.0, 2, NO)
Pressure = ("Pressure", SCALAR, "Pa", "Pressure", 110000.0, 0.0, 2, NO)
WGustUnc = ("WGustUnc", SCALAR, "kts", "WGust Anl Uncertainty", 12.0, 0.0, 0, NO)
# DR 17144
SkyUnc = ("SkyUnc", SCALAR, "%", "Sky Uncertainty", 100.0, 0.0, 0, NO)
# NamDNG5 parms
QPF3 = ("QPF3", SCALAR, "in", "3HR QPF", 3.0, 0.0, 2, YES)
@ -1307,7 +1309,8 @@ elif SID in CONUS_EAST_SITES:
('nwpsCG1', 'nwpsCG1'),
('nwpsTrkngCG0', 'nwpsTrkngCG0'),
'MOSGuide',
'RTMA',
##############DR17144
('RTMA25', 'RTMA'),
'NamDNG5',
('TPCWindProb','TPCProb'),
('SREF212', 'SREF'),
@ -1384,7 +1387,8 @@ else: #######DCS3501 WEST_CONUS
('nwpsCG1', 'nwpsCG1'),
('nwpsTrkngCG0', 'nwpsTrkngCG0'),
'MOSGuide',
'RTMA',
#######DR17144
('RTMA25', 'RTMA'),
'NamDNG5',
('TPCWindProb','TPCProb'),
('SREF212', 'SREF'),
@ -2065,17 +2069,17 @@ TPCTCM_MODEL = [([HiWind], TC3)]
# RTMA database parameter groupings
#if SID in ALASKA_SITES: - not sure if this is right
# DCS17288
# DCS17288/DR17144
if SID in ALASKA_SITES or SID in ["HFO", "SJU"]:
RTMAPARMS = [([Temp,Td,RH,Wind,Vis,Pressure,WindGust],TC1),
([MinT],MinTTC), ([MaxT],MaxTTC),
([MinRH],MinRHTC), ([MaxRH],MaxRHTC),
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc,PressUnc,WGustUnc],TC1)]
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc,PressUnc,WGustUnc,SkyUnc],TC1)]
else:
RTMAPARMS = [([Temp,Td,RH,Wind,QPE,Sky,Vis,Pressure,WindGust],TC1),
([MinT],MinTTC), ([MaxT],MaxTTC),
([MinRH],MinRHTC), ([MaxRH],MaxRHTC),
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc,PressUnc,WGustUnc],TC1)]
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc,PressUnc,WGustUnc,SkyUnc],TC1)]
# NamDNG5 database parameter groupings
NamDNG5PARMS = [([Temp, Td, RH, Wind, Sky, WindGust, Vis], TC3),

View file

@ -22,7 +22,7 @@
##
import iscMosaic,iscUtil
import os, stat, sys, re, string, traceback, types
import os, stat, sys, re, string, types
import time, xml, LogStream, IrtAccess
import IrtServer
from xml.etree import ElementTree
@ -46,6 +46,7 @@ from java.util import ArrayList
# 12/08/2014 4953 randerso Added support for sending/receiving TCV files
# Additional code cleanup
# 04/08/2015 4383 dgilling Support FireWx ISC.
# 04/23/2015 4383 randerso Fixed exception logging
#
##
@ -78,7 +79,7 @@ def purgeFiles(msgid, files):
try:
os.remove(file)
except:
logEvent("iscDataRec Failed to remove: ",file)
logException("iscDataRec Failed to remove file %s: ", str(file))
def execIscDataRec(MSGID,SUBJECT,FILES):
@ -109,7 +110,7 @@ def execIscDataRec(MSGID,SUBJECT,FILES):
destTree = ElementTree.ElementTree(ElementTree.XML(xmlFileBuf))
iscE = destTree.getroot()
except:
logProblem("Malformed XML received")
logException("Malformed XML received")
return
#no XML destination information. Default to dx4f,px3 98000000, 98000001
@ -199,11 +200,11 @@ def execIscDataRec(MSGID,SUBJECT,FILES):
elif SUBJECT == 'GET_ACTIVE_TABLE2':
IrtServer.getVTECActiveTable(dataFile, xmlFileBuf)
elif SUBJECT in ['ISCGRIDS', 'ISCGRIDS2']:
import localConfig
import serverConfig
additionalISCRouting = []
if localConfig.AdditionalISCRouting:
additionalISCRouting = localConfig.AdditionalISCRouting
if serverConfig.AdditionalISCRouting:
additionalISCRouting = serverConfig.AdditionalISCRouting
putISCGrids(dataFile, siteConfig.GFESUITE_SITEID, srcServer.get('site'), additionalISCRouting)
elif SUBJECT == 'ISCREQUEST':
IrtServer.serviceISCRequest(dataFile)
@ -220,7 +221,8 @@ def execIscDataRec(MSGID,SUBJECT,FILES):
logEvent('Sent to:',
irt.printServerInfo(destServer), "connectT=", delta1, "xmtT=", delta2)
except:
logProblem("iscDataRec failed!",traceback.format_exc())
logException("iscDataRec failed!")
finally:
# cleanup
purgeFiles(MSGID, FILES)
@ -303,8 +305,8 @@ def main(argv):
execIscDataRec(MSGID,SUBJECT,FILES)
except:
logProblem('Failure:', traceback.format_exc())
logException('Failure:')
except:
logProblem("FAIL: ", traceback.format_exc())
logException("FAIL: ")

View file

@ -23,6 +23,7 @@
# ------------ ---------- ----------- --------------------------
# 02/17/2015 4139 randerso Replaced call to iscTime.timeFromComponents
# with call to calendar.timegm
# 04/23/2015 4383 randerso Changed to log arguments to aid in troubleshooting
##
@ -521,9 +522,9 @@ class IscMosaic:
self.__processTimePeriod = (startTime, endTime)
initLogger(self.__logFile)
logger.info("iscMosaic Starting args: %s", str(args))
def execute(self):
logger.info("iscMosaic Starting")
# get the WxDefinition and DiscreteDefinition
config = IFPServerConfigManager.getServerConfig(self.__mysite)

View file

@ -100,6 +100,21 @@
<level>EA</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>tccerranl</short_name>
<long_name>Total Cloud Cover error analysis</long_name>
<units>%</units>
<udunits>percent</udunits>
<uiname>ErrorAnalysisCloud</uiname>
<valid_range>0.0</valid_range>
<valid_range>100.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>EA</levelsDesc>
<levels>
<level>EA</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>tp</short_name>
<long_name>total precipitation</long_name>

View file

@ -1065,25 +1065,21 @@ class Forecaster(GridUtilities):
LogStream.logEvent(msg)
try:
rval = apply(mthd, tuple(gargs))
rval = apply(mthd, tuple(gargs))
if rval is not None:
if type(rval) is not ndarray:
if type(rval) is not tuple:
jrval = rval
rval = rval.__numpy__
if len(rval) == 1:
if rval[0].dtype != int8:
if type(rval) is not ndarray and rval is not None:
if type(rval) is not tuple:
jrval = rval
rval = rval.__numpy__
if len(rval) == 1:
if rval[0].dtype != int8:
# scalar
rval = rval[0]
else:
else:
# discrete or weather
keys = JUtil.javaObjToPyVal(jrval.getKeyList())
rval.append(keys)
cache[we] = (rval, time)
else:
cache[we] = (None, time)
cache[we] = (rval, time)
if rval is not None and cache['mtime'][0] is not None and doStore:
parm = self.__getNewWE(we)

View file

@ -52,6 +52,12 @@ class RTMAForecaster(Forecaster):
grid = tcc_EA
return clip(grid, 0, 100)
##--------------------------------------------------------------------------
## Sky Analysis Uncertainty
##--------------------------------------------------------------------------
def calcSkyUnc(self, tccerranl_EA):
grid = tccerranl_EA
return clip(grid, 0, 100)
##--------------------------------------------------------------------------
## T - change K to F
##--------------------------------------------------------------------------
def calcT(self, t_FHAG2):

View file

@ -833,7 +833,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
print "Generating Forecast for", areaLabel
areaHeader = self.makeAreaHeader(
argDict, areaLabel, self._issueTime, self._expireTime,
self._areaDictionary, self._defaultEditAreas)
self._areaDictionary, self._defaultEditAreas, upperCase=True)
fcst = fcst + areaHeader
# get the hazards text

View file

@ -1132,7 +1132,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
print "Generating Forecast for", areaLabel
areaHeader = self.makeAreaHeader(
argDict, areaLabel, self._issueTime, self._expireTime,
self._areaDictionary, self._defaultEditAreas)
self._areaDictionary, self._defaultEditAreas, upperCase=True)
fcst = fcst + areaHeader
# get the hazards text

View file

@ -504,6 +504,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
continue #no defined headline, skip phrase
endTimePhrase = self.hazardTimePhrases(eachHazard, argDict)
hazNameA = self.hazardName(eachHazard['hdln'], argDict, True)
hazNameACap = self.sentence(hazNameA, addPeriod=False)
hazName = self.hazardName(eachHazard['hdln'], argDict, False)
if hazName in ["Winter Weather Advisory", "Winter Storm Warning", "Beach Hazards Statement"]:
@ -527,18 +528,18 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
phraseCount = 2
if hdln != lastHdln:
if eachHazard['phen'] in ['HU', 'TR', 'TY']:
hazardBodyPhrase = hazardBodyPhrase + hazNameA + \
hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \
" has also been issued."
else:
hazardBodyPhrase = hazardBodyPhrase + hazNameA + \
hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \
" has also been issued. This " + hazName + forPhrase + \
" is in effect" + endTimePhrase + ". "
else:
if eachHazard['phen'] in ['HU', 'TR', 'TY']:
hazardBodyPhrase = hazardBodyPhrase + hazNameA + \
hazardBodyPhrase = hazardBodyPhrase + hazNameACap + \
" has also been issued."
else:
hazardBodyPhrase = hazardBodyPhrase + hazNameA + forPhrase + \
hazardBodyPhrase = hazardBodyPhrase + hazNameACap + forPhrase + \
" has also been issued" + endTimePhrase + ". "
else:
if eachHazard['phen'] in ['HU', 'TR', 'TY']:
@ -564,7 +565,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
hazardBodyPhrase = hazardBodyPhrase + \
" has cancelled the " + hazName + ". "
else:
hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \
hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \
" has been cancelled. "
#
@ -579,13 +580,13 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
continue # No attribution for this case if it is a bullet product
hazName = self.hazardName(eachHazard['hdln'], argDict, False)
if eachHazard['endTime'] <= argDict['creationTime']:
hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \
hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \
" is no longer in effect. "
else:
expTimeCurrent = argDict['creationTime']
timeWords = self.getTimingPhrase(eachHazard, expTimeCurrent)
hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \
hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \
" will expire " + timeWords + ". "
#
@ -600,7 +601,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
endTimePhrase = self.hazardTimePhrases(eachHazard, argDict)
hazName = self.hazardName(eachHazard['hdln'], argDict, False)
hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \
hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \
" is now in effect" + endTimePhrase + ". "
#
@ -611,7 +612,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis,
if len(eachHazard['hdln']) == 0:
continue #no defined headline, skip phrase
hazName = self.hazardName(eachHazard['hdln'], argDict, False)
hazardBodyPhrase = hazardBodyPhrase + "THE " + hazName + \
hazardBodyPhrase = hazardBodyPhrase + "The " + hazName + \
" is no longer in effect. "
#

View file

@ -24,6 +24,7 @@
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Oct 20, 2014 #3685 randerso Changed to support mixed case
# Apr 28, 2015 #4027 randerso Additional changes for mixed case
#
##
@ -90,14 +91,14 @@ class TextProduct(GenericHazards.TextProduct):
"name": "Forsyth County Environmental Affairs Department Winston-Salem NC",
"declaration": "The Forsyth County Environmental Affairs Department has issued an Air Quality Action Day...",
"zones": ["FLZ039"],
"text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the Forsyth County Environmental Affairs Department Web site at http://www.co.forsyth.nc.us/envaffairs.",
"text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the Forsyth County Environmental Affairs Department web site at http://www.co.forsyth.nc.us/envaffairs.",
},
"NC": {
"name": "North Carolina Department of Environmental and Natural Resources Raleigh NC",
"declaration": "The North Carolina Department of Environmental and Natural Resources has issued an Air Quality Action Day...",
"zones" : ["FLZ042", "FLZ043","FLZ048"],
"text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the North Carolina Division of Air Quality Web site at http://daq.state.nc.us/airaware/forecast/.",
"text": "A Code @ALERTCODE Air Quality Alert for Ozone has been issued. Ground level ozone concentrations within the region may approach or exceed unhealthy standards. @ALERTCTA For additional information...please visit the North Carolina Division of Air Quality web site at http://daq.state.nc.us/airaware/forecast/.",
},
}

View file

@ -295,9 +295,9 @@ class TextProduct(GenericHazards.TextProduct):
#period.
areaGroupLen = len(areaGroups)
if areaGroupLen == 1:
areaPhrase = "A portion of "
areaPhrase = "a portion of "
else:
areaPhrase = "Portions of "
areaPhrase = "portions of "
#parts of the states
areaGroupCount = 0
@ -326,39 +326,39 @@ class TextProduct(GenericHazards.TextProduct):
countyCnt = 0
for state, partOfState, names in areaGroups:
for name,nameType in names:
if nameType == "Zone":
if nameType == "zone":
zoneCnt = zoneCnt + 1
elif nameType == "County":
elif nameType == "county":
countyCnt = countyCnt + 1
elif nameType == "Independent city":
elif nameType == "independent city":
icCnt = icCnt + 1
elif nameType == "Parish":
elif nameType == "parish":
parishCnt = parishCnt + 1
incPhrases = []
if zoneCnt == 1:
incPhrases.append("Area")
incPhrases.append("area")
elif zoneCnt > 1:
incPhrases.append("Areas")
incPhrases.append("areas")
if countyCnt == 1:
incPhrases.append("County")
incPhrases.append("county")
elif countyCnt > 1:
incPhrases.append("Counties")
incPhrases.append("counties")
if icCnt == 1:
incPhrases.append("Independent city")
incPhrases.append("independent city")
elif icCnt > 1:
incPhrases.append("Independent cities")
incPhrases.append("independent cities")
if parishCnt == 1:
incPhrases.append("Parish")
incPhrases.append("parish")
elif parishCnt > 1:
incPhrases.append("Parishes")
incPhrases.append("parishes")
incPhrase = " and ".join(incPhrases)
if generalOnly:
return areaPhrase
areaPhrase = areaPhrase + "...Including the following " + \
areaPhrase = areaPhrase + "...including the following " + \
incPhrase + "..."
#list of the specific areas
@ -377,7 +377,10 @@ class TextProduct(GenericHazards.TextProduct):
phrase = "...".join(snames[0:-1])
# complex phrasing (state, partOfState, and names)
else:
phrase = "In "
if i == 0:
phrase = "in "
else:
phrase = "In "
if partOfState != '' and partOfState != ' ':
phrase = phrase + partOfState + ' '
phrase = phrase + state + "..." + "...".join(snames[0:-1])

View file

@ -3444,7 +3444,7 @@ class TextProduct(GenericHazards.TextProduct):
# t+="but will continue to be monitored until it no longer threatens the area. "
#
# else:
t+="AT "+ self._stormTime + "...the center of "
t+="At "+ self._stormTime + "...the center of "
# Fix the grammar if dealing with "remnants"
if re.search("(?i)remnants", self._stormTypeName) is not None:

View file

@ -595,7 +595,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
def _preProcessArea(self, fcst, editArea, areaLabel, argDict):
areaHeader = self.makeAreaHeader(
argDict, areaLabel, self._issueTime, self._expireTime,
self._areaDictionary, self._defaultEditAreas)
self._areaDictionary, self._defaultEditAreas, upperCase=True)
fcst = fcst + areaHeader
# get the hazards text

View file

@ -355,7 +355,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
# If a method, it will be called with arguments:
# tree, node, key, element
return {
"WaveHeight" : "surf................",
"WaveHeight" : "SURF................",
"Swell": "swell",
"Swell2": "swell",
"LabelSwell": "SWELL...............",
@ -377,8 +377,8 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
"MaxT":"highs",
"Wind": "winds",
# Used for Headlines
"Expected" : "expected",
"In effect" : "in effect",
"EXPECTED" : "expected",
"IN EFFECT" : "in effect",
# Used for single values
"around": "around ",
" VALLEYS/LWR SLOPES...": " INLAND...............",
@ -1229,7 +1229,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
return self.setWords(node, "")
self.setWords(node, "")
node.set("descriptor", "")
node.set("indentLabel", "20-foot winds.......")
node.set("indentLabel", "20-FOOT WINDS.......")
return self.DONE()
def fireRidgeValleyWind_setUp(self, tree, node):
@ -1539,7 +1539,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
tokens = line.split()
# Look for the city
for token in tokens:
if token == uviCity:
if token.upper() == uviCity.upper():
index = tokens.index(token)
state = tokens[index + 1]
if state == uviState:
@ -1598,7 +1598,7 @@ class TextProduct(TextRules.TextRules, SampleAnalysis.SampleAnalysis):
# Add error message to fcst
fcst = fcst + tideTable
continue
fcst = fcst + "\nAT " + label + "...\n\n"
fcst = fcst + "\nAt " + label + "...\n\n"
for line in tideTable:
if line.find(currentDate) == 0:
# Get the tide info

View file

@ -45,6 +45,8 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Feb 12, 2014 2655 njensen Set source
* Jun 05, 2014 3226 bclement LightningStikePoint refactor
* Jun 10, 2014 3226 bclement fixed source
* May 8, 2015 DR17252 MPorricelli Removed setting of source.
* Source set in TextLightningParser.
*
* </pre>
*
@ -57,12 +59,6 @@ public class TextLightningDecoder extends AbstractDecoder implements
private String traceId = null;
/*
* inferred from Wufeng Zhou comment in BinLightningDecoderUtil, stands for
* World Wide Lightning Location Network
*/
private static final String SOURCE = "WWLLN";
/**
* Construct a TextLightning decoder. Calling hasNext() after construction
* will return false, decode() will return a null.
@ -103,8 +99,6 @@ public class TextLightningDecoder extends AbstractDecoder implements
report.setTraceId(traceId);
report.setSource(SOURCE);
return new PluginDataObject[] { report };
}

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.common.activetable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
@ -56,6 +57,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* 04/28/2015 4027 randerso Expunged Calendar from ActiveTableRecord
* </pre>
*
* @author njensen
@ -126,19 +128,19 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
/** vtec start time */
@DynamicSerializeElement
protected Calendar startTime;
protected Date startTime;
@Column
@DynamicSerializeElement
protected Calendar endTime;
protected Date endTime;
@Column
@DynamicSerializeElement
protected Calendar issueTime;
protected Date issueTime;
@Column
@DynamicSerializeElement
protected Calendar purgeTime;
protected Date purgeTime;
@Column(length = 8)
@DynamicSerializeElement
@ -209,15 +211,15 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
@Column
@DynamicSerializeElement
protected Calendar floodBegin;
protected Date floodBegin;
@Column
@DynamicSerializeElement
protected Calendar floodCrest;
protected Date floodCrest;
@Column
@DynamicSerializeElement
protected Calendar floodEnd;
protected Date floodEnd;
@Override
public abstract Object clone();
@ -657,7 +659,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
/**
* @return the startTime
*/
public Calendar getStartTime() {
public Date getStartTime() {
return startTime;
}
@ -665,14 +667,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param startTime
* the startTime to set
*/
public void setStartTime(Calendar startTime) {
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
/**
* @return the endTime
*/
public Calendar getEndTime() {
public Date getEndTime() {
return endTime;
}
@ -680,14 +682,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param endTime
* the endTime to set
*/
public void setEndTime(Calendar endTime) {
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
/**
* @return the issueTime
*/
public Calendar getIssueTime() {
public Date getIssueTime() {
return issueTime;
}
@ -695,14 +697,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param issueTime
* the issueTime to set
*/
public void setIssueTime(Calendar issueTime) {
public void setIssueTime(Date issueTime) {
this.issueTime = issueTime;
}
/**
* @return the purgeTime
*/
public Calendar getPurgeTime() {
public Date getPurgeTime() {
return purgeTime;
}
@ -710,7 +712,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param purgeTime
* the purgeTime to set
*/
public void setPurgeTime(Calendar purgeTime) {
public void setPurgeTime(Date purgeTime) {
this.purgeTime = purgeTime;
}
@ -957,7 +959,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
/**
* @return the floodBegin
*/
public Calendar getFloodBegin() {
public Date getFloodBegin() {
return floodBegin;
}
@ -965,14 +967,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param floodBegin
* the floodBegin to set
*/
public void setFloodBegin(Calendar floodBegin) {
public void setFloodBegin(Date floodBegin) {
this.floodBegin = floodBegin;
}
/**
* @return the floodCrest
*/
public Calendar getFloodCrest() {
public Date getFloodCrest() {
return floodCrest;
}
@ -980,14 +982,14 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param floodCrest
* the floodCrest to set
*/
public void setFloodCrest(Calendar floodCrest) {
public void setFloodCrest(Date floodCrest) {
this.floodCrest = floodCrest;
}
/**
* @return the floodEnd
*/
public Calendar getFloodEnd() {
public Date getFloodEnd() {
return floodEnd;
}
@ -995,7 +997,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
* @param floodEnd
* the floodEnd to set
*/
public void setFloodEnd(Calendar floodEnd) {
public void setFloodEnd(Date floodEnd) {
this.floodEnd = floodEnd;
}
@ -1050,17 +1052,17 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
}
atr.setAct(wr.getAct());
atr.setCountyheader(wr.getCountyheader());
atr.setEndTime(wr.getEndTime());
atr.setEndTime(calendarToDate(wr.getEndTime()));
atr.setEtn(wr.getEtn());
atr.setFloodBegin(wr.getFloodBegin());
atr.setFloodCrest(wr.getFloodCrest());
atr.setFloodEnd(wr.getFloodEnd());
atr.setFloodBegin(calendarToDate(wr.getFloodBegin()));
atr.setFloodCrest(calendarToDate(wr.getFloodCrest()));
atr.setFloodEnd(calendarToDate(wr.getFloodEnd()));
atr.setFloodRecordStatus(wr.getFloodRecordStatus());
atr.setFloodSeverity(wr.getFloodSeverity());
atr.setForecaster(wr.getForecaster());
atr.setGeometry(wr.getGeometry());
atr.setImmediateCause(wr.getImmediateCause());
atr.setIssueTime(wr.getIssueTime());
atr.setIssueTime(calendarToDate(wr.getIssueTime()));
atr.setLoc(wr.getLoc());
atr.setLocationID(wr.getLocationID());
atr.setMotdir(wr.getMotdir());
@ -1071,13 +1073,13 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
atr.setPhensig(wr.getPhensig());
atr.setPil(wr.getPil());
atr.setProductClass(wr.getProductClass());
atr.setPurgeTime(wr.getPurgeTime());
atr.setPurgeTime(calendarToDate(wr.getPurgeTime()));
atr.setRawmessage(wr.getRawmessage());
atr.setRegion(wr.getRegion());
atr.setSeg(wr.getSeg());
atr.setSegText(wr.getSegText());
atr.setSig(wr.getSig());
atr.setStartTime(wr.getStartTime());
atr.setStartTime(calendarToDate(wr.getStartTime()));
atr.setUfn(wr.isUfn());
atr.setVtecstr(wr.getVtecstr());
atr.setWmoid(wr.getWmoid());
@ -1093,4 +1095,11 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
return list;
}
private static Date calendarToDate(Calendar calendar) {
Date date = null;
if (calendar != null) {
date = calendar.getTime();
}
return date;
}
}

View file

@ -20,7 +20,7 @@
package com.raytheon.uf.common.activetable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -37,7 +37,8 @@ import com.vividsolutions.jts.geom.Geometry;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 4, 2013 dgilling Initial creation
* Mar 4, 2013 dgilling Initial creation
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -84,15 +85,12 @@ public class ActiveTableUtil {
template.put("phensig", atr.getPhensig());
template.put("act", atr.getAct());
template.put("seg", atr.getSeg());
template.put("startTime",
atr.getStartTime().getTimeInMillis() / 1000);
template.put("endTime", atr.getEndTime().getTimeInMillis() / 1000);
template.put("startTime", atr.getStartTime().getTime() / 1000);
template.put("endTime", atr.getEndTime().getTime() / 1000);
template.put("ufn", atr.isUfn());
template.put("officeid", atr.getOfficeid());
template.put("purgeTime",
atr.getPurgeTime().getTimeInMillis() / 1000);
template.put("issueTime",
atr.getIssueTime().getTimeInMillis() / 1000);
template.put("purgeTime", atr.getPurgeTime().getTime() / 1000);
template.put("issueTime", atr.getIssueTime().getTime() / 1000);
template.put("state", "Decoded");
template.put("xxxid", atr.getXxxid());
@ -104,9 +102,9 @@ public class ActiveTableUtil {
template.put("rawMessage", atr.getRawmessage());
template.put("countyheader", atr.getCountyheader());
Calendar floodBegin = atr.getFloodBegin();
Date floodBegin = atr.getFloodBegin();
if (floodBegin != null) {
long floodBeginMillis = floodBegin.getTimeInMillis();
long floodBeginMillis = floodBegin.getTime();
if (floodBeginMillis != 0) {
template.put("floodBegin", floodBeginMillis / 1000);
}
@ -114,31 +112,31 @@ public class ActiveTableUtil {
template.put("wmoid", atr.getWmoid());
// Warngen fields
Calendar floodCrest = atr.getFloodCrest();
Date floodCrest = atr.getFloodCrest();
if (floodCrest != null) {
long floodCrestMillis = floodCrest.getTimeInMillis();
long floodCrestMillis = floodCrest.getTime();
if (floodCrestMillis != 0) {
template.put("floodCrest", floodCrestMillis / 1000);
}
}
Calendar floodEnd = atr.getFloodEnd();
Date floodEnd = atr.getFloodEnd();
if (floodEnd != null) {
long floodEndMillis = floodEnd.getTimeInMillis();
long floodEndMillis = floodEnd.getTime();
if (floodEndMillis != 0) {
template.put("floodBegin", floodEndMillis / 1000);
}
}
String floodStatus = atr.getFloodRecordStatus();
if (floodStatus != null && !"".equals(floodStatus.trim())) {
if ((floodStatus != null) && !"".equals(floodStatus.trim())) {
template.put("floodrecordstatus", floodStatus);
}
String floodSeverity = atr.getFloodSeverity();
if (floodSeverity != null && !"".equals(floodSeverity.trim())) {
if ((floodSeverity != null) && !"".equals(floodSeverity.trim())) {
template.put("floodseverity", floodSeverity);
}
Geometry geometry = atr.getGeometry();
if (geometry != null && !geometry.isEmpty()) {
if ((geometry != null) && !geometry.isEmpty()) {
StringBuilder sb = new StringBuilder();
String sep = "";
long lat;
@ -154,17 +152,17 @@ public class ActiveTableUtil {
}
String immediateCause = atr.getImmediateCause();
if (immediateCause != null && !"".equals(immediateCause.trim())) {
if ((immediateCause != null) && !"".equals(immediateCause.trim())) {
template.put("immediateCause", immediateCause);
}
String loc = atr.getLoc();
if (loc != null && !"".equals(loc.trim())) {
if ((loc != null) && !"".equals(loc.trim())) {
template.put("loc", loc);
}
String locationId = atr.getLocationID();
if (locationId != null && !"".equals(locationId.trim())) {
if ((locationId != null) && !"".equals(locationId.trim())) {
template.put("locationId", locationId);
}

View file

@ -19,14 +19,14 @@
**/
package com.raytheon.uf.common.activetable;
import java.util.Calendar;
import java.util.Date;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.serialization.comm.IServerRequest;
/**
* TODO Add Description
* Request for next ETN in the sequence
*
* <pre>
*
@ -36,6 +36,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
* Feb 14, 2011 rjpeter Initial creation
* Oct 21, 2013 #1843 dgilling Add performISC and reportConflictOnly
* fields, proper constructors.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -55,7 +56,7 @@ public class GetNextEtnRequest implements IServerRequest {
private String phensig;
@DynamicSerializeElement
private Calendar currentTime;
private Date currentTime;
@DynamicSerializeElement
private boolean lockEtn;
@ -84,7 +85,7 @@ public class GetNextEtnRequest implements IServerRequest {
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
@ -95,7 +96,7 @@ public class GetNextEtnRequest implements IServerRequest {
* GetNextEtnRequest.
*/
public GetNextEtnRequest(String siteID, ActiveTableMode mode,
String phensig, Calendar currentTime, boolean lockEtn) {
String phensig, Date currentTime, boolean lockEtn) {
this(siteID, mode, phensig, currentTime, lockEtn, false, false, null);
}
@ -110,7 +111,7 @@ public class GetNextEtnRequest implements IServerRequest {
* The phenomenon and significance of the hazard concatenated
* with a '.' (e.g., TO.W or DU.Y)
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param lockEtn
* Whether or not to request an exclusive ETN--if true, this will
* cause the server to increment its running ETN sequence to the
@ -123,7 +124,7 @@ public class GetNextEtnRequest implements IServerRequest {
* Whether or not to collaborate with neighboring sites to
* determine the next ETN. See {@link
* GetNextEtnUtil#getNextEtnFromPartners(String, ActiveTableMode,
* String, Calendar, List<IRequestRouter>)} for more information.
* String, Date, List<IRequestRouter>)} for more information.
* @param reportConflictOnly
* Affects which kinds of errors get reported back to the
* requestor. If true, only cases where the value of
@ -136,7 +137,7 @@ public class GetNextEtnRequest implements IServerRequest {
* used by this site or one of its partners.
*/
public GetNextEtnRequest(String siteID, ActiveTableMode mode,
String phensig, Calendar currentTime, boolean lockEtn,
String phensig, Date currentTime, boolean lockEtn,
boolean performISC, boolean reportConflictOnly, Integer etnOverride) {
this.siteID = siteID;
this.mode = mode;
@ -180,11 +181,11 @@ public class GetNextEtnRequest implements IServerRequest {
this.lockEtn = lockEtn;
}
public Calendar getCurrentTime() {
public Date getCurrentTime() {
return currentTime;
}
public void setCurrentTime(Calendar currentTime) {
public void setCurrentTime(Date currentTime) {
this.currentTime = currentTime;
}

View file

@ -19,7 +19,7 @@
**/
package com.raytheon.uf.common.activetable.request;
import java.util.Calendar;
import java.util.Date;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -37,6 +37,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
* ------------ ---------- ----------- --------------------------
* Aug 19, 2013 #1843 dgilling Initial creation
* Oct 21, 2013 #1843 dgilling Add ETN override field.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -60,7 +61,7 @@ public class LockAndGetNextEtnRequest implements IServerRequest {
private String phensig;
@DynamicSerializeElement
private Calendar currentTime;
private Date currentTime;
@DynamicSerializeElement
private Integer etnOverride;
@ -70,12 +71,12 @@ public class LockAndGetNextEtnRequest implements IServerRequest {
}
public LockAndGetNextEtnRequest(String siteID, String requestorSiteID,
ActiveTableMode mode, String phensig, Calendar currentTime) {
ActiveTableMode mode, String phensig, Date currentTime) {
this(siteID, requestorSiteID, mode, phensig, currentTime, null);
}
public LockAndGetNextEtnRequest(String siteID, String requestorSiteID,
ActiveTableMode mode, String phensig, Calendar currentTime,
ActiveTableMode mode, String phensig, Date currentTime,
Integer etnOverride) {
this.siteID = siteID;
this.requestorSiteID = requestorSiteID;
@ -117,11 +118,11 @@ public class LockAndGetNextEtnRequest implements IServerRequest {
this.phensig = phensig;
}
public Calendar getCurrentTime() {
public Date getCurrentTime() {
return currentTime;
}
public void setCurrentTime(Calendar currentTime) {
public void setCurrentTime(Date currentTime) {
this.currentTime = currentTime;
}

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.common.activetable.request;
import java.util.Date;
import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -34,6 +36,7 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2013 #1843 dgilling Initial creation
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -54,7 +57,7 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest {
private ActiveTableMode mode;
@DynamicSerializeElement
private int year;
private Date currentTime;
@DynamicSerializeElement
private String phensig;
@ -67,11 +70,11 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest {
}
public UnlockAndSetNextEtnRequest(String siteID, String requestorSiteID,
ActiveTableMode mode, int year, String phensig, int newEtn) {
ActiveTableMode mode, Date currentTime, String phensig, int newEtn) {
this.siteID = siteID;
this.requestorSiteID = requestorSiteID;
this.mode = mode;
this.year = year;
this.currentTime = currentTime;
this.phensig = phensig;
this.newEtn = newEtn;
}
@ -100,12 +103,12 @@ public class UnlockAndSetNextEtnRequest implements IServerRequest {
this.mode = mode;
}
public int getYear() {
return year;
public Date getCurrentTime() {
return currentTime;
}
public void setYear(int year) {
this.year = year;
public void setCurrentTime(Date currentTime) {
this.currentTime = currentTime;
}
public String getPhensig() {

View file

@ -34,6 +34,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 3, 2014 3226 bclement Initial creation
* May 8, 2015 DR17252 MPorricelli Use HOUR_OF_DAY for setHour
*
* </pre>
*
@ -118,7 +119,7 @@ public class BaseLightningPoint {
* Hour of the day [0..23].
*/
public void setHour(int hour) {
this.time.set(Calendar.HOUR, hour);
this.time.set(Calendar.HOUR_OF_DAY, hour);
}
/**

View file

@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;
import jep.JepException;
@ -108,6 +109,8 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* Feb 23, 2015 4127 dgilling Use cluster locking to only allow 1 active
* table write at a time.
* Mar 04, 2015 4129 randerso Pass active table change logger to ingestAt and/or MergeVTEC
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord,
* fixed next ETN query to query for >= Jan 1
*
* </pre>
*
@ -447,7 +450,7 @@ public class ActiveTable {
@SuppressWarnings("unchecked")
private static List<ActiveTableRecord> queryTable(String siteId,
ActiveTableMode mode, String phensigList, String action,
String etn, Calendar currentTime, boolean requestValidTimes,
String etn, Date currentTime, boolean requestValidTimes,
boolean latestEtn) {
DatabaseQuery query = null;
CoreDao dao = null;
@ -472,27 +475,18 @@ public class ActiveTable {
query.addQueryParam("etn", etn, "in");
}
if (requestValidTimes && (currentTime != null)) {
// Current Time
query.addQueryParam("endTime", currentTime, "greater_than");
}
if (latestEtn && (currentTime != null)) {
Calendar yearStart = Calendar.getInstance();
yearStart.set(currentTime.get(Calendar.YEAR), Calendar.JANUARY,
0, 0, 0);
query.addQueryParam("startTime", yearStart, "greater_than");
query.addOrder("etn", false);
query.setMaxResults(1);
}
if (requestValidTimes && currentTime != null) {
if (requestValidTimes && (currentTime != null)) {
// Current Time
query.addQueryParam("endTime", currentTime, "greater_than");
query.addQueryParam("endTime", currentTime, ">");
}
if (latestEtn && currentTime != null) {
Calendar yearStart = Calendar.getInstance();
yearStart.set(currentTime.get(Calendar.YEAR), Calendar.JANUARY, 1,
if (latestEtn && (currentTime != null)) {
Calendar yearStart = Calendar.getInstance(TimeZone
.getTimeZone("GMT"));
yearStart.setTime(currentTime);
yearStart.set(yearStart.get(Calendar.YEAR), Calendar.JANUARY, 1, 0,
0, 0);
query.addQueryParam("issueTime", yearStart, "greater_than");
yearStart.set(Calendar.MILLISECOND, 0);
query.addQueryParam("issueTime", yearStart.getTime(), ">=");
query.addOrder("etn", false);
query.setMaxResults(1);
}
@ -713,14 +707,14 @@ public class ActiveTable {
* @param phensig
* The phenomenon and significance combination to search for.
* @param currentTime
* <code>Calendar</code> representing time to perform search from
* <code>Date</code> representing time to perform search from
* (needed for DRT mode).
* @return The last ETN assigned to the particular site and phensig
* combination, or <code>null</code> if no ETNs have been assigned
* to this combination.
*/
public static Integer getLastUsedEtn(String siteId, ActiveTableMode mode,
String phensig, Calendar currentTime) {
String phensig, Date currentTime) {
Integer lastEtn = null;
List<ActiveTableRecord> records = ActiveTable.queryTable(siteId, mode,
phensig, null, null, currentTime, false, true);

View file

@ -26,11 +26,12 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -38,6 +39,7 @@ import java.util.Map.Entry;
import java.util.Properties;
import java.util.Queue;
import java.util.SortedMap;
import java.util.TimeZone;
import java.util.TreeMap;
import com.raytheon.edex.site.SiteUtil;
@ -75,6 +77,7 @@ import com.raytheon.uf.edex.requestsrv.router.RemoteServerRequestRouter;
* ------------ ---------- ----------- --------------------------
* Aug 29, 2013 #1843 dgilling Initial creation
* Dec 18, 2013 #2641 dgilling Fix ClusterTask locking.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -118,7 +121,7 @@ public final class GetNextEtnUtil {
* The phenomenon and significance combination (e.g., TO.W or
* DU.Y).
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param isLock
* Whether or not to return a unique ETN--one that has not and
* cannot be used by any other requestor.
@ -142,7 +145,7 @@ public final class GetNextEtnUtil {
* and any hosts that couldn't be contacted during this process.
*/
public static GetNextEtnResponse getNextEtn(String siteId,
ActiveTableMode mode, String phensig, Calendar currentTime,
ActiveTableMode mode, String phensig, Date currentTime,
boolean isLock, boolean performISC, boolean reportConflictOnly,
Integer etnOverride) {
SortedMap<String, IRequestRouter> hostsToQuery = new TreeMap<String, IRequestRouter>();
@ -271,7 +274,7 @@ public final class GetNextEtnUtil {
* The phenomenon and significance combination (e.g., TO.W or
* DU.Y).
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param isLock
* Whether or not to actually obtain the cluster task lock. Not
* needed if only determining a preliminary ETN. Required to be
@ -284,7 +287,7 @@ public final class GetNextEtnUtil {
* @return The next ETN to be used in sequence.
*/
public static int lockAndGetNextEtn(String siteId, ActiveTableMode mode,
String phensig, Calendar currentTime, boolean isLock,
String phensig, Date currentTime, boolean isLock,
Integer etnOverride) {
String lockName = getEtnClusterLockName(siteId, mode);
ClusterTask ct = null;
@ -306,7 +309,9 @@ public final class GetNextEtnUtil {
int sysNextEtn = -1;
if (etnOverride == null) {
String year = Integer.toString(currentTime.get(Calendar.YEAR));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String year = sdf.format(currentTime);
String eInfo = ct.getExtraInfo();
statusHandler.info("ClusterTask Lock info: " + eInfo);
@ -342,16 +347,20 @@ public final class GetNextEtnUtil {
* @param phensig
* The phenomenon and significance combination (e.g., TO.W or
* DU.Y).
* @param year
* Year the next ETN is effective for.
* @param currentTime
* <code>Date</code> used to determine year for ETN.
* @param nextEtn
* The ETN to persist.
*/
public static void setNextEtnAndUnlock(String siteId, ActiveTableMode mode,
String phensig, int year, int nextEtn) {
String phensig, Date currentTime, int nextEtn) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String year = sdf.format(currentTime);
String lockName = getEtnClusterLockName(siteId, mode);
ClusterLockUtils.updateExtraInfo(lockName, phensig,
Integer.toString(year) + ":" + nextEtn);
ClusterLockUtils.updateExtraInfo(lockName, phensig, year + ":"
+ nextEtn);
ClusterLockUtils.unlock(lockName, phensig);
statusHandler.info("Unlocking::[nextEtn = " + nextEtn + "]");
}
@ -369,20 +378,19 @@ public final class GetNextEtnUtil {
* The phenomenon and significance combination (e.g., TO.W or
* DU.Y).
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param isLock
* Whether or not to return a unique ETN--one that has not and
* cannot be used by any other requestor.
* @return The next ETN to be used in sequence.
*/
public static Integer getNextEtnFromLocal(String siteId,
ActiveTableMode mode, String phensig, Calendar currentTime,
ActiveTableMode mode, String phensig, Date currentTime,
boolean isLock) {
int nextEtn = lockAndGetNextEtn(siteId, mode, phensig, currentTime,
isLock, null);
if (isLock) {
setNextEtnAndUnlock(siteId, mode, phensig,
currentTime.get(Calendar.YEAR), nextEtn);
setNextEtnAndUnlock(siteId, mode, phensig, currentTime, nextEtn);
}
return nextEtn;
}
@ -405,7 +413,7 @@ public final class GetNextEtnUtil {
* The phenomenon and significance combination (e.g., TO.W or
* DU.Y).
* @param currentTime
* <code>Calendar</code> representing time (needed for DRT mode).
* <code>Date</code> representing time (needed for DRT mode).
* @param hostsToQuery
* The remote hosts to query. This should also include the local
* EDEX instance initiating this operation.
@ -424,7 +432,7 @@ public final class GetNextEtnUtil {
* @throws UnknownHostException
*/
public static GetNextEtnResponse getNextEtnFromPartners(String siteId,
ActiveTableMode mode, String phensig, Calendar currentTime,
ActiveTableMode mode, String phensig, Date currentTime,
SortedMap<String, IRequestRouter> hostsToQuery,
boolean reportConflictOnly, Integer etnOverride) {
Queue<Entry<String, IRequestRouter>> unlockQueue = Collections
@ -474,8 +482,7 @@ public final class GetNextEtnUtil {
}
IServerRequest unlockReq = new UnlockAndSetNextEtnRequest(siteId,
mySiteId, mode, currentTime.get(Calendar.YEAR), phensig,
nextEtn);
mySiteId, mode, currentTime, phensig, nextEtn);
for (Entry<String, IRequestRouter> host : unlockQueue) {
IRequestRouter router = host.getValue();
try {

View file

@ -25,6 +25,8 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.activetable.ActiveTable;
import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.database.plugin.PluginDao;
import com.raytheon.uf.edex.database.plugin.PluginFactory;
/**
* Request handler for clearing the practice VTEC active table.
@ -38,6 +40,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* Apr 23, 2010 wkwock Initial creation
* Apr 09, 2014 #3004 dgilling Move to activetable plugin, remove GFE
* dependencies.
* Apr 28, 2015 #4027 randerso Added clearing of practice warning table
*
* </pre>
*
@ -55,6 +58,10 @@ public class ClearPracticeVTECTableHandler implements
throws Exception {
try {
ActiveTable.clearPracticeTable(request.getSiteID());
PluginDao dao = PluginFactory.getInstance().getPluginDao(
"practicewarning");
dao.purgeAllData();
} catch (DataAccessLayerException e) {
statusHandler.error("Error failed to clear practice VTEC table", e);
throw new Exception("Unable to clear practice VTEC table.", e);

View file

@ -21,8 +21,7 @@ package com.raytheon.uf.edex.activetable.handler;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -60,6 +59,7 @@ import com.vividsolutions.jts.io.WKTReader;
* and use MergeVTEC.py to perform merge.
* Jul 23, 2013 #2212 dgilling Fix ClassCastExceptions on flood
* fields.
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -160,21 +160,17 @@ public class MergeActiveTableHandler implements
atr.setPhensig(template.get("phensig").toString());
atr.setAct(template.get("act").toString());
atr.setSeg((Integer) template.get("seg"));
Calendar start = GregorianCalendar.getInstance();
start.setTimeInMillis(((Number) template.get("startTime"))
.longValue() * 1000L);
Date start = new Date(
((Number) template.get("startTime")).longValue() * 1000L);
atr.setStartTime(start);
Calendar end = GregorianCalendar.getInstance();
end.setTimeInMillis(((Number) template.get("endTime"))
.longValue() * 1000L);
Date end = new Date(
((Number) template.get("endTime")).longValue() * 1000L);
atr.setEndTime(end);
Calendar purge = GregorianCalendar.getInstance();
purge.setTimeInMillis(((Number) template.get("purgeTime"))
.longValue() * 1000L);
Date purge = new Date(
((Number) template.get("purgeTime")).longValue() * 1000L);
atr.setPurgeTime(purge);
Calendar issue = GregorianCalendar.getInstance();
issue.setTimeInMillis(((Number) template.get("issueTime"))
.longValue() * 1000L);
Date issue = new Date(
((Number) template.get("issueTime")).longValue() * 1000L);
atr.setIssueTime(issue);
atr.setUfn((Boolean) template.get("ufn"));
atr.setOfficeid(template.get("officeid").toString());
@ -187,22 +183,20 @@ public class MergeActiveTableHandler implements
Number floodBeginTime = (Number) template.get("floodBegin");
if (floodBeginTime != null) {
Calendar floodBegin = GregorianCalendar.getInstance();
floodBegin
.setTimeInMillis(floodBeginTime.longValue() * 1000L);
Date floodBegin = new Date(
floodBeginTime.longValue() * 1000L);
atr.setFloodBegin(floodBegin);
}
Number floodCrestTime = (Number) template.get("floodCrest");
if (floodCrestTime != null) {
Calendar floodCrest = GregorianCalendar.getInstance();
floodCrest
.setTimeInMillis(floodCrestTime.longValue() * 1000L);
Date floodCrest = new Date(
floodCrestTime.longValue() * 1000L);
atr.setFloodCrest(floodCrest);
}
Number floodEndTime = (Number) template.get("floodEnd");
if (floodEndTime != null) {
Calendar floodEnd = GregorianCalendar.getInstance();
floodEnd.setTimeInMillis(floodEndTime.longValue() * 1000L);
Date floodEnd = new Date(
floodEndTime.longValue() * 1000L);
atr.setFloodEnd(floodEnd);
}
atr.setFloodRecordStatus((String) template

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.edex.activetable.GetNextEtnUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 19, 2013 #1843 dgilling Initial creation
* Apr 28, 2015 #4027 randerso Expunged Calendar from ActiveTableRecord
*
* </pre>
*
@ -65,8 +66,8 @@ public class UnlockActiveTablePhenSigHandler implements
+ request.getSiteID() + "]: phensig= " + request.getPhensig()
+ ", nextETN= " + request.getNewEtn());
GetNextEtnUtil.setNextEtnAndUnlock(request.getSiteID(),
request.getMode(), request.getPhensig(), request.getYear(),
request.getNewEtn());
request.getMode(), request.getPhensig(),
request.getCurrentTime(), request.getNewEtn());
return Boolean.TRUE;
}
}

View file

@ -30,6 +30,7 @@
# 02/26/13 1447 dgilling Implement __eq__() and
# __ne__().
# 07/23/13 2212 dgilling Fix typo in __eq__().
# 04/28/2015 4027 randerso Expunged Calendar from ActiveTableRecord
#
#
@ -65,17 +66,17 @@ class ActiveTableRecord(object):
elif key == 'seg':
return self.atr.getSeg()
elif key == 'startTime':
return self.atr.getStartTime().getTimeInMillis() / 1000
return self.atr.getStartTime().getTime() / 1000
elif key == 'endTime':
return self.atr.getEndTime().getTimeInMillis() / 1000
return self.atr.getEndTime().getTime() / 1000
elif key == 'ufn':
return self.atr.isUfn()
elif key == 'officeid':
return self.atr.getOfficeid()
elif key == 'purgeTime':
return self.atr.getPurgeTime().getTimeInMillis() / 1000
return self.atr.getPurgeTime().getTime() / 1000
elif key == 'issueTime':
return self.atr.getIssueTime().getTimeInMillis() / 1000
return self.atr.getIssueTime().getTime() / 1000
elif key == 'state':
return self.state
elif key == 'xxxid':

View file

@ -29,7 +29,8 @@ import copy
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 09/19/08 njensen Initial Creation.
# 09/19/08 njensen Initial Creation.
# 04/28/2015 #4027 randerso Expunged Calendar from ActiveTableRecord
#
#
#
@ -64,12 +65,12 @@ def transformActiveTableToPython(table):
template['phensig'] = atr.getPhensig()
template['act'] = atr.getAct()
template['seg'] = atr.getSeg()
template['startTime'] = atr.getStartTime().getTimeInMillis() / 1000
template['endTime'] = atr.getEndTime().getTimeInMillis() / 1000
template['startTime'] = atr.getStartTime().getTime() / 1000
template['endTime'] = atr.getEndTime().getTime() / 1000
template['ufn'] = atr.isUfn()
template['officeid'] = atr.getOfficeid()
template['purgeTime'] = atr.getPurgeTime().getTimeInMillis() / 1000
template['issueTime'] = atr.getIssueTime().getTimeInMillis() / 1000
template['purgeTime'] = atr.getPurgeTime().getTime() / 1000
template['issueTime'] = atr.getIssueTime().getTime() / 1000
template['state'] = "Decoded"
template['xxxid'] = atr.getXxxid()
@ -98,7 +99,7 @@ def transfomActiveTableToThrift(table, mode='PRACTICE'):
from dynamicserialize.dstypes.com.raytheon.uf.common.activetable.OperationalActiveTableRecord \
import OperationalActiveTableRecord
# TODO: Eliminate use of Calendar
from dynamicserialize.dstypes.java.util import GregorianCalendar
from dynamicserialize.dstypes.java.util import Date
tableList = []
if mode.upper()=='PRACTICE':
@ -120,17 +121,13 @@ def transfomActiveTableToThrift(table, mode='PRACTICE'):
atr.setAct(template['act'])
atr.setSeg(template['seg'])
start = GregorianCalendar.getInstance()
start.setTimeInMillis(template['startTime'] * 1000)
start = Date(template['startTime'] * 1000)
atr.setStartTime(start)
end = GregorianCalendar.getInstance()
end.setTimeInMillis(template['endTime'] * 1000)
end = Date(template['endTime'] * 1000)
atr.setEndTime(end)
purge = GregorianCalendar.getInstance()
purge.setTimeInMillis(template['purgeTime'] * 1000)
purge = Date(template['purgeTime'] * 1000)
atr.setPurgeTime(purge)
issue = GregorianCalendar.getInstance()
issue.setTimeInMillis(template['issueTime'] * 1000)
issue = Date(template['issueTime'] * 1000)
atr.setIssueTime(issue)
atr.setUfn(template['ufn'])

View file

@ -30,6 +30,7 @@
# 01/24/14 2504 randerso change to use iscUtil.getLogger for consistency
# 05/15/14 #3157 dgilling Support multiple TPC and SPC sites.
# 03/10/2015 #4129 randerso Refactored server selection code into a reusable method
# 04/28/2015 #4027 randerso Expunged Calendar from ActiveTableRecord
#
#
@ -100,7 +101,7 @@ def execute_request_at(serverHost, serverPort, serverProtocol, mhsid, siteID, an
rec.getOfficeid() not in otherSites:
continue
recIssueTime = float(rec.getIssueTime().getTimeInMillis() / TimeUtil.MILLIS_PER_SECOND)
recIssueTime = float(rec.getIssueTime().getTime() / TimeUtil.MILLIS_PER_SECOND)
#track latest
issueTime = max(recIssueTime, issueTime)

View file

@ -162,4 +162,10 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.jfreechart"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<!--
Refer to edex/modes/README.txt for documentation
-->
<edexModes>
<mode name="ingestHydro">
<include>ndm-ingest.xml</include>
</mode>
</edexModes>

View file

@ -1,3 +1,3 @@
#Sun Mar 20 15:17:07 CDT 2011
eclipse.preferences.version=1
encoding//werkzeug/examples/plnt/__init__.py=utf-8
encoding//werkzeug/werkzeug/http.py=utf-8

View file

@ -17,12 +17,20 @@
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 04/28/2016 4027 randerso Added optional construction parameter to set the time
#
##
# File auto-generated against equivalent DynamicSerialize Java class
class Date(object):
def __init__(self):
def __init__(self, timeInMillis=None):
self.time = None
def getTime(self):

View file

@ -39,6 +39,7 @@
#20140612 3230 rferrel Add pattern for URMA.
#20150121 4014 dgilling Add pattern for ETSS.
#20150202 4066 rferrel Add pattern form Earth Networks Total Lightning: SFPA42
#20150507 4434 skorolev Add pattern for GFS20
#***************************************************************
# AWIPS 1 PATTERN GRAPHIC ^[PQ].* /redbook/Raw
# PGNA00 KWNS 010001 !redbook 1_1/NMCGPHMCD/MCDSUM/PXSF001CN/20110201 0001
@ -171,6 +172,13 @@ HDS ^(O.[LN].{1,3}) (KWBM|KWBI) (..)(..)(..)[^!]*!(grib|grib2)/[^/]*/([^/]*)/#([
HDS ^(OEBA88) KNWC (..)(..)(..)[^!]*!(grib|grib2)/[^/]*/([^/]*)/#([^/]*)/([0-9]{8})([0-9]{4})/(F[0-9]{3})/([^/]*)
FILE -overwrite -log -close -edex /data_store/\5/(\2:yyyy)(\2:mm)\2/\3/ICE/GRID\7/\9Z_\(10)_\(11)-\1_KNWC_\2\3\4_(seq).\5.%Y%m%d%H
# DR 17480 Add HFR (High Frequency Radar) Pattern
# Note: There isn't much metadata here to work with, if more is needed Unidata should be contacted.
# OUTA98 KWNB 111100 !grib2/
ANY ^(OUTA98) KWNB (..)(..)(..)[^!]*!(grib|grib2)
FILE -overwrite -log -close -edex /data_store/\5/(\2:yyyy)(\2:mm)\2/\3/HFR/\1_KWNB_\2\3\4_(seq).\5.%Y%m%d%H
# AWIPS1: GRID ^[YZ][UV]M.98.*KNHC /Grid/SBN/Raw
# *** NOT FOUND IN INGEST STREAM ***
@ -803,3 +811,11 @@ NGRID ^(MHR...) (KNHC) (..)(..)(..)
#NGRID ^(YAU[CDLMPQS][0-2][0-9]) (KWNR) (..)(..)(..)[^!]*!(grib|grib2)/[^/]*/([^/]*)/#([^/]*)/([0-9]{8})([0-9]{4})(F[0-9]{3})/([^/]*)
# FILE -overwrite -log -close -edex /data_store/\6/(\3:yyyy)(\3:mm)\3/\4/\7/GRID\8/\(10)Z_\(11)_\(12)-\1_\2_\3\4\5_(seq).\6.%Y%m%d%H
# GFS20 - Alaska, Puerto Rico, Pacific and CONUS
# YUFC97 KWBC 051200 !grib2/ncep/GFS/#255/201505051200F012/UREL/2 K*m**2*kg-1*s-1
# ZONK67 KWBC 051200 !grib2/ncep/GFS/#215/201505051200F021/OMEG/675 hPa PRES
# ZVBK86 KWBC 051200 !grib2/ncep/GFS/#217/201505051200F021/VREL/180-150 hPa PDLY
NGRID ^([YZ][BCE-HMO-Y][BEFN][A-Z][0-9][0-9]) KWBC (..)(..)(..) [^!]*!(grib2)/[^/]*/([^/]*)/#([^/]*)/([0-9]{8})([0-9]{4})(F[0-9]{3})/([^/]*)
FILE -overwrite -log -close -edex /data_store/grib2/(\2:yyyy)(\2:mm)\2/\3/\6/GRID\7/\9Z_\(10)_\(11)_\1_KWBC_\2\3\4_(seq).\5.%Y%m%d%H