Merge branch 'master_14.4.1' of ssh://vlab.ncep.noaa.gov:29418/AWIPS2_Dev_Baseline into ncep_14.4.1-n
Former-commit-id:0f8f97cae4
[formerly 9fdf4948b48041102ab465d64b060ecffd85dc44] Former-commit-id:d6f7966ddf
This commit is contained in:
commit
ba6c9ca8f7
17 changed files with 341 additions and 249 deletions
|
@ -69,7 +69,7 @@ copyVizShutdownUtilIfNecessary
|
|||
deleteOldCaveDiskCaches &
|
||||
|
||||
# Enable core dumps
|
||||
ulimit -c unlimited
|
||||
ulimit -c unlimited >> /dev/null 2>&1
|
||||
|
||||
export LD_LIBRARY_PATH=${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:$LD_LIBRARY_PATH
|
||||
export LD_PRELOAD=libpython.so
|
||||
|
@ -207,14 +207,14 @@ deleteOldCaveLogs &
|
|||
|
||||
curTime=`date +%Y%m%d_%H%M%S`
|
||||
|
||||
pid=$!
|
||||
export LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
|
||||
|
||||
# At this point fork so that log files can be set up with the process pid and
|
||||
# this process can log the exit status of cave.
|
||||
(
|
||||
export pid=`/bin/bash -c 'echo $PPID'`
|
||||
|
||||
# we include the PID of the launching process along with
|
||||
# a %PID% placeholder to be replaced with the "real" PID
|
||||
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
|
||||
export LOGFILE_CAVE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_logs.log"
|
||||
export LOGFILE_CONSOLE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_console.log"
|
||||
export LOGFILE_PERFORMANCE="${LOGDIR}/${PROGRAM_NAME}_${curTime}_pid_%PID%_perf.log"
|
||||
|
@ -260,7 +260,5 @@ curTime=`date +%Y%m%d_%H%M%S`
|
|||
) &
|
||||
|
||||
pid=$!
|
||||
LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
|
||||
logExitStatus $pid $LOGFILE_STARTUP_SHUTDOWN
|
||||
|
||||
|
||||
|
|
|
@ -37,10 +37,11 @@ import com.raytheon.uf.common.localization.LocalizationContext;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.viz.core.localization.CAVELocalizationAdapter;
|
||||
import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* A {@link BooleanFieldEditor} which adds a button that can be used to
|
||||
* synchronize localization files with the server.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -48,7 +49,8 @@ import com.raytheon.uf.viz.core.localization.CAVELocalizationAdapter;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 22, 2011 bsteffen Initial creation
|
||||
* Nov 22, 2011 bsteffen Initial creation
|
||||
* May 29, 2015 4532 bsteffen Notify the preference store when sync is running.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -75,8 +77,9 @@ public class SyncLocalizationEditor extends BooleanFieldEditor {
|
|||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
IPathManager pathManager = PathManagerFactory
|
||||
.getPathManager(new CAVELocalizationAdapter());
|
||||
getPreferenceStore().firePropertyChangeEvent(ThinClientPreferenceConstants.P_SYNC_REMOTE_LOCALIZATION,
|
||||
false, true);
|
||||
IPathManager pathManager = PathManagerFactory.getPathManager();
|
||||
LocalizationType[] types = { LocalizationType.CAVE_CONFIG,
|
||||
LocalizationType.CAVE_STATIC,
|
||||
LocalizationType.COMMON_STATIC };
|
||||
|
@ -105,6 +108,8 @@ public class SyncLocalizationEditor extends BooleanFieldEditor {
|
|||
System.out.println("Time to download " + type + ": "
|
||||
+ (endTime - startTime) + "ms");
|
||||
}
|
||||
getPreferenceStore().firePropertyChangeEvent(ThinClientPreferenceConstants.P_SYNC_REMOTE_LOCALIZATION,
|
||||
true, false);
|
||||
monitor.done();
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Date;
|
|||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
|
@ -53,6 +54,7 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
|||
* Aug 9, 2011 njensen Initial creation
|
||||
* Aug 13, 2013 2033 mschenke Changed to search all plugins when
|
||||
* CAVE_STATIC BASE context searched
|
||||
* May 29, 2015 4532 bsteffen Always use super when sync job is running.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,6 +65,12 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
|||
public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
||||
implements IPropertyChangeListener {
|
||||
|
||||
/**
|
||||
* Whenever there is a sync job running, always call super to allow it to go
|
||||
* to the server.
|
||||
*/
|
||||
private final AtomicInteger syncJobsRunning = new AtomicInteger(0);
|
||||
|
||||
private boolean useRemoteFiles = true;
|
||||
|
||||
public ThinClientLocalizationAdapter() {
|
||||
|
@ -83,6 +91,10 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
|||
@Override
|
||||
public void retrieve(LocalizationFile file)
|
||||
throws LocalizationOpFailedException {
|
||||
if (syncJobsRunning.get() > 0) {
|
||||
super.retrieve(file);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
File localFile = file.getFile(false);
|
||||
if (localFile.exists() == false || localFile.length() == 0) {
|
||||
|
@ -91,8 +103,15 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
|||
} catch (LocalizationOpFailedException e) {
|
||||
throw e;
|
||||
} catch (LocalizationException e) {
|
||||
// Ignore exception
|
||||
e.printStackTrace();
|
||||
/*
|
||||
* At the time of this writing, nothing will actually throw any
|
||||
* LocalizationException other than LocalizationOpFailedException.
|
||||
* However since LocalizationFile.getFile(boolean) has a method
|
||||
* signature indicating it could throw any LocalizationException
|
||||
* this code should be able to handle any LocalizationException in
|
||||
* case the implementation of getFile changes in the future.
|
||||
*/
|
||||
throw new LocalizationOpFailedException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +127,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
|||
public ListResponse[] listDirectory(LocalizationContext[] contexts,
|
||||
String path, boolean recursive, boolean filesOnly)
|
||||
throws LocalizationOpFailedException {
|
||||
if (useRemoteFiles) {
|
||||
if (shouldUseRemoteFiles()) {
|
||||
return super.listDirectory(contexts, path, recursive, filesOnly);
|
||||
} else {
|
||||
|
||||
|
@ -164,7 +183,7 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
|||
public ListResponse[] getLocalizationMetadata(
|
||||
LocalizationContext[] context, String fileName)
|
||||
throws LocalizationOpFailedException {
|
||||
if (useRemoteFiles) {
|
||||
if (shouldUseRemoteFiles()) {
|
||||
return super.getLocalizationMetadata(context, fileName);
|
||||
} else {
|
||||
List<ListResponse> responses = new ArrayList<ListResponse>(
|
||||
|
@ -193,19 +212,30 @@ public class ThinClientLocalizationAdapter extends CAVELocalizationAdapter
|
|||
|
||||
@Override
|
||||
public boolean exists(LocalizationFile file) {
|
||||
if (useRemoteFiles) {
|
||||
if (shouldUseRemoteFiles()) {
|
||||
return super.exists(file);
|
||||
} else {
|
||||
return file.getFile().exists();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldUseRemoteFiles() {
|
||||
return useRemoteFiles || syncJobsRunning.get() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
if (ThinClientPreferenceConstants.P_DISABLE_REMOTE_LOCALIZATION
|
||||
.equals(event.getProperty())) {
|
||||
useRemoteFiles = !Boolean.valueOf(String.valueOf(event
|
||||
.getNewValue()));
|
||||
} else if (ThinClientPreferenceConstants.P_SYNC_REMOTE_LOCALIZATION.equals(event.getProperty())) {
|
||||
boolean sync = Boolean.valueOf(String.valueOf(event.getNewValue()));
|
||||
if (sync) {
|
||||
syncJobsRunning.incrementAndGet();
|
||||
} else {
|
||||
syncJobsRunning.decrementAndGet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.thinclient.preferences;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
|
||||
/**
|
||||
* Preference constants for the thin client mode
|
||||
*
|
||||
|
@ -32,6 +34,8 @@ package com.raytheon.uf.viz.thinclient.preferences;
|
|||
* Jan 14, 2013 1469 bkowal The hdf5 data directory is no longer a preference constant.
|
||||
* Feb 04, 2014 2704 njensen Consolidate services and pypies proxy addresses
|
||||
* Jun 24, 2014 3236 njensen Added proxy address options
|
||||
* May 29, 2015 4532 bsteffen Add sync localization option.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,6 +65,19 @@ public class ThinClientPreferenceConstants {
|
|||
|
||||
public static String P_DISABLE_REMOTE_LOCALIZATION = "disableRemoteLocalization";
|
||||
|
||||
/**
|
||||
* This preference is not stored but is used to send notification through
|
||||
* the preference store that the {@link #P_CACHE_LOCALIZATION} and
|
||||
* {@link #P_DISABLE_REMOTE_LOCALIZATION} should be temporarily ignored so
|
||||
* that the localization files can be synchronized with the server. Before
|
||||
* performing synchronization, an event should be fired using
|
||||
* {@link IPreferenceStore#firePropertyChangeEvent(String, Object, Object)}
|
||||
* with the preference name as {@link #P_SYNC_REMOTE_LOCALIZATION} and a
|
||||
* newValue of true. When synchronization has completed another event should
|
||||
* be fired with a newValue of false.
|
||||
*/
|
||||
public static String P_SYNC_REMOTE_LOCALIZATION = "syncRemoteFiles";
|
||||
|
||||
public static String P_DISABLE_MENU_TIMES = "disableMenuTimes";
|
||||
|
||||
public static String P_DISABLE_JMS = "disableJms";
|
||||
|
|
|
@ -96,9 +96,6 @@ public class SendDialog extends CaveSWTDialog {
|
|||
+ IPathManager.SEPARATOR + "avnwatch" + IPathManager.SEPARATOR
|
||||
+ "aviationForecasterConfig.xml";
|
||||
|
||||
/** Default forecaster id. */
|
||||
private final String DEFAULT_ID = "000";
|
||||
|
||||
/**
|
||||
* Expression to find time stamp in a TAF.
|
||||
*/
|
||||
|
@ -363,12 +360,16 @@ public class SendDialog extends CaveSWTDialog {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void sendAction() {
|
||||
// Forecaster ID
|
||||
String forecasterId = getForecasterId();
|
||||
if (forecasterId == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
TafQueueRequest request = new TafQueueRequest();
|
||||
request.setType(Type.CREATE);
|
||||
request.setUser(UserController.getUserObject());
|
||||
|
||||
// Forecaster ID
|
||||
String forecasterId = getForecasterId();
|
||||
Calendar xmitTime = Calendar.getInstance();
|
||||
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
xmitTime.set(Calendar.HOUR_OF_DAY, hourSpnr.getSelection());
|
||||
|
@ -537,11 +538,11 @@ public class SendDialog extends CaveSWTDialog {
|
|||
String forecasterName = AviationDialog.getForecaster();
|
||||
|
||||
if (f == null) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM, "Unable to load, "
|
||||
+ FORECAST_CONFIG_FILE + ", using default ID "
|
||||
+ DEFAULT_ID);
|
||||
return DEFAULT_ID;
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Cannot send the TAF. Unable to load, "
|
||||
+ FORECAST_CONFIG_FILE
|
||||
+ ", unable to obtain forecaster's ID. ");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -549,9 +550,10 @@ public class SendDialog extends CaveSWTDialog {
|
|||
.getForecasterConfig();
|
||||
} catch (RuntimeException ex) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to parse, " + FORECAST_CONFIG_FILE
|
||||
+ ", using default ID " + DEFAULT_ID, ex);
|
||||
return DEFAULT_ID;
|
||||
"Cannot send the TAF. Unable to parse, "
|
||||
+ FORECAST_CONFIG_FILE
|
||||
+ ", unable to obtain forecaster's ID. ", ex);
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((fcList != null) && !fcList.isEmpty()) {
|
||||
|
@ -562,8 +564,9 @@ public class SendDialog extends CaveSWTDialog {
|
|||
}
|
||||
}
|
||||
|
||||
statusHandler.handle(Priority.PROBLEM, "No forecaster Id for "
|
||||
+ forecasterName + "using default " + DEFAULT_ID);
|
||||
return DEFAULT_ID;
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Cannot send the TAF. No forecaster ID for " + forecasterName
|
||||
+ " in " + FORECAST_CONFIG_FILE + ".");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,12 @@
|
|||
# Aug 13, 2014: To rename SurgeHtPlustTide to InundationMax and incorporate InundationTiming. PS
|
||||
# Sept 17, 2014: To finalize changes and clean up for 2015initial Baseline Check in.
|
||||
#
|
||||
# Last Modified: Sept 18, 2014: Added code to pull grids from NHC via ISC if PHISH not
|
||||
# Sept 18, 2014: Added code to pull grids from NHC via ISC if PHISH not
|
||||
# Available on time. Left inactive (commented out) for the moment until that can be fully tested later
|
||||
# in 2014 or in 2015.
|
||||
#
|
||||
# Last Modified: May 22, 2015 (LEFebvre/Santos): Added option to create null grids and manual grids when
|
||||
# PSURGE not available. Added checks for current guidance for PHISH and ISC options.
|
||||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# The MenuItems list defines the GFE menu item(s) under which the
|
||||
|
@ -43,7 +46,11 @@ VariableList = [("DEFAULT: Typical. Should only be changed in coordination with
|
|||
"Higher (40% Exceedance; for well-behaved systems within 6 hours of the event)",
|
||||
"Highest (50% Exceedance; for well-behaved systems at time of the event)"]),
|
||||
("Grid Smoothing?", "Yes", "radio", ["Yes","No"]),
|
||||
("Make grids from PHISH\n or ISC?\n", "PHISH", "radio", ["PHISH", "ISC"]),
|
||||
("Make grids from \nPHISH, ISC, or Manually?", "PHISH", "radio", ["PHISH", "ISC", "Manually"]),
|
||||
("Manual Inundation settings:", "", "label"),
|
||||
("Inundation Height:", 1.0, "scale", [0.0, 2.5], 0.5),
|
||||
("Start Hour for Inundation Timing", 0, "scale", [0.0, 72.0], 6.0),
|
||||
("End Hour for Inundation Timing", 6, "scale", [0.0, 78.0], 6.0),
|
||||
]
|
||||
|
||||
class Procedure (SmartScript.SmartScript):
|
||||
|
@ -62,6 +69,13 @@ class Procedure (SmartScript.SmartScript):
|
|||
trList.append(tr)
|
||||
|
||||
return trList
|
||||
|
||||
def baseGuidanceTime(self):
|
||||
startTime = int((self._gmtime().unixTime() - (2 * 3600)) / (6 * 3600)) * (6 * 3600)
|
||||
print "BASETIME IS: ", startTime
|
||||
|
||||
return startTime
|
||||
|
||||
|
||||
def getAvgTopoGrid(self, topodb):
|
||||
|
||||
|
@ -105,7 +119,6 @@ class Procedure (SmartScript.SmartScript):
|
|||
cTime = int(self._gmtime().unixTime()/ 3600) * 3600
|
||||
startTime = AbsTime.AbsTime(cTime)
|
||||
endTime = startTime + (hours * 3600)
|
||||
threatTR = TimeRange.TimeRange(startTime, endTime)
|
||||
timeRange = TimeRange.TimeRange(startTime, endTime)
|
||||
|
||||
return timeRange
|
||||
|
@ -132,25 +145,34 @@ class Procedure (SmartScript.SmartScript):
|
|||
modelIDList.sort()
|
||||
|
||||
if len(modelIDList) == 0:
|
||||
self.statusBarMsg("No pSurge data found in your inventory.", "S")
|
||||
return None, None, None
|
||||
self.statusBarMsg("No pSurge databases found in your inventory.", "S")
|
||||
return None
|
||||
|
||||
# the last one is the latest
|
||||
# modelIDList[-1]
|
||||
surgeModel = modelIDList[-1]
|
||||
|
||||
weName = "Surge" + pctStr + "Pct"
|
||||
trList = self.getWEInventory(dbName, weName, level)
|
||||
|
||||
if len(trList) == 0:
|
||||
self.statusBarMsg("No grids were found in the latest database " + str(surgeModel), "A")
|
||||
return None
|
||||
|
||||
#baseTime = self.getBaseGuidanceTime() + (6 * 3600) # model data will be offset 6 hours
|
||||
baseTime = self.baseGuidanceTime() + (6 * 3600) # model data will be offset 6 hours
|
||||
|
||||
if baseTime > trList[0].startTime().unixTime():
|
||||
self.statusBarMsg("TPCSurgeProb database is not current. Aborting", "A")
|
||||
return None
|
||||
|
||||
#print "Retreiving ", weName, " at ", level
|
||||
for tr in trList:
|
||||
grid = self.getGrids(dbName, weName, level, tr, mode="Max")
|
||||
#maxGrid = maximum(grid, -100.0) # calculate the max as we go
|
||||
|
||||
|
||||
surgeVal = grid.copy()
|
||||
mask = surgeVal>-100
|
||||
mask = surgeVal > -100
|
||||
grid = np.where(mask,surgeVal*3.28, -80.0)
|
||||
# print dir(grid)
|
||||
|
||||
return grid # convert meters to feet
|
||||
|
||||
def makePhishGrid(self, pctStr, level, smoothThreatGrid):
|
||||
|
@ -347,7 +369,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
# factors of less than 3 are useless or dangerous
|
||||
if factor < 3:
|
||||
return grid
|
||||
st = time.time()
|
||||
|
||||
half = int(factor)/ 2
|
||||
sg = np.zeros(grid.shape,"f8")
|
||||
count = np.zeros(grid.shape,"f8")
|
||||
|
@ -384,18 +406,16 @@ class Procedure (SmartScript.SmartScript):
|
|||
# Copies the specified weather elements in elementList into the Fcst database.
|
||||
def copyISCGridstoFcst(self, elementList):
|
||||
|
||||
# First delete the existing grids so there's no confusion
|
||||
cTime = int(self._gmtime().unixTime()/ 3600) * 3600
|
||||
startTime = AbsTime.AbsTime(cTime - 24*3600)
|
||||
endTime = startTime + 240*3600
|
||||
timeRange = TimeRange.TimeRange(startTime, endTime)
|
||||
|
||||
# Initialize all the grids we plan to return
|
||||
|
||||
surgePctGrid = None
|
||||
surgePctGridMSL = None
|
||||
surgePctGridMLLW = None
|
||||
surgePctGridMHHW = None
|
||||
surgePctGridNAVD = None
|
||||
|
||||
baseTime = self.baseGuidanceTime()
|
||||
|
||||
for elem in elementList:
|
||||
if elem == "InundationTiming":
|
||||
#print "Deleting: ", elem
|
||||
self.deleteCmd([elem], timeRange)
|
||||
|
||||
for weName in elementList:
|
||||
iscWeName = weName + "nc"
|
||||
# get the inventory for the ISC grids
|
||||
|
@ -403,12 +423,23 @@ class Procedure (SmartScript.SmartScript):
|
|||
trList = self.getWEInventory("ISC", iscWeName, "SFC")
|
||||
except:
|
||||
self.statusBarMsg("No grids found in ISC database for " + iscWeName, "S")
|
||||
continue
|
||||
return None, None, None, None, None
|
||||
|
||||
if len(trList) == 0:
|
||||
self.statusBarMsg("No grids found in ISC database for " + iscWeName, "S")
|
||||
continue
|
||||
return None, None, None, None, None
|
||||
|
||||
# Make sure that the ISC grids are current
|
||||
if baseTime > trList[0].startTime().unixTime():
|
||||
#if trList[0].startTime().unixTime() != baseTime:
|
||||
self.statusBarMsg("ISC grids for element " + weName + " are not current. Aborting.", "S")
|
||||
return None, None, None, None, None
|
||||
|
||||
# If we made it this far, delete the existing grids so there's no confusion
|
||||
if weName == "InundationTiming":
|
||||
timeRange = TimeRange.allTimes()
|
||||
self.deleteCmd(["InundationTiming"], timeRange)
|
||||
|
||||
# Fetch the ISC grid and create the same grid in the Fcst database
|
||||
for tr in trList:
|
||||
grid = self.getGrids("ISC", iscWeName, "SFC", tr)
|
||||
|
@ -423,22 +454,45 @@ class Procedure (SmartScript.SmartScript):
|
|||
elif iscWeName == "SurgeHtPlusTideMHHWnc":
|
||||
surgePctGridMHHW = grid
|
||||
elif iscWeName == "SurgeHtPlusTideNAVDnc":
|
||||
surgePctGridNAVD = grid
|
||||
surgePctGridNAVD = grid
|
||||
|
||||
return surgePctGrid,surgePctGridMSL,surgePctGridMLLW,surgePctGridMHHW,surgePctGridNAVD
|
||||
|
||||
def execute(self, varDict):
|
||||
# Make a list of timeRanges that will be used to make InundationTiming grids
|
||||
def makeTimingTRs(self, baseTime):
|
||||
# Make the inundation timing grids
|
||||
trList = []
|
||||
for t in range(0, 78, 6):
|
||||
start = baseTime + t * 3600
|
||||
end = baseTime + (t + 6) * 3600
|
||||
tr = TimeRange.TimeRange(AbsTime.AbsTime(start), AbsTime.AbsTime(end))
|
||||
trList.append(tr)
|
||||
|
||||
return trList
|
||||
|
||||
def getTimingGrids(self):
|
||||
|
||||
baseTime = self.baseGuidanceTime()
|
||||
gridList = []
|
||||
trList = self.makeTimingTRs(baseTime)
|
||||
|
||||
for tr in trList:
|
||||
timingGrid = np.zeros(self.getGridShape())
|
||||
gridList.append(timingGrid)
|
||||
|
||||
return trList, gridList
|
||||
|
||||
def execute(self, varDict, editArea):
|
||||
|
||||
# List of elements
|
||||
# See if we should copy from ISC. If so, do the copy and exit
|
||||
smoothThreatGrid = varDict["Grid Smoothing?"]
|
||||
PHISHorISC = varDict["Make grids from PHISH\n or ISC?\n"]
|
||||
#PHISHorISC = "PHISH"
|
||||
makeOption = varDict["Make grids from \nPHISH, ISC, or Manually?"]
|
||||
topodb = "NED"
|
||||
#topodb = varDict["Topographic Database?"]
|
||||
|
||||
editArea = self.getEditArea("StormSurgeWW_EditArea")
|
||||
ssea = self.encodeEditArea(editArea)
|
||||
stormSurgeEditArea = self.getEditArea("StormSurgeWW_EditArea")
|
||||
ssea = self.encodeEditArea(stormSurgeEditArea)
|
||||
|
||||
Topo = self.getAvgTopoGrid(topodb)
|
||||
|
||||
|
@ -450,7 +504,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
|
||||
#print "pctStr is: ", pctStr
|
||||
|
||||
if PHISHorISC == "PHISH":
|
||||
if makeOption == "PHISH":
|
||||
|
||||
#initialize grids to zero
|
||||
surgePctGrid = self._empty
|
||||
|
@ -459,6 +513,10 @@ class Procedure (SmartScript.SmartScript):
|
|||
# Now get the psurge
|
||||
surgePctGrid = self.getExceedanceHeight(pctStr, "FHAG0")
|
||||
surgePctGridNAVD = self.getExceedanceHeight(pctStr, "SFC")
|
||||
|
||||
if surgePctGrid is None or surgePctGridNAVD is None:
|
||||
return
|
||||
|
||||
#print "retrieved my grids"
|
||||
#
|
||||
# The following lines are the gridded vdatum corrections.
|
||||
|
@ -489,12 +547,54 @@ class Procedure (SmartScript.SmartScript):
|
|||
|
||||
self.makePhishGrid(pctStr, "FHAG0", smoothThreatGrid)
|
||||
|
||||
else:
|
||||
elif makeOption == "ISC":
|
||||
|
||||
elementList = ["InundationMax","InundationTiming", "SurgeHtPlusTideMSL","SurgeHtPlusTideMLLW",
|
||||
"SurgeHtPlusTideNAVD","SurgeHtPlusTideMHHW"]
|
||||
surgePctGrid,surgePctGridMSL,surgePctGridMLLW,surgePctGridMHHW,surgePctGridNAVD = self.copyISCGridstoFcst(elementList)
|
||||
if surgePctGrid is None or surgePctGridMSL is None or surgePctGridMLLW is None or \
|
||||
surgePctGridMHHW is None or surgePctGridNAVD is None:
|
||||
return
|
||||
|
||||
elif makeOption == "Manually":
|
||||
inundationHeight = float(varDict["Inundation Height:"])
|
||||
inunStartHour = float(varDict["Start Hour for Inundation Timing"])
|
||||
inunEndHour = float(varDict["End Hour for Inundation Timing"])
|
||||
|
||||
selectedMask = self.encodeEditArea(editArea)
|
||||
if not selectedMask.any():
|
||||
self.statusBarMsg("Please define an area over which to assign the inundation values.", "S")
|
||||
return
|
||||
|
||||
modifyMask = selectedMask & ssea
|
||||
if not modifyMask.any():
|
||||
self.statusBarMsg("Please define an area that intersects the StormSurgeEditArea to assign the inundation values.", "S")
|
||||
return # Calculate the intersection of the SSEditArea and selected editAre
|
||||
|
||||
if inunStartHour >= inunEndHour:
|
||||
self.statusBarMsg("Please define the end hour after the start hour.", "S")
|
||||
return
|
||||
|
||||
timeRange = TimeRange.allTimes()
|
||||
self.deleteCmd(["InundationTiming"], timeRange)
|
||||
# make the InundationMax grid
|
||||
surgePctGrid = np.zeros(self.getGridShape())
|
||||
surgePctGrid[modifyMask] = inundationHeight
|
||||
# Make the timing grids
|
||||
baseTime = self.baseGuidanceTime()
|
||||
# trList = self.makeTimingTRs(baseTime)
|
||||
trList, timingGrids = self.getTimingGrids()
|
||||
print "TRLIST IS: ", trList
|
||||
for i in range(len(trList)):
|
||||
# only modify grid in the specified time range
|
||||
start = trList[i].startTime().unixTime()
|
||||
end = trList[i].endTime().unixTime()
|
||||
|
||||
if (start - baseTime) / 3600 >= inunStartHour and (end - baseTime) / 3600 <= inunEndHour:
|
||||
timingGrids[i][modifyMask] = inundationHeight # populate where needed
|
||||
|
||||
self.createGrid("Fcst", "InundationTiming", "SCALAR", timingGrids[i], trList[i])
|
||||
|
||||
threatWEName = "StormSurgeThreat"
|
||||
|
||||
threatKeys = self.getDiscreteKeys(threatWEName)
|
||||
|
@ -510,12 +610,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
threshDict = {} # a dict to store thresholds from the UI
|
||||
|
||||
for key in keyMap.keys():
|
||||
# if not key in varDict.keys(): # This should never happen
|
||||
# print "Error in mapping UI keys to DISCRETE keys."
|
||||
# print "Please fix the keyMap dictionary."
|
||||
# return
|
||||
|
||||
#threshDict[keyMap[key]] = varDict[key]
|
||||
if keyMap[key] == "Extreme":
|
||||
threshDict[keyMap[key]] = 9
|
||||
elif keyMap[key] == "High":
|
||||
|
@ -527,6 +622,36 @@ class Procedure (SmartScript.SmartScript):
|
|||
|
||||
#print "threshDict[keyMap[key]]: ", keyMap[key], threshDict[keyMap[key]]
|
||||
|
||||
# make a timeRange - 6 hours long
|
||||
elementList = ["StormSurgeThreat","InundationMax","SurgeHtPlusTideMSL","SurgeHtPlusTideMLLW","SurgeHtPlusTideNAVD","SurgeHtPlusTideMHHW"]
|
||||
|
||||
# make a new timeRange that will be used to create new grids
|
||||
timeRange = self.makeNewTimeRange(6)
|
||||
|
||||
# Remove old guidance grids and replace them with the new grids
|
||||
# Delete the old grids first
|
||||
cTime = int(self._gmtime().unixTime()/ 3600) * 3600
|
||||
startTime = AbsTime.AbsTime(cTime - 24*3600)
|
||||
endTime = startTime + 240*3600
|
||||
deleteTimeRange = TimeRange.TimeRange(startTime, endTime)
|
||||
|
||||
for elem in elementList:
|
||||
self.deleteCmd([elem], deleteTimeRange)
|
||||
|
||||
# display the D2D grid for debugging purposes only
|
||||
self.createGrid("Fcst", "InundationMax", "SCALAR", surgePctGrid,
|
||||
timeRange, precision=2)
|
||||
|
||||
if makeOption != "Manually":
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMSL", "SCALAR", surgePctGridMSL,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMLLW", "SCALAR", surgePctGridMLLW,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideNAVD", "SCALAR", surgePctGridNAVD,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMHHW", "SCALAR", surgePctGridMHHW,
|
||||
timeRange, precision=2)
|
||||
|
||||
# make a grid of zeros. This will be the CoastalThreat grid
|
||||
coastalThreat = np.zeros(self.getTopo().shape)
|
||||
|
||||
|
@ -541,35 +666,7 @@ class Procedure (SmartScript.SmartScript):
|
|||
thresh = threshDict[key]
|
||||
keyIndex = self.getIndex(key, threatKeys)
|
||||
coastalThreat = np.where(ssea & np.greater_equal(surgePctGrid, thresh), keyIndex,
|
||||
coastalThreat)
|
||||
|
||||
# make a timeRange - 6 hours long
|
||||
elementList = ["StormSurgeThreat","InundationMax","SurgeHtPlusTideMSL","SurgeHtPlusTideMLLW","SurgeHtPlusTideNAVD","SurgeHtPlusTideMHHW"]
|
||||
|
||||
cTime = int(self._gmtime().unixTime()/ 3600) * 3600
|
||||
startTime = AbsTime.AbsTime(cTime - 24*3600)
|
||||
endTime = startTime + 240*3600
|
||||
timeRange = TimeRange.TimeRange(startTime, endTime)
|
||||
#print "time range to delete is: ", timeRange
|
||||
|
||||
for elem in elementList:
|
||||
#print "Deleting: ", elem
|
||||
self.deleteCmd([elem], timeRange)
|
||||
|
||||
timeRange = self.makeNewTimeRange(6)
|
||||
|
||||
# display the D2D grid for debugging purposes only
|
||||
self.createGrid("Fcst", "InundationMax", "SCALAR", surgePctGrid,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMSL", "SCALAR", surgePctGridMSL,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMLLW", "SCALAR", surgePctGridMLLW,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideNAVD", "SCALAR", surgePctGridNAVD,
|
||||
timeRange, precision=2)
|
||||
self.createGrid("Fcst", "SurgeHtPlusTideMHHW", "SCALAR", surgePctGridMHHW,
|
||||
timeRange, precision=2)
|
||||
|
||||
coastalThreat)
|
||||
|
||||
# create the CoastalThreat Grid
|
||||
self.createGrid("Fcst", threatWEName, "DISCRETE",
|
||||
|
|
|
@ -276,7 +276,7 @@ def runFormatter(databaseID, site, forecastList, cmdLineVarDict, vtecMode,
|
|||
logger.warning("Unable to determine PID: defaulting to upper case")
|
||||
else:
|
||||
from com.raytheon.uf.common.dataplugin.text.db import MixedCaseProductSupport
|
||||
mixedCase = MixedCaseProductSupport.isMixedCase(pid)
|
||||
mixedCase = MixedCaseProductSupport.isMixedCase(str(pid))
|
||||
|
||||
if mixedCase:
|
||||
outForecasts = outForecasts + forecast
|
||||
|
|
|
@ -3,4 +3,5 @@ output.. = bin/
|
|||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/,\
|
||||
resources/
|
||||
resources/,\
|
||||
utility/
|
||||
|
|
|
@ -196,9 +196,9 @@ public final class TPCWatchSrv extends AbstractWatchNotifierSrv {
|
|||
// if we are not in practice mode
|
||||
if (!practiceMode) {
|
||||
|
||||
// if xxxId ends with a digit (i.e. its a national TCV)
|
||||
// if xxxId does NOT end with a digit (i.e. its NOT a national TCV)
|
||||
String xxxId = record.getXxxid();
|
||||
if (Character.isDigit(xxxId.charAt(xxxId.length() - 1))) {
|
||||
if (!Character.isDigit(xxxId.charAt(xxxId.length() - 1))) {
|
||||
|
||||
// build the full 9-letter PIL
|
||||
String fullPil = SiteMap.getInstance().mapICAOToCCC(
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
# being off
|
||||
# being off
|
||||
# 04/20/2015 #4414 dgilling Add missing NWPSTrkngCG0 weather elements.
|
||||
# 05/29/2015 17496 ryu Changed parm definitions for Wave1-10 and Period1-10.
|
||||
#
|
||||
########################################################################
|
||||
|
||||
|
@ -214,16 +215,16 @@ Wave_9 = ("Wave_9", VECTOR, "ft", "Wave_9", 50.0, 0.0, 2, NO)
|
|||
Wave_10 = ("Wave_10", VECTOR, "ft", "Wave_10", 50.0, 0.0, 2, NO)
|
||||
|
||||
#Fcst Grids - for partitioned wave groups
|
||||
Wave1 = ("Wave1", VECTOR, "ft", "WAVE1", 50.0, 0.0, 1, NO)
|
||||
Wave2 = ("Wave2", VECTOR, "ft", "WAVE2", 50.0, 0.0, 1, NO)
|
||||
Wave3 = ("Wave3", VECTOR, "ft", "WAVE3", 50.0, 0.0, 1, NO)
|
||||
Wave4 = ("Wave4", VECTOR, "ft", "WAVE4", 50.0, 0.0, 1, NO)
|
||||
Wave5 = ("Wave5", VECTOR, "ft", "WAVE5", 50.0, 0.0, 1, NO)
|
||||
Wave6 = ("Wave6", VECTOR, "ft", "WAVE6", 50.0, 0.0, 1, NO)
|
||||
Wave1 = ("Wave1", VECTOR, "ft", "WAVE1", 50.0, 0.0, 0, NO)
|
||||
Wave2 = ("Wave2", VECTOR, "ft", "WAVE2", 50.0, 0.0, 0, NO)
|
||||
Wave3 = ("Wave3", VECTOR, "ft", "WAVE3", 50.0, 0.0, 0, NO)
|
||||
Wave4 = ("Wave4", VECTOR, "ft", "WAVE4", 50.0, 0.0, 0, NO)
|
||||
Wave5 = ("Wave5", VECTOR, "ft", "WAVE5", 50.0, 0.0, 0, NO)
|
||||
Wave6 = ("Wave6", VECTOR, "ft", "WAVE6", 50.0, 0.0, 0, NO)
|
||||
Wave7 = ("Wave7", VECTOR, "ft", "Wave7", 50.0, 0.0, 0, NO)
|
||||
Wave8 = ("Wave8", VECTOR, "ft", "Wave8", 35.0, 0.0, 0, NO)
|
||||
Wave9 = ("Wave9", VECTOR, "ft", "Wave9", 35.0, 0.0, 0, NO)
|
||||
Wave10 = ("Wave10", VECTOR, "ft", "Wave10", 35.0, 0.0, 0, NO)
|
||||
Wave8 = ("Wave8", VECTOR, "ft", "Wave8", 50.0, 0.0, 0, NO)
|
||||
Wave9 = ("Wave9", VECTOR, "ft", "Wave9", 50.0, 0.0, 0, NO)
|
||||
Wave10 = ("Wave10", VECTOR, "ft", "Wave10", 50.0, 0.0, 0, NO)
|
||||
|
||||
#Smart Init Grids - for partitioned wave groups
|
||||
Period_1 = ("Period_1", SCALAR, "sec", "Period_1", 30.0, 1.0, 0, NO)
|
||||
|
@ -238,16 +239,16 @@ Period_9 = ("Period_9", SCALAR, "sec", "Period_9", 30.0, 0.0, 0, NO)
|
|||
Period_10 = ("Period_10", SCALAR, "sec", "Period_10", 30.0, 0.0, 0, NO)
|
||||
|
||||
#Fcst Grids - for partitioned wave groups
|
||||
Period1 = ("Period1", SCALAR, "sec", "Period1", 25.0, 0.0, 1, NO)
|
||||
Period2 = ("Period2", SCALAR, "sec", "Period2", 25.0, 0.0, 1, NO)
|
||||
Period3 = ("Period3", SCALAR, "sec", "Period3", 25.0, 0.0, 1, NO)
|
||||
Period4 = ("Period4", SCALAR, "sec", "Period4", 25.0, 0.0, 1, NO)
|
||||
Period5 = ("Period5", SCALAR, "sec", "Period5", 25.0, 0.0, 1, NO)
|
||||
Period6 = ("Period6", SCALAR, "sec", "Period6", 25.0, 0.0, 1, NO)
|
||||
Period7 = ("Period7", SCALAR, "sec", "Period7", 25.0, 0.0, 0, NO)
|
||||
Period8 = ("Period8", SCALAR, "sec", "Period8", 25.0, 0.0, 0, NO)
|
||||
Period9 = ("Period9", SCALAR, "sec", "Period9", 25.0, 0.0, 0, NO)
|
||||
Period10 = ("Period10", SCALAR, "sec", "Period10", 25.0, 0.0, 0, NO)
|
||||
Period1 = ("Period1", SCALAR, "sec", "Period1", 30.0, 0.0, 0, NO)
|
||||
Period2 = ("Period2", SCALAR, "sec", "Period2", 30.0, 0.0, 0, NO)
|
||||
Period3 = ("Period3", SCALAR, "sec", "Period3", 30.0, 0.0, 0, NO)
|
||||
Period4 = ("Period4", SCALAR, "sec", "Period4", 30.0, 0.0, 0, NO)
|
||||
Period5 = ("Period5", SCALAR, "sec", "Period5", 30.0, 0.0, 0, NO)
|
||||
Period6 = ("Period6", SCALAR, "sec", "Period6", 30.0, 0.0, 0, NO)
|
||||
Period7 = ("Period7", SCALAR, "sec", "Period7", 30.0, 0.0, 0, NO)
|
||||
Period8 = ("Period8", SCALAR, "sec", "Period8", 30.0, 0.0, 0, NO)
|
||||
Period9 = ("Period9", SCALAR, "sec", "Period9", 30.0, 0.0, 0, NO)
|
||||
Period10 = ("Period10", SCALAR, "sec", "Period10", 30.0, 0.0, 0, NO)
|
||||
|
||||
# Fire Weather Weather Elements
|
||||
LAL = ("LAL", SCALAR, "cat", "Lightning Activity Level", 6.0, 1.0, 0, NO)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Version 2015.2.12-1
|
||||
# Version 2015.5.21-0
|
||||
|
||||
import GenericHazards
|
||||
import string, time, os, re, types, copy, LogStream, collections
|
||||
|
@ -23,7 +23,7 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
Definition["database"] = "Official" # Source database
|
||||
Definition["debug"] = 1
|
||||
Definition["mapNameForCombinations"] = "Zones_<site>"
|
||||
Definition["defaultEditAreas"] = "Combinations_HLS_<site>"
|
||||
Definition["defaultEditAreas"] = ""
|
||||
Definition["showZoneCombiner"] = 0 # 1 to cause zone combiner to display
|
||||
|
||||
Definition["productName"] = "LOCAL STATEMENT"
|
||||
|
@ -1560,7 +1560,7 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
self._stormTypeName = self._stormType + " " + self._stormName
|
||||
self._decodeStormInfo(stormDict)
|
||||
# Storm movement in mph and the stated movement trend
|
||||
self._stormMovementTrend = self._expandBearings("Moving " + stormDict.get("StormMotion",""))
|
||||
self._stormMovementTrend = self._expandBearings("Movement " + stormDict.get("StormMotion",""))
|
||||
# Storm intensity in mph and the stated intensity trend.
|
||||
self._stormIntensityTrend = "Storm Intensity " + stormDict.get("StormIntensity","")
|
||||
|
||||
|
@ -1654,8 +1654,7 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
summarySearch = re.search("(?is)SUMMARY OF (.+?)\.{3}.+?" +
|
||||
"LOCATION\.{3}(.+?[NS]) +(.+?[WE]).+?" +
|
||||
"(ABOUT .+?)MAXIMUM SUSTAINED WIND.+?" +
|
||||
"(\d+ MPH).+?PRESENT MOVEMENT\.{3}" +
|
||||
"(.+?)\.{3}", tcp)
|
||||
"(\d+ MPH).+?", tcp)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# If we found the NHC summary section
|
||||
|
@ -1668,7 +1667,17 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
dict["StormLon"] = summarySearch.group(3).strip()
|
||||
dict["StormReference"] = summarySearch.group(4).strip()
|
||||
dict["StormIntensity"] = summarySearch.group(5).strip()
|
||||
dict["StormMotion"] = summarySearch.group(6).strip()
|
||||
|
||||
haveStormMotion = True
|
||||
if tcp.find("PRESENT MOVEMENT...STATIONARY") != -1:
|
||||
dict["StormMotion"] = "STATIONARY"
|
||||
else:
|
||||
summarySearch = re.search("PRESENT MOVEMENT\.{3}(.+?)\.{3}", tcp)
|
||||
|
||||
if summarySearch is not None:
|
||||
dict["StormMotion"] = summarySearch.group(1).strip()
|
||||
else:
|
||||
haveStormMotion = False
|
||||
|
||||
#================================================================
|
||||
# Use the remaining summary groups to contruct a paragraph
|
||||
|
@ -1731,9 +1740,10 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
#----------------------------------------------------------------
|
||||
# Now add the storm motion
|
||||
|
||||
dict["StormCenter"] = "%s THE STORM MOTION WAS %s." % \
|
||||
(dict["StormCenter"],
|
||||
self._removeKM(dict["StormMotion"]))
|
||||
if haveStormMotion:
|
||||
dict["StormCenter"] = "%s THE STORM MOTION WAS %s." % \
|
||||
(dict["StormCenter"],
|
||||
self._removeKM(dict["StormMotion"]))
|
||||
|
||||
####################################################################
|
||||
####################################################################
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Version 2015.2.13-0
|
||||
# Version 2015.5.22-0
|
||||
|
||||
import GenericHazards
|
||||
import JsonSupport
|
||||
|
@ -19,7 +19,6 @@ class TextProduct(HLSTCV_Common.TextProduct):
|
|||
Definition["displayName"] = "None"
|
||||
Definition["outputFile"] = "{prddir}/TEXT/TCV.txt"
|
||||
Definition["database"] = "Official" # Source database
|
||||
Definition["debug"] = 1
|
||||
Definition["mapNameForCombinations"] = "Zones_<site>"
|
||||
Definition["defaultEditAreas"] = "Combinations_TCV_<site>"
|
||||
Definition["showZoneCombiner"] = 1 # 1 to cause zone combiner to display
|
||||
|
@ -1490,13 +1489,10 @@ class SectionCommon():
|
|||
if self._tr is not None:
|
||||
specialStatements = self._specialImpactsStatements()
|
||||
if self._tr in specialStatements.keys():
|
||||
if self._tr == "default":
|
||||
return specialStatements[self._tr][maxThreat]
|
||||
if self._tr == "recovery" and not self.isThreatInAllAdvisories:
|
||||
return []
|
||||
else:
|
||||
if self._tr == "recovery" and not self.isThreatInAllAdvisories:
|
||||
return []
|
||||
else:
|
||||
return specialStatements[self._tr]
|
||||
return specialStatements[self._tr]
|
||||
|
||||
import TCVDictionary
|
||||
potentialImpactStatements = TCVDictionary.PotentialImpactStatements
|
||||
|
@ -1507,19 +1503,27 @@ class SectionCommon():
|
|||
|
||||
segment, vtecRecords = productSegment
|
||||
|
||||
self._textProduct.debug_print("zone number = %s, elementName = %s, maxThreat = %s" %
|
||||
(segment, elementName, maxThreat), 1)
|
||||
self._textProduct.debug_print("zone number = %s, elementName = %s, maxThreat = %s, tr = %s" %
|
||||
(segment, elementName, maxThreat, self._tr), 1)
|
||||
|
||||
if segment in tcv_AreaDictionary:
|
||||
potentialImpactStatements = tcv_AreaDictionary[segment]["potentialImpactsStatements"]
|
||||
|
||||
|
||||
# Check for any overrides
|
||||
try:
|
||||
statements = potentialImpactStatements[elementName][maxThreat]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
return statements
|
||||
|
||||
# If this is the "default" case
|
||||
if self._tr == "default" and len(statements) > 0:
|
||||
|
||||
if elementName in ["Wind", "Storm Surge"]:
|
||||
if statements[0].find("If realized, ") == -1:
|
||||
statements[0] = "If realized, " + statements[0] + \
|
||||
statements[0][1:]
|
||||
|
||||
return statements
|
||||
|
||||
# Specific hazard sections can override this to provide special impacts statements
|
||||
def _specialImpactsStatements(self):
|
||||
|
@ -1687,29 +1691,6 @@ class WindSection(SectionCommon):
|
|||
],
|
||||
"recovery": ["Little to no additional wind impacts expected. Community officials are now assessing the extent of actual wind impacts accordingly.",
|
||||
],
|
||||
"default": {"Extreme": ["If realized, major hurricane force wind can cause structural damage to sturdy buildings, some with complete roof and wall failures. Complete destruction of mobile homes. Damage greatly accentuated by large airborne projectiles. Locations may be uninhabitable for weeks or months.",
|
||||
"Numerous large trees snapped or uprooted along with fences and roadway signs blown over.",
|
||||
"Many roads impassable from large debris, and more within urban or heavily wooded places. Many bridges, causeways, and access routes impassable.",
|
||||
"Widespread power and communication outages.",
|
||||
],
|
||||
"High": ["If realized, hurricane force wind can cause considerable roof damage to sturdy buildings, with some having window, door, and garage door failures leading to structural damage. Mobile homes severely damaged, with some destroyed. Damage accentuated by airborne projectiles. Locations may be uninhabitable for weeks.",
|
||||
"Many large trees snapped or uprooted along with fences and roadway signs blown over.",
|
||||
"Some roads impassable from large debris, and more within urban or heavily wooded places. Several bridges, causeways, and access routes impassable.",
|
||||
"Large areas with power and communications outages.",
|
||||
],
|
||||
"Mod": ["If realized, strong tropical storm force wind can cause some damage to roofing and siding materials, along with damage to porches, awnings, carports, and sheds. A few buildings experiencing window, door, and garage door failures. Mobile homes damaged, especially if unanchored. Unsecured lightweight objects become dangerous projectiles.",
|
||||
"Several large trees snapped or uprooted, but with greater numbers in places where trees are shallow rooted. Several fences and roadway signs blown over.",
|
||||
"Some roads impassable from large debris, and more within urban or heavily wooded places. A few bridges, causeways, and access routes connecting barrier islands impassable.",
|
||||
"Scattered power and communications outages, but more prevalent in areas with above ground lines.",
|
||||
],
|
||||
"Elevated": ["If realized, tropical storm force wind can cause damage to porches, awnings, carports, sheds, and unanchored mobile homes. Unsecured lightweight objects blown about.",
|
||||
"Many large tree limbs broken off. A few trees snapped or uprooted, but with greater numbers in places where trees are shallow rooted. Some fences and roadway signs blown over.",
|
||||
"A few roads impassable from debris, particularly within urban or heavily wooded places. Hazardous driving conditions on bridges and other elevated roadways.",
|
||||
"Scattered power and communications outages.",
|
||||
],
|
||||
"None": ["Little to no potential impacts from wind.",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
### Supporting functions
|
||||
|
@ -1878,29 +1859,6 @@ class StormSurgeSection(SectionCommon):
|
|||
],
|
||||
"recovery": ["Little to no additional surge impacts expected. Community officials are now assessing the extent of actual surge impacts accordingly.",
|
||||
],
|
||||
"default": {"Extreme": ["If realized, extreme storm surge flooding can cause widespread deep inundation accentuated by powerful battering waves. Structural damage to buildings, with many washing away. Damage greatly compounded from considerable floating debris. Locations may be uninhabitable for an extended period.",
|
||||
"Near-shore escape routes and secondary roads washed out or severely flooded. Flood control systems and barriers may become stressed.",
|
||||
"Extreme beach erosion. New shoreline cuts possible.",
|
||||
"Massive damage to marinas, docks, boardwalks, and piers. Numerous small craft broken away from moorings with many lifted onshore and stranded.",
|
||||
],
|
||||
"High": ["If realized, major storm surge flooding can cause large areas of deep inundation accentuated by battering waves. Structural damage to buildings, with several washing away. Damage compounded by floating debris. Locations may be uninhabitable for an extended period.",
|
||||
"Large sections of near-shore escape routes and secondary roads washed out or severely flooded. Flood control systems and barriers may become stressed.",
|
||||
"Severe beach erosion with significant dune loss.",
|
||||
"Major damage to marinas, docks, boardwalks, and piers. Many small craft broken away from moorings, especially in unprotected anchorages with some lifted onshore and stranded.",
|
||||
],
|
||||
"Mod": ["If realized, moderate storm surge flooding can cause areas of inundation accentuated by large waves. Damage to several buildings, mainly near the coast.",
|
||||
"Sections of near-shore escape routes and secondary roads become weakened or washed out, especially in usually vulnerable low spots.",
|
||||
"Major beach erosion with heavy surf breaching dunes. Strong and numerous rip currents.",
|
||||
"Moderate damage to marinas, docks, boardwalks, and piers. Several small craft broken away from moorings, especially in unprotected anchorages.",
|
||||
],
|
||||
"Elevated": ["If realized, minor to moderate storm surge flooding can cause localized inundation mainly along immediate shorelines and in low-lying spots, or in areas farther inland near where higher surge waters move ashore.",
|
||||
"Sections of near-shore roads and parking lots become overspread with surge water. Driving conditions dangerous in places where surge water covers the road.",
|
||||
"Moderate beach erosion. Heavy surf also breaching dunes, mainly in usually vulnerable locations. Strong rip currents.",
|
||||
"Minor to locally moderate damage to marinas, docks, boardwalks, and piers. A few small craft broken away from moorings.",
|
||||
],
|
||||
"None": ["Little to no potential impacts from storm surge.",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def _potentialImpactsSummary(self, segmentDict, productSegmentGroup, productSegment):
|
||||
|
@ -2039,25 +1997,6 @@ class FloodingRainSection(SectionCommon):
|
|||
],
|
||||
"recovery": ["For additional information on impacts being caused by flooding rain, refer to the local hazardous weather outlook or hurricane local statement.",
|
||||
],
|
||||
"default": {"Extreme": ["If realized, extreme rainfall flooding may prompt numerous evacuations and rescues.",
|
||||
"Rivers and tributaries may overwhelmingly overflow their banks in many places with deep moving water. Small streams, creeks, canals, arroyos, and ditches may become raging rivers. In mountain areas, deadly runoff may rage down valleys while increasing susceptibility to rockslides and mudslides. Flood control systems and barriers may become stressed.",
|
||||
"Flood waters can enter numerous structures within multiple communities, some structures becoming uninhabitable or washed away. Numerous places where flood waters may cover escape routes. Streets and parking lots become rivers of raging water with underpasses submerged. Driving conditions become very dangerous. Numerous road and bridge closures with some weakened or washed out.",
|
||||
],
|
||||
"High": ["If realized, major rainfall flooding may prompt many evacuations and rescues.",
|
||||
"Rivers and tributaries may rapidly overflow their banks in multiple places. Small streams, creeks, canals, arroyos, and ditches may become dangerous rivers. In mountain areas, destructive runoff may run quickly down valleys while increasing susceptibility to rockslides and mudslides. Flood control systems and barriers may become stressed.",
|
||||
"Flood waters can enter many structures within multiple communities, some structures becoming uninhabitable or washed away. Many places where flood waters may cover escape routes. Streets and parking lots become rivers of moving water with underpasses submerged. Driving conditions become dangerous. Many road and bridge closures with some weakened or washed out.",
|
||||
],
|
||||
"Mod": ["If realized, moderate rainfall flooding may prompt several evacuations and rescues.",
|
||||
"Rivers and tributaries may quickly become swollen with swifter currents and overspill their banks in a few places, especially in usually vulnerable spots. Small streams, creeks, canals, arroyos, and ditches overflow.",
|
||||
"Flood waters can enter some structures or weaken foundations. Several places may experience expanded areas of rapid inundation at underpasses, low-lying spots, and poor drainage areas. Some streets and parking lots take on moving water as storm drains and retention ponds overflow. Driving conditions become hazardous. Some road and bridge closures.",
|
||||
],
|
||||
"Elevated": ["If realized, localized rainfall flooding may prompt a few evacuations.",
|
||||
"Rivers and tributaries may quickly rise with swifter currents. Small streams, creeks, canals, arroyos, and ditches may become swollen and overflow in spots.",
|
||||
"Flood waters can enter a few structures, especially in usually vulnerable spots. A few places where rapid ponding of water occurs at underpasses, low-lying spots, and poor drainage areas. Several storm drains and retention ponds become near-full and begin to overflow. Some brief road and bridge closures.",
|
||||
],
|
||||
"None": ["Little to no potential impacts from flooding rain.",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
class TornadoSection(SectionCommon):
|
||||
|
@ -2159,25 +2098,6 @@ class TornadoSection(SectionCommon):
|
|||
],
|
||||
"recovery": ["For additional information on impacts being caused by tropical tornadoes, refer to the local hazardous weather outlook or hurricane local statement.",
|
||||
],
|
||||
"default": {"Extreme": ["The occurrence of an outbreak of tornadoes can greatly hinder the execution of other emergency activities during tropical events.",
|
||||
"If realized, many places may experience tornado damage, with several spots of immense destruction, power loss, and communications failures.",
|
||||
"Locations could realize sturdy buildings demolished, structures upon weak foundations swept away, mobile homes obliterated, large trees twisted and snapped with some debarked, vehicles lifted off the ground and thrown with distance, and small boats destroyed. Large and deadly projectiles can add considerably to the toll.",
|
||||
],
|
||||
"High": ["The occurrence of numerous tornadoes can greatly hinder the execution of other emergency activities during tropical events.",
|
||||
"If realized, many places may experience tornado damage with a few spots of immense destruction, power loss, and communications failures.",
|
||||
"Locations could realize roof and wall failures of sturdy buildings with some being leveled, structures upon weak foundations blown away, mobile homes obliterated, large trees twisted and snapped with forested trees uprooted, vehicles lifted off the ground and thrown, and small boats destroyed. Large and deadly projectiles can add to the toll.",
|
||||
],
|
||||
"Mod": ["The occurrence of scattered tornadoes can hinder the execution of other emergency activities during tropical events.",
|
||||
"If realized, several places may experience tornado damage with a few spots of considerable damage, power loss, and communications failures.",
|
||||
"Locations could realize roofs torn off frame houses, mobile homes demolished, boxcars overturned, large trees snapped or uprooted, vehicles tumbled, and small boats tossed about. Dangerous projectiles can add to the toll.",
|
||||
],
|
||||
"Elevated": ["The occurrence of isolated tornadoes can hinder the execution of other emergency activities during tropical events.",
|
||||
"If realized, a few places may experience tornado damage, along with power and communications disruptions.",
|
||||
"Locations could realize roofs peeled off buildings, chimneys toppled, mobile homes pushed off foundations or overturned, large tree tops and branches snapped off, shallow-rooted trees knocked over, moving vehicles blown off roads, and small boats pulled from moorings.",
|
||||
],
|
||||
"None": ["Little to no potential impacts from tropical tornadoes.",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2751,7 +2671,7 @@ class StormSurgeSectionStats(SectionCommonStats):
|
|||
(str(phishStartTime), str(phishEndTime)), 1)
|
||||
|
||||
if curPhish is not None and possibleStop != 2:
|
||||
if curPhish >= 1:
|
||||
if curPhish >= 0.5:
|
||||
if phishStartTime is None:
|
||||
phishStartTime = tr.startTime()
|
||||
possibleStop = 0
|
||||
|
|
|
@ -2,4 +2,5 @@ source.. = src/
|
|||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
res/,\
|
||||
utility/
|
||||
|
|
|
@ -56,8 +56,9 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* 20071109 391 jkorman Factored out time constants.
|
||||
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
* Sep 30, 2014 3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()}
|
||||
* Sep 30, 2014 #3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()}
|
||||
* calls, added HUMIDITY_PATTERN.
|
||||
* May 26, 2015 #4525 mapeters Fix pressure unit conversion.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -79,7 +80,7 @@ public class SynopticGroups {
|
|||
private static final UnitConverter cToK = SI.CELSIUS
|
||||
.getConverterTo(SI.KELVIN);
|
||||
|
||||
private static final UnitConverter hPaToPa = SI.HECTO(SI.PASCAL)
|
||||
private static final UnitConverter daPaToPa = SI.DEKA(SI.PASCAL)
|
||||
.getConverterTo(SI.PASCAL);
|
||||
|
||||
/**
|
||||
|
@ -188,7 +189,7 @@ public class SynopticGroups {
|
|||
}
|
||||
break;
|
||||
}
|
||||
// No default specified!
|
||||
// No default specified!
|
||||
} // end.switch
|
||||
}
|
||||
}
|
||||
|
@ -214,13 +215,14 @@ public class SynopticGroups {
|
|||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("stationPressure");
|
||||
// RULE : If the value is between 0 and 100, assume the
|
||||
// value
|
||||
// is above 1000 hPa i.e. 0132 --> 1013.2 hPa --> 101320 Pa
|
||||
/*
|
||||
* RULE : If the value is between 0 and 1000 daPa, add 10000
|
||||
* daPa (e.g. 0132 = 10132 daPa).
|
||||
*/
|
||||
if (val < 1000) {
|
||||
decodedItem.setDataValue(hPaToPa.convert(val) + 100000);
|
||||
decodedItem.setDataValue(daPaToPa.convert(val + 10000));
|
||||
} else {
|
||||
decodedItem.setDataValue(hPaToPa.convert(val));
|
||||
decodedItem.setDataValue(daPaToPa.convert(val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,13 +250,14 @@ public class SynopticGroups {
|
|||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("seaLevelPressure");
|
||||
// RULE : If the value is between 0 and 100, assume the
|
||||
// value
|
||||
// is above 1000 hPa i.e. 0132 --> 1013.2 hPa --> 101320 Pa
|
||||
/*
|
||||
* RULE : If the value is between 0 and 1000 daPa, add 10000
|
||||
* daPa (e.g. 0132 = 10132 daPa).
|
||||
*/
|
||||
if (val < 1000) {
|
||||
decodedItem.setDataValue(hPaToPa.convert(val) + 100000);
|
||||
decodedItem.setDataValue(daPaToPa.convert(val + 10000));
|
||||
} else {
|
||||
decodedItem.setDataValue(hPaToPa.convert(val));
|
||||
decodedItem.setDataValue(daPaToPa.convert(val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +285,7 @@ public class SynopticGroups {
|
|||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 2, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("3HRChange");
|
||||
decodedItem.setDataValue(hPaToPa.convert(val));
|
||||
decodedItem.setDataValue(daPaToPa.convert(val));
|
||||
decodedItem.setDataPeriod(3 * TimeUtil.SECONDS_PER_HOUR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* unused duration field, made patterns constant.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
* Sep 30, 2014 #3629 mapeters Conformed to changes in ISynoptic constants.
|
||||
* May 26, 2015 #4525 mapeters Fix pressure unit conversion.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -97,7 +98,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
|
||||
private Double windGust912 = null;
|
||||
|
||||
private static final UnitConverter hPaToPa = SI.HECTO(SI.PASCAL)
|
||||
private static final UnitConverter daPaToPa = SI.DEKA(SI.PASCAL)
|
||||
.getConverterTo(SI.PASCAL);
|
||||
|
||||
/**
|
||||
|
@ -116,6 +117,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
* @throws DecoderException
|
||||
* Thrown when an relevant error has occurred.
|
||||
*/
|
||||
@Override
|
||||
public void decode(ReportParser reportParser) throws DecoderException {
|
||||
|
||||
int iSubW = decoderParent.getISubw();
|
||||
|
@ -162,8 +164,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
closeGroup(3);
|
||||
} else if ("4".equals(element.substring(0, 1)) && doGroup(4)) {
|
||||
closeGroup(4);
|
||||
} else if (P589.matcher(element).find()
|
||||
&& doGroup(5)) {
|
||||
} else if (P589.matcher(element).find() && doGroup(5)) {
|
||||
int sign = 0;
|
||||
if (element.charAt(1) == '8') {
|
||||
sign = 1;
|
||||
|
@ -173,8 +174,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
Integer val = AbstractSfcObsDecoder.getInt(element, 2, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
pressure24 = new DataItem("24HRChange");
|
||||
pressure24.setDataValue(hPaToPa.convert(val
|
||||
* sign));
|
||||
pressure24.setDataValue(daPaToPa.convert(val * sign));
|
||||
pressure24.setDataPeriod(TimeUtil.SECONDS_PER_DAY);
|
||||
}
|
||||
closeGroup(5);
|
||||
|
@ -221,6 +221,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
* An ObsCommon to receive the decoded data.
|
||||
* @return The populated receiver object.
|
||||
*/
|
||||
@Override
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
|
||||
if (maxTemperature != null) {
|
||||
|
|
|
@ -2,4 +2,5 @@ source.. = src/
|
|||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
||||
res/,\
|
||||
utility/
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
<permission id="com.raytheon.localization.site/cave_static/gfe/comboData">
|
||||
</permission>
|
||||
|
||||
<permission id="com.raytheon.localization.site/cave_static/gfe/tcvAdvisories">
|
||||
</permission>
|
||||
|
||||
<permission id="com.raytheon.localization.site/cave_static/gfe">
|
||||
</permission>
|
||||
|
||||
|
@ -115,6 +118,7 @@
|
|||
<userPermission>com.raytheon.localization.site/common_static/hydro</userPermission>
|
||||
<userPermission>com.raytheon.localization.site/common_static/gfe</userPermission>
|
||||
<userPermission>com.raytheon.localization.site/cave_static/gfe/comboData</userPermission>
|
||||
<userPermission>com.raytheon.localization.site/cave_static/gfe/tcvAdvisories</userPermission>
|
||||
<userPermission>com.raytheon.localization.site/cave_static/gfe</userPermission>
|
||||
<userPermission>com.raytheon.localization.site/common_static/isc</userPermission>
|
||||
<userPermission>com.raytheon.localization.user/common_static/gfe</userPermission>
|
||||
|
|
Loading…
Add table
Reference in a new issue