Merge "Issue #1804 Remove empty data structures from radar hdf5. Change-Id: Ide845d6a5b308f61dc070f3acb01b96ed9a9288d" into omaha_13.3.1
Former-commit-id:d1e37c7803
[formerly3b8e2ff0d3
] [formerlyadbe7b91cc
[formerly 186e08826a1a9860bd38c5dd10465b38721218f2]] Former-commit-id:adbe7b91cc
Former-commit-id:3bad342dca
This commit is contained in:
commit
53d8ef7ed1
4 changed files with 131 additions and 110 deletions
|
@ -35,6 +35,7 @@ import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.Layer;
|
import com.raytheon.uf.common.dataplugin.radar.level3.Layer;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.LinkedVector;
|
import com.raytheon.uf.common.dataplugin.radar.level3.LinkedVector;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.LinkedVectorPacket;
|
import com.raytheon.uf.common.dataplugin.radar.level3.LinkedVectorPacket;
|
||||||
|
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyBlock;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyPacket;
|
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyPacket;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.TextSymbolPacket;
|
import com.raytheon.uf.common.dataplugin.radar.level3.TextSymbolPacket;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.UnlinkedVector;
|
import com.raytheon.uf.common.dataplugin.radar.level3.UnlinkedVector;
|
||||||
|
@ -78,6 +79,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* Mar 16, 2009 askripsk Initial creation
|
* Mar 16, 2009 askripsk Initial creation
|
||||||
* Jul 26, 2010 #3723 bkowal Now implements the magnification
|
* Jul 26, 2010 #3723 bkowal Now implements the magnification
|
||||||
* capability.
|
* capability.
|
||||||
|
* Mar 19, 2013 1804 bsteffen Remove empty data structures from radar
|
||||||
|
* hdf5.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -335,26 +338,29 @@ public class RadarXYResource extends RadarImageResource<RadarXYDescriptor> {
|
||||||
linkedLines.clear();
|
linkedLines.clear();
|
||||||
unlinkedLines.clear();
|
unlinkedLines.clear();
|
||||||
points.clear();
|
points.clear();
|
||||||
for (Layer currLayer : radarRecord.getSymbologyBlock().getLayers()) {
|
SymbologyBlock sb = radarRecord.getSymbologyBlock();
|
||||||
for (SymbologyPacket currPacket : currLayer.getPackets()) {
|
if (sb != null) {
|
||||||
if (currPacket instanceof TextSymbolPacket) {
|
for (Layer currLayer : sb.getLayers()) {
|
||||||
TextSymbolPacket tsp = (TextSymbolPacket) currPacket;
|
for (SymbologyPacket currPacket : currLayer.getPackets()) {
|
||||||
this.screenStringMap.put(
|
if (currPacket instanceof TextSymbolPacket) {
|
||||||
new Coordinate(tsp.getI(), tsp.getJ()),
|
TextSymbolPacket tsp = (TextSymbolPacket) currPacket;
|
||||||
tsp.getTheText());
|
this.screenStringMap.put(
|
||||||
} else if (currPacket instanceof WindBarbPacket) {
|
new Coordinate(tsp.getI(), tsp.getJ()),
|
||||||
WindBarbPacket pk = (WindBarbPacket) currPacket;
|
tsp.getTheText());
|
||||||
points.addAll(Arrays.asList(pk.getPoints()));
|
} else if (currPacket instanceof WindBarbPacket) {
|
||||||
} else if (currPacket instanceof UnlinkedVectorPacket) {
|
WindBarbPacket pk = (WindBarbPacket) currPacket;
|
||||||
UnlinkedVectorPacket pk = (UnlinkedVectorPacket) currPacket;
|
points.addAll(Arrays.asList(pk.getPoints()));
|
||||||
|
} else if (currPacket instanceof UnlinkedVectorPacket) {
|
||||||
|
UnlinkedVectorPacket pk = (UnlinkedVectorPacket) currPacket;
|
||||||
|
|
||||||
this.unlinkedLines.addAll(pk.getVectors());
|
this.unlinkedLines.addAll(pk.getVectors());
|
||||||
} else if (currPacket instanceof LinkedVectorPacket) {
|
} else if (currPacket instanceof LinkedVectorPacket) {
|
||||||
LinkedVectorPacket pk = (LinkedVectorPacket) currPacket;
|
LinkedVectorPacket pk = (LinkedVectorPacket) currPacket;
|
||||||
|
|
||||||
this.linkedLines.addAll(pk.getVectors());
|
this.linkedLines.addAll(pk.getVectors());
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Need: " + currPacket.getClass());
|
System.out.println("Need: " + currPacket.getClass());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,9 +86,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||||
* 2/14/2007 139 Phillippe Initial check-in. Refactor of initial implementation.
|
* 2/14/2007 139 Phillippe Initial check-in. Refactor of initial implementation.
|
||||||
* Dec 17, 2007 600 bphillip Added dao pool usage
|
* Dec 17, 2007 600 bphillip Added dao pool usage
|
||||||
* Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed.
|
* Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed.
|
||||||
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
|
* Mar 19, 2013 1804 bsteffen Optimize decoder performance.
|
||||||
* HDF5.
|
|
||||||
* Mar 19, 2013 1804 bsteffen Cache db queries in radar decoder.
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -547,12 +545,11 @@ public class RadarDecoder extends AbstractDecoder {
|
||||||
*/
|
*/
|
||||||
private void processSymbologyBlock(RadarRecord record,
|
private void processSymbologyBlock(RadarRecord record,
|
||||||
SymbologyBlock symbologyBlock) {
|
SymbologyBlock symbologyBlock) {
|
||||||
|
|
||||||
int errorCount = 0;
|
|
||||||
|
|
||||||
if (symbologyBlock == null) {
|
if (symbologyBlock == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int packetsKept = 0;
|
||||||
|
|
||||||
List<Layer> packetsInLyrs = new ArrayList<Layer>();
|
List<Layer> packetsInLyrs = new ArrayList<Layer>();
|
||||||
for (int layer = 0; layer < symbologyBlock.getNumLayers(); ++layer) {
|
for (int layer = 0; layer < symbologyBlock.getNumLayers(); ++layer) {
|
||||||
|
@ -589,20 +586,19 @@ public class RadarDecoder extends AbstractDecoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
packetsKept += packets.size();
|
||||||
lyr.setPackets(packets.toArray(new SymbologyPacket[packets.size()]));
|
lyr.setPackets(packets.toArray(new SymbologyPacket[packets.size()]));
|
||||||
packetsInLyrs.add(lyr);
|
packetsInLyrs.add(lyr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the radial and raster from the symb block
|
// remove the radial and raster from the symb block, only keep it if
|
||||||
symbologyBlock.setLayers(packetsInLyrs.toArray(new Layer[packetsInLyrs
|
// there are other packets.
|
||||||
.size()]));
|
if (packetsKept > 0) {
|
||||||
record.setSymbologyBlock(symbologyBlock);
|
symbologyBlock.setLayers(packetsInLyrs
|
||||||
record.correlateSymbologyPackets();
|
.toArray(new Layer[packetsInLyrs.size()]));
|
||||||
|
record.setSymbologyBlock(symbologyBlock);
|
||||||
if (errorCount > 0) {
|
record.correlateSymbologyPackets();
|
||||||
logger.error("Radar file contains " + errorCount
|
|
||||||
+ " unrecognized symbology packet types.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ package com.raytheon.edex.plugin.radar.dao;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 02/06/09 1990 bphillip Initial creation
|
* 02/06/09 1990 bphillip Initial creation
|
||||||
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
|
* Mar 18, 2013 1804 bsteffen Reduce useless data stored in radar hdf5
|
||||||
* HDF5.
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bphillip
|
* @author bphillip
|
||||||
|
@ -43,12 +43,15 @@ import java.util.Map;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||||
|
import com.raytheon.uf.common.dataplugin.radar.RadarDataKey;
|
||||||
|
import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.RadarStoredData;
|
import com.raytheon.uf.common.dataplugin.radar.RadarStoredData;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.GSMBlock.GSMMessage;
|
import com.raytheon.uf.common.dataplugin.radar.level3.GSMBlock.GSMMessage;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock;
|
import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyBlock;
|
import com.raytheon.uf.common.dataplugin.radar.level3.SymbologyBlock;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants;
|
import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants;
|
||||||
|
import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants.MapValues;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever;
|
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever;
|
||||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||||
import com.raytheon.uf.common.datastorage.StorageProperties;
|
import com.raytheon.uf.common.datastorage.StorageProperties;
|
||||||
|
@ -135,10 +138,10 @@ public class RadarDao extends PluginDao {
|
||||||
dataStore.addDataRecord(bdr, sp);
|
dataStore.addDataRecord(bdr, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radarRec.getSymbologyData() != null) {
|
Map<RadarDataKey, RadarDataPoint> symData = radarRec.getSymbologyData();
|
||||||
|
if (symData != null && !symData.isEmpty()) {
|
||||||
byte[] data = DynamicSerializationManager.getManager(
|
byte[] data = DynamicSerializationManager.getManager(
|
||||||
SerializationType.Thrift).serialize(
|
SerializationType.Thrift).serialize(symData);
|
||||||
radarRec.getSymbologyData());
|
|
||||||
ByteDataRecord bdr = new ByteDataRecord(
|
ByteDataRecord bdr = new ByteDataRecord(
|
||||||
RadarStoredData.SYM_DATA_ID, radarRec.getDataURI(), data);
|
RadarStoredData.SYM_DATA_ID, radarRec.getDataURI(), data);
|
||||||
bdr.setCorrelationObject(radarRec);
|
bdr.setCorrelationObject(radarRec);
|
||||||
|
@ -156,10 +159,11 @@ public class RadarDao extends PluginDao {
|
||||||
dataStore.addDataRecord(bdr, sp);
|
dataStore.addDataRecord(bdr, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radarRec.getMapProductVals() != null) {
|
Map<MapValues, Map<String, Map<MapValues, String>>> mapProdVals = radarRec
|
||||||
|
.getMapProductVals();
|
||||||
|
if (mapProdVals != null && !mapProdVals.isEmpty()) {
|
||||||
byte[] data = DynamicSerializationManager.getManager(
|
byte[] data = DynamicSerializationManager.getManager(
|
||||||
SerializationType.Thrift).serialize(
|
SerializationType.Thrift).serialize(mapProdVals);
|
||||||
radarRec.getMapProductVals());
|
|
||||||
ByteDataRecord bdr = new ByteDataRecord(
|
ByteDataRecord bdr = new ByteDataRecord(
|
||||||
RadarStoredData.PRODUCT_VALS_ID, radarRec.getDataURI(),
|
RadarStoredData.PRODUCT_VALS_ID, radarRec.getDataURI(),
|
||||||
data);
|
data);
|
||||||
|
@ -186,19 +190,21 @@ public class RadarDao extends PluginDao {
|
||||||
dataStore.addDataRecord(rec, sp);
|
dataStore.addDataRecord(rec, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radarRec.getMapRecordVals() != null) {
|
Map<MapValues, Map<MapValues, String>> mapRecVals = radarRec
|
||||||
|
.getMapRecordVals();
|
||||||
|
if (mapRecVals != null && !mapRecVals.isEmpty()) {
|
||||||
byte[] data = DynamicSerializationManager.getManager(
|
byte[] data = DynamicSerializationManager.getManager(
|
||||||
SerializationType.Thrift).serialize(
|
SerializationType.Thrift).serialize(mapRecVals);
|
||||||
radarRec.getMapRecordVals());
|
|
||||||
ByteDataRecord bdr = new ByteDataRecord(
|
ByteDataRecord bdr = new ByteDataRecord(
|
||||||
RadarStoredData.RECORD_VALS_ID, radarRec.getDataURI(), data);
|
RadarStoredData.RECORD_VALS_ID, radarRec.getDataURI(), data);
|
||||||
bdr.setCorrelationObject(radarRec);
|
bdr.setCorrelationObject(radarRec);
|
||||||
dataStore.addDataRecord(bdr, sp);
|
dataStore.addDataRecord(bdr, sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radarRec.getStormIDs() != null) {
|
Map<String, RadarDataKey> stormIds = radarRec.getStormIDs();
|
||||||
|
if (stormIds != null && !stormIds.isEmpty()) {
|
||||||
byte[] data = DynamicSerializationManager.getManager(
|
byte[] data = DynamicSerializationManager.getManager(
|
||||||
SerializationType.Thrift).serialize(radarRec.getStormIDs());
|
SerializationType.Thrift).serialize(stormIds);
|
||||||
ByteDataRecord bdr = new ByteDataRecord(
|
ByteDataRecord bdr = new ByteDataRecord(
|
||||||
RadarStoredData.STORM_IDS_ID, radarRec.getDataURI(), data);
|
RadarStoredData.STORM_IDS_ID, radarRec.getDataURI(), data);
|
||||||
bdr.setCorrelationObject(radarRec);
|
bdr.setCorrelationObject(radarRec);
|
||||||
|
|
|
@ -56,8 +56,9 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 11, 2010 mnash Initial creation
|
* Aug 11, 2010 mnash Initial creation
|
||||||
* Dec 28, 2011 11705 gzhang Fix SCAN missing Rows error
|
* Dec 28, 2011 11705 gzhang Fix SCAN missing Rows error
|
||||||
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
|
* Mar 19, 2013 1804 bsteffen Reduce useless data stored in radar hdf5
|
||||||
* HDF5.
|
* Mar 19, 2013 1804 bsteffen Remove empty data structures from radar
|
||||||
|
* hdf5.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -86,9 +87,8 @@ public class RadarRecordUtil {
|
||||||
.getTheText())) {
|
.getTheText())) {
|
||||||
Map<GraphicBlockValues, String> map = new HashMap<GraphicBlockValues, String>();
|
Map<GraphicBlockValues, String> map = new HashMap<GraphicBlockValues, String>();
|
||||||
Matcher m = RadarConstants.graphic_block_pattern
|
Matcher m = RadarConstants.graphic_block_pattern
|
||||||
.matcher(
|
.matcher(getNormalizedGBText(((TextSymbolPacket) packets[j])
|
||||||
getNormalizedGBText( ((TextSymbolPacket) packets[j]).getTheText() )
|
.getTheText()));
|
||||||
);
|
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
String storm_id = m.group(1).trim();
|
String storm_id = m.group(1).trim();
|
||||||
map.put(GraphicBlockValues.AZIMUTH, m
|
map.put(GraphicBlockValues.AZIMUTH, m
|
||||||
|
@ -149,8 +149,7 @@ public class RadarRecordUtil {
|
||||||
String property) {
|
String property) {
|
||||||
String rval = "";
|
String rval = "";
|
||||||
|
|
||||||
for (RadarDataKey curLatLon : record.getSymbologyData()
|
for (RadarDataKey curLatLon : record.getSymbologyData().keySet()) {
|
||||||
.keySet()) {
|
|
||||||
RadarDataPoint currPoint = record.getSymbologyData().get(curLatLon);
|
RadarDataPoint currPoint = record.getSymbologyData().get(curLatLon);
|
||||||
|
|
||||||
for (Integer type : currPoint.getDisplayGenericPointData().keySet()) {
|
for (Integer type : currPoint.getDisplayGenericPointData().keySet()) {
|
||||||
|
@ -170,8 +169,10 @@ public class RadarRecordUtil {
|
||||||
/**
|
/**
|
||||||
* Get the GenericDataComponent.
|
* Get the GenericDataComponent.
|
||||||
*
|
*
|
||||||
* @param record The RadarRecord
|
* @param record
|
||||||
* @param featureId The featureId
|
* The RadarRecord
|
||||||
|
* @param featureId
|
||||||
|
* The featureId
|
||||||
*
|
*
|
||||||
* @return The GenericDataComponent, or null if no matches
|
* @return The GenericDataComponent, or null if no matches
|
||||||
*/
|
*/
|
||||||
|
@ -192,13 +193,15 @@ public class RadarRecordUtil {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<String> getDMDFeatureIDs(RadarRecord record) {
|
public static List<String> getDMDFeatureIDs(RadarRecord record) {
|
||||||
List<String> rval = new ArrayList<String>();
|
List<String> rval = new ArrayList<String>();
|
||||||
|
SymbologyBlock sb = record.getSymbologyBlock();
|
||||||
for (Layer layer : record.getSymbologyBlock().getLayers()) {
|
if (sb != null) {
|
||||||
for (SymbologyPacket packet : layer.getPackets())
|
for (Layer layer : sb.getLayers()) {
|
||||||
rval.addAll(((DMDPacket) packet).getFeatureIDs());
|
for (SymbologyPacket packet : layer.getPackets())
|
||||||
|
rval.addAll(((DMDPacket) packet).getFeatureIDs());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
@ -207,8 +210,7 @@ public class RadarRecordUtil {
|
||||||
String featureId) {
|
String featureId) {
|
||||||
Coordinate rval = null;
|
Coordinate rval = null;
|
||||||
AreaComponent currFeature = null;
|
AreaComponent currFeature = null;
|
||||||
for (RadarDataKey curLatLon : record.getSymbologyData()
|
for (RadarDataKey curLatLon : record.getSymbologyData().keySet()) {
|
||||||
.keySet()) {
|
|
||||||
RadarDataPoint currPoint = record.getSymbologyData().get(curLatLon);
|
RadarDataPoint currPoint = record.getSymbologyData().get(curLatLon);
|
||||||
|
|
||||||
for (Integer type : currPoint.getDisplayGenericPointData().keySet()) {
|
for (Integer type : currPoint.getDisplayGenericPointData().keySet()) {
|
||||||
|
@ -419,17 +421,24 @@ public class RadarRecordUtil {
|
||||||
return record.srmSourceName != null;
|
return record.srmSourceName != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final DHRValues[] ADAP32_VALUES = {
|
private static final DHRValues[] ADAP32_VALUES = { DHRValues.BEAMWIDTH,
|
||||||
DHRValues.BEAMWIDTH, DHRValues.BLOCKAGETHRESHOLD, DHRValues.CLUTTERTHRESHOLD, DHRValues.WEIGHTTHRESHOLD,
|
DHRValues.BLOCKAGETHRESHOLD, DHRValues.CLUTTERTHRESHOLD,
|
||||||
DHRValues.FULLHYBRIDSCANTHRESH, DHRValues.LOWREFLTHRESHOLD, DHRValues.RAINDETREFLTHRESHOLD, DHRValues.RAINDETAREATHRESHOLD,
|
DHRValues.WEIGHTTHRESHOLD, DHRValues.FULLHYBRIDSCANTHRESH,
|
||||||
DHRValues.RAINDETTIMETHRESHOLD, DHRValues.ZRMULTCOEFF, DHRValues.ZRPOWERCOEFF, DHRValues.MINREFLTORATE,
|
DHRValues.LOWREFLTHRESHOLD, DHRValues.RAINDETREFLTHRESHOLD,
|
||||||
DHRValues.MAXREFLTORATE, DHRValues.NUMEXCLZONE, DHRValues.RANGECUTOFF, DHRValues.RANGEEFFCOEFF1,
|
DHRValues.RAINDETAREATHRESHOLD, DHRValues.RAINDETTIMETHRESHOLD,
|
||||||
DHRValues.RANGEEFFCOEFF2, DHRValues.RANGEEFFCOEFF3, DHRValues.MINPRECIPRATEINCL, DHRValues.MAXPRECIPRATEALLOW,
|
DHRValues.ZRMULTCOEFF, DHRValues.ZRPOWERCOEFF,
|
||||||
DHRValues.THRESHELAPSEDTIME, DHRValues.MAXTIMEFORINTERP, DHRValues.MINTIMEHOURLYPERIOD, DHRValues.THRESHOLDHROUTLIER,
|
DHRValues.MINREFLTORATE, DHRValues.MAXREFLTORATE,
|
||||||
DHRValues.ENDTIMEGAGEACCUM, DHRValues.MAXPERIODACCUMVAL, DHRValues.MAXHOURLYACCUMVAL, DHRValues.TIMEBIASEST,
|
DHRValues.NUMEXCLZONE, DHRValues.RANGECUTOFF,
|
||||||
DHRValues.THRESHNOGAGERADAR, DHRValues.RESETBIASVALUE, DHRValues.LONGESTALLOWLAG, DHRValues.BIASAPPLIEDFLAG
|
DHRValues.RANGEEFFCOEFF1, DHRValues.RANGEEFFCOEFF2,
|
||||||
};
|
DHRValues.RANGEEFFCOEFF3, DHRValues.MINPRECIPRATEINCL,
|
||||||
|
DHRValues.MAXPRECIPRATEALLOW, DHRValues.THRESHELAPSEDTIME,
|
||||||
|
DHRValues.MAXTIMEFORINTERP, DHRValues.MINTIMEHOURLYPERIOD,
|
||||||
|
DHRValues.THRESHOLDHROUTLIER, DHRValues.ENDTIMEGAGEACCUM,
|
||||||
|
DHRValues.MAXPERIODACCUMVAL, DHRValues.MAXHOURLYACCUMVAL,
|
||||||
|
DHRValues.TIMEBIASEST, DHRValues.THRESHNOGAGERADAR,
|
||||||
|
DHRValues.RESETBIASVALUE, DHRValues.LONGESTALLOWLAG,
|
||||||
|
DHRValues.BIASAPPLIEDFLAG };
|
||||||
|
|
||||||
public static Map<DHRValues, Double> getDHRValues(RadarRecord record) {
|
public static Map<DHRValues, Double> getDHRValues(RadarRecord record) {
|
||||||
Map<DHRValues, Double> map = new HashMap<DHRValues, Double>();
|
Map<DHRValues, Double> map = new HashMap<DHRValues, Double>();
|
||||||
String text = null;
|
String text = null;
|
||||||
|
@ -458,11 +467,11 @@ public class RadarRecordUtil {
|
||||||
boolean biasApplied = false;
|
boolean biasApplied = false;
|
||||||
double biasCalculated = 1.0;
|
double biasCalculated = 1.0;
|
||||||
Integer flagZeroHybrid = null;
|
Integer flagZeroHybrid = null;
|
||||||
|
|
||||||
String[] v = new String[nv];
|
String[] v = new String[nv];
|
||||||
for (vi = 0; vi < nv; ++vi)
|
for (vi = 0; vi < nv; ++vi)
|
||||||
v[vi] = text.substring(vi * 8, (vi+1) * 8);
|
v[vi] = text.substring(vi * 8, (vi + 1) * 8);
|
||||||
|
|
||||||
vi = 0;
|
vi = 0;
|
||||||
while (vi < nv) {
|
while (vi < nv) {
|
||||||
String s = v[vi++];
|
String s = v[vi++];
|
||||||
|
@ -477,10 +486,12 @@ public class RadarRecordUtil {
|
||||||
while (vi < nv) {
|
while (vi < nv) {
|
||||||
s = v[vi++];
|
s = v[vi++];
|
||||||
if (s.equals("SUPL(15)")) {
|
if (s.equals("SUPL(15)")) {
|
||||||
/* // average scan date/time are never used...
|
/*
|
||||||
map.put(DHRValues.AVGSCANDATE, parseDHRValue(text, vi + 0));
|
* // average scan date/time are never used...
|
||||||
map.put(DHRValues.AVGSCANTIME, parseDHRValue(text, vi + 1));
|
* map.put(DHRValues.AVGSCANDATE, parseDHRValue(text, vi
|
||||||
*/
|
* + 0)); map.put(DHRValues.AVGSCANTIME,
|
||||||
|
* parseDHRValue(text, vi + 1));
|
||||||
|
*/
|
||||||
flagZeroHybrid = (int) parseDHRValue(v[vi + 2]);
|
flagZeroHybrid = (int) parseDHRValue(v[vi + 2]);
|
||||||
if (flagZeroHybrid != 0 && flagZeroHybrid != 1)
|
if (flagZeroHybrid != 0 && flagZeroHybrid != 1)
|
||||||
flagZeroHybrid = 0; // should print warning
|
flagZeroHybrid = 0; // should print warning
|
||||||
|
@ -491,7 +502,8 @@ public class RadarRecordUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (s.equals("ADAP(38)")) {
|
} else if (s.equals("ADAP(38)")) {
|
||||||
// Don't have documentation for older formats, so copying logic from A1 decodeDHR.C.
|
// Don't have documentation for older formats, so copying logic
|
||||||
|
// from A1 decodeDHR.C.
|
||||||
map.put(DHRValues.ZRMULTCOEFF, parseDHRValue(v[vi + 9]));
|
map.put(DHRValues.ZRMULTCOEFF, parseDHRValue(v[vi + 9]));
|
||||||
map.put(DHRValues.ZRPOWERCOEFF, parseDHRValue(v[vi + 10]));
|
map.put(DHRValues.ZRPOWERCOEFF, parseDHRValue(v[vi + 10]));
|
||||||
map.put(DHRValues.MAXPRECIPRATEALLOW, parseDHRValue(v[vi + 25]));
|
map.put(DHRValues.MAXPRECIPRATEALLOW, parseDHRValue(v[vi + 25]));
|
||||||
|
@ -523,12 +535,12 @@ public class RadarRecordUtil {
|
||||||
}
|
}
|
||||||
if (flagZeroHybrid != null)
|
if (flagZeroHybrid != null)
|
||||||
map.put(DHRValues.FLAGZEROHYBRID, (double) flagZeroHybrid);
|
map.put(DHRValues.FLAGZEROHYBRID, (double) flagZeroHybrid);
|
||||||
if (! biasApplied) {
|
if (!biasApplied) {
|
||||||
biasCalculated = 1.0;
|
biasCalculated = 1.0;
|
||||||
}
|
}
|
||||||
map.put(DHRValues.BIAS, biasCalculated);
|
map.put(DHRValues.BIAS, biasCalculated);
|
||||||
|
|
||||||
// Also include logic from A1 FFMPContainer::read(), FFMP_ORPG case
|
// Also include logic from A1 FFMPContainer::read(), FFMP_ORPG case
|
||||||
boolean havePrecip;
|
boolean havePrecip;
|
||||||
if (flagZeroHybrid == null) {
|
if (flagZeroHybrid == null) {
|
||||||
havePrecip = precipCat > 0;
|
havePrecip = precipCat > 0;
|
||||||
|
@ -537,11 +549,11 @@ public class RadarRecordUtil {
|
||||||
}
|
}
|
||||||
map.put(DHRValues.HAVE_PRECIP, havePrecip ? 1.0 : 0);
|
map.put(DHRValues.HAVE_PRECIP, havePrecip ? 1.0 : 0);
|
||||||
map.put(DHRValues.BIAS_TO_USE, havePrecip ? biasCalculated : 1.0);
|
map.put(DHRValues.BIAS_TO_USE, havePrecip ? biasCalculated : 1.0);
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double parseDHRValue(String text) {
|
private static double parseDHRValue(String text) {
|
||||||
String s = text.trim();
|
String s = text.trim();
|
||||||
if (s.equals("T"))
|
if (s.equals("T"))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -550,8 +562,8 @@ public class RadarRecordUtil {
|
||||||
else
|
else
|
||||||
return Double.parseDouble(s);
|
return Double.parseDouble(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DR#11705: SCAN missing row(s) comparing to radar Comb Att Table.
|
* DR#11705: SCAN missing row(s) comparing to radar Comb Att Table.
|
||||||
*
|
*
|
||||||
* Error cause: RadarConstants.GRAPHIC_BLOCK as a Regular Expression
|
* Error cause: RadarConstants.GRAPHIC_BLOCK as a Regular Expression
|
||||||
|
@ -564,27 +576,28 @@ public class RadarRecordUtil {
|
||||||
* @param : Graphic Block Text that may contain ">" and/or "<".
|
* @param : Graphic Block Text that may contain ">" and/or "<".
|
||||||
* @return: String with ">" and/or "<" replaced by space.
|
* @return: String with ">" and/or "<" replaced by space.
|
||||||
*/
|
*/
|
||||||
private static String getNormalizedGBText(String text){
|
private static String getNormalizedGBText(String text) {
|
||||||
|
|
||||||
if(text == null || text.isEmpty() || ( (! text.contains(">")) && (! text.contains("<")) ) )
|
if (text == null || text.isEmpty()
|
||||||
return text;
|
|| ((!text.contains(">")) && (!text.contains("<"))))
|
||||||
|
return text;
|
||||||
/*
|
|
||||||
* contains only ">"
|
/*
|
||||||
*/
|
* contains only ">"
|
||||||
if( ! text.contains("<") )
|
*/
|
||||||
return text.replaceAll(">", " ");
|
if (!text.contains("<"))
|
||||||
|
return text.replaceAll(">", " ");
|
||||||
/*
|
|
||||||
* contains only "<"
|
/*
|
||||||
*/
|
* contains only "<"
|
||||||
if( ! text.contains(">") )
|
*/
|
||||||
return text.replaceAll("<", " ");
|
if (!text.contains(">"))
|
||||||
|
return text.replaceAll("<", " ");
|
||||||
/*
|
|
||||||
* contains both "<" and ">"
|
/*
|
||||||
*/
|
* contains both "<" and ">"
|
||||||
return text.replaceAll(">"," ").replaceAll("<", " ");
|
*/
|
||||||
|
return text.replaceAll(">", " ").replaceAll("<", " ");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue