Merge branch 'asm_15.1.1' of ssh://10.201.30.8:29418/AWIPS2_baseline into master_15.1.1

Former-commit-id: f83dc651e89ba0a1beaa360fd8d14eda90a5bc29
This commit is contained in:
Fay.Liang 2015-07-31 09:57:28 -04:00
commit f185d26495
7 changed files with 82 additions and 60 deletions

View file

@ -82,6 +82,8 @@ import com.raytheon.uf.viz.d2d.core.D2DLoadProperties;
* like A1.
* May 5, 2014 3265 bsteffen Better handling of resources returning
* null dataTimes.
* Jul 30, 2015 17761 D. Friedman Allow resources to return data times based
* on base frame times.
*
*
* </pre>
@ -424,7 +426,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
config = config.clone();
if ((config.getDataTimes() == null)
|| (config.getDataTimes().length < 1)) {
config.setDataTimes(getLatestTimes(rsc));
config.setDataTimes(getLatestTimes(rsc, timeSteps));
}
populateConfiguration(config);
TimeMatcher tm = new TimeMatcher();
@ -586,7 +588,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
rsc.getLoadProperties()).clone();
if ((config.getDataTimes() == null)
|| (config.getDataTimes().length < 1)) {
config.setDataTimes(getLatestTimes(rsc));
config.setDataTimes(getLatestTimes(rsc, null));
if ((config.getDataTimes() == null)
|| (config.getDataTimes().length < 1)) {
return null;
@ -707,10 +709,11 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
* product times.
*
* @param rsc
* @param timeSteps
* @return
* @throws VizException
*/
protected DataTime[] getLatestTimes(AbstractVizResource<?, ?> rsc)
protected DataTime[] getLatestTimes(AbstractVizResource<?, ?> rsc, DataTime[] timeSteps)
throws VizException {
DataTime[] availableTimes = null;
@ -727,7 +730,7 @@ public class D2DTimeMatcher extends AbstractTimeMatcher {
}
if (availableTimes == null) {
availableTimes = rsc.getDataTimes();
availableTimes = rsc.getMatchedDataTimes(timeSteps);
Arrays.sort(availableTimes);
}

View file

@ -70,6 +70,7 @@ import com.raytheon.viz.ui.input.EditableManager;
* adjustAngle to protected.
* Mar 15, 2013 15693 mgamazaychikov Added magnification to display state.
* Jun 10, 2014 3263 bsteffen Synchronize dataTimes
* Jul 30, 2015 17761 D. Friedman Fix time matching.
*
* </pre>
*
@ -123,7 +124,7 @@ public abstract class AbstractStormTrackResource extends
}
@Override
public DataTime[] getDataTimes() {
public DataTime[] getMatchedDataTimes(DataTime[] timeSteps) {
synchronized (this.dataTimes) {
if (timeMatchBasis) {
@ -142,12 +143,11 @@ public abstract class AbstractStormTrackResource extends
this.fillDataTimeArray(earliestTime, variance);
}
} else {
FramesInfo info = descriptor.getFramesInfo();
dataTimes.clear();
this.maximumFrameCount = this.descriptor.getNumberOfFrames();
// First time called
if (info.getFrameTimes() != null) {
for (DataTime dt : info.getFrameTimes()) {
if (timeSteps != null) {
for (DataTime dt : timeSteps) {
dataTimes.add(dt);
}
}
@ -258,10 +258,6 @@ public abstract class AbstractStormTrackResource extends
@Override
public String getName() {
DataTime[] frameTimes = descriptor.getFramesInfo().getFrameTimes();
if (frameTimes != null) {
descriptor.getTimeMatchingMap().put(this, frameTimes);
}
return getResourceName();
}

View file

@ -12,6 +12,7 @@
# level of site customization
# Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
# Feb 12,2014 17058 ryu Extend converter for Collections$EmptyList objects.
# Jul 29,2015 17770 lshi Added TY.A TY.W to tropicalHaz
#
# Author: randerso
# ----------------------------------------------------------------------------
@ -37,7 +38,7 @@ class Procedure (SmartScript.SmartScript):
self._dataManager = dbss
self._afterInit = 0 #flag indicating init is done.
self._tropicalHaz = ['HU.W','HU.A','HU.S','TR.W','TR.A']
self._tropicalHaz = ['HU.W','HU.A','HU.S','TR.W','TR.A','TY.W','TY.A']
self._natlBaseETN = 1001

View file

@ -34,6 +34,7 @@
# Updated 3/27/09 Shannon for tropical and AF.W
# Updated 3/29/10 Shannon for tropical
# Updated 1/12/11 Shannon to remove HI/TI hazards and fix typos
# Updated 7/28/15 yteng to change Red Flag Warning CTA language for DR 17777
# ----------------------------------------------------------------------------
class CallToActions:
@ -377,7 +378,7 @@ Listen to NOAA Weather Radio or local media for further information.""",
def ctaFWW(self):
return [
"""A Red Flag Warning means that critical fire weather conditions are either occurring now....or will shortly.""",
"""A Red Flag Warning means that critical fire weather conditions are either occurring now....or will shortly. A combination of strong winds...low relative humidity...and warm temperatures can contribute to extreme fire behavior.""",
]
def ctaFZA(self):

View file

@ -10,6 +10,7 @@
# ------------ ---------- ----------- --------------------------
# Jul 10,2012 436 randerso Separated configuration data from the
# MakeHazard procedure
# Jul 29, 2015 17770 lshi Add tcmList template for WP basin
#
# Author: randerso
# ----------------------------------------------------------------------------
@ -144,6 +145,9 @@ tcmList = [] # Comment out for HLS sites
# Uncomment line below for CPac basin sites
#tcmList = ["TCMCP1", "TCMCP2", "TCMCP3", "TCMCP4", "TCMCP5"]
# Uncomment line below for WPac basin sites
#tcmList = ["TCPPQ1", "TCPPQ2", "TCPPQ3", "TCPPQ4", "TCPPQ5"]
# Dictionary mapping Hazard Types to applicable local effect areas
# that can be intersected with the zone edit areas.
# You should not define localEffectAreas entries for Tropical Cyclone

View file

@ -26,6 +26,8 @@
<value>TR.W</value>
<value>SS.A</value>
<value>SS.W</value>
<value>TY.A</value>
<value>TY.W</value>
</set>
</property>
<property name="tropicalEtnPhensigs">
@ -37,6 +39,8 @@
<value>TR.W</value>
<value>SS.A</value>
<value>SS.W</value>
<value>TY.A</value>
<value>TY.W</value>
</set>
</property>
</bean>

View file

@ -67,6 +67,7 @@ import org.eclipse.ui.progress.UIJob;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.operation.TransformException;
import com.google.common.collect.ImmutableMap;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteDefinition;
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
@ -114,6 +115,7 @@ import com.raytheon.viz.ui.statusline.StatusStore;
* Apr 09,2012 436 randerso Merged RNK's MakeHazards_Elevation procedure
* May 30,2012 2028 randerso Cleaned up dialog layout
* Nov 13,2014 646 lshi Fixed hard coded endTimeSlider's Max value
* Jul 30,2015 17770 lshi Add handling for AT, EP, CP and WP basins
*
* </pre>
*
@ -136,20 +138,20 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private static final String EDIT_AREA_MSG = "USING ACTIVE EDIT AREA";
private List<String> tropicalHaz;
private final List<String> tropicalHaz;
private int natlBaseETN;
private final int natlBaseETN;
private Map<String, List<String>> localEffectAreas;
private final Map<String, List<String>> localEffectAreas;
private Map<String, List<Object>> localAreaData;
private final Map<String, List<Object>> localAreaData;
/**
* Zoom step size.
*/
private static final double ZOOM_STEP = 0.75;
private Map<String, List<String>> hazardDict;
private final Map<String, List<String>> hazardDict;
private Text etnSegNumberField;
@ -157,9 +159,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private Label startTimeLabel, endTimeLabel;
private String gmtPattern = "HH:mm'Z' EEE dd-MMM-yy";
private final String gmtPattern = "HH:mm'Z' EEE dd-MMM-yy";
private SimpleDateFormat dateFormatter;
private final SimpleDateFormat dateFormatter;
private ZoneSelector zoneSelector;
@ -180,9 +182,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
/**
* The Python script to load and run methods from.
*/
private String defaultHazardType;
private final String defaultHazardType;
private Map<String, List<String>> mapNames;
private final Map<String, List<String>> mapNames;
private Group hazardTypeGroup;
@ -194,11 +196,11 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private Label usingLabel;
private int defaultMapWidth;
private final int defaultMapWidth;
private RGB mapColor;
private int timeScaleEndTime;
private final int timeScaleEndTime;
private double areaThreshold = DEFAULT_AREA_THRESHOLD;
@ -210,9 +212,9 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private String defaultSegment;
private DataManager dataManager;
private final DataManager dataManager;
private List<String> tcmList;
private final List<String> tcmList;
private String tcmProduct = null;
@ -232,6 +234,14 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private org.eclipse.swt.widgets.List hazardGroupList;
private static final String[] WMO_TITLES = {
"NATIONAL HURRICANE CENTER", //NHC
"NATIONAL WEATHER SERVICE TIYAN", //GUM
"CENTRAL PACIFIC HURRICANE CENTER" //CPHC
};
private static final Map<String, String> BASINS = ImmutableMap.of("AT", "10", "EP", "20", "CP", "30", "WP", "40");
public MakeHazardDialog(Shell parent, DataManager dataManager,
String colorName, int defaultMapWidth, int timeScaleEndTime,
float areaThreshold, String defaultHazardType,
@ -605,8 +615,7 @@ public class MakeHazardDialog extends CaveSWTDialog implements
int segNum = getSegment();
String segmentNumber = "";
// Validate the segment number
if ((this.tropicalHaz.contains(phenSig))
&& !(this.dataManager.getSiteID().equals("GUM"))) {
if ((this.tropicalHaz.contains(phenSig))) {
// if ETN is already correctly assigned, use it
if (segNum >= this.natlBaseETN) {
segmentNumber = Integer.toString(segNum);
@ -682,16 +691,18 @@ public class MakeHazardDialog extends CaveSWTDialog implements
return null;
} else {
String altFileName = getAltInfoFilename(tcmProduct);
String stormNum = altFileName.substring(2, 4);
System.out.println("storm number is " + stormNum);
String nationalBase = "10";
tropicalETN = nationalBase + stormNum;
System.out.println("Tropical ETN is: " + tropicalETN);
System.out.println("length of tropical ETN is: "
+ tropicalETN.length());
if (altFileName != null) {
String nationalBase = BASINS.get("AT");
String baseETN = altFileName.substring(0, 2);
String baseEtnCode = BASINS.get(baseETN);
if (baseEtnCode != null) {
nationalBase = baseEtnCode;
} else {
statusHandler.warn("Undefined basin ID: " + baseETN + ", defaulting to AT");
}
String stormNum = altFileName.substring(2, 4);
tropicalETN = nationalBase + stormNum;
}
}
return tropicalETN;
}
@ -699,10 +710,12 @@ public class MakeHazardDialog extends CaveSWTDialog implements
private String getAltInfoFilename(String[] tcmProduct) {
String altFilename = null;
for (int i = 0; i < tcmProduct.length; i++) {
if (tcmProduct[i].contains("NATIONAL HURRICANE CENTER")) {
String[] parts = tcmProduct[i].split("\\s");
altFilename = parts[parts.length - 1];
break;
for (String title : WMO_TITLES) {
if (tcmProduct[i].contains(title)) {
String[] parts = tcmProduct[i].split("\\s");
altFilename = parts[parts.length - 1];
return altFilename;
}
}
}
return altFilename;