Issue #1804 Remove AlphanumericValues from radar HDF5.

Former-commit-id: 2c8170a332994405820a25d9052afd7bc8cbcd3f
This commit is contained in:
Ben Steffensmeier 2013-03-18 16:58:58 -05:00
parent 1a999fee5a
commit 6c741a9ab3
10 changed files with 75 additions and 100 deletions

View file

@ -1,3 +1,22 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.radar;
import java.io.File;
@ -14,6 +33,25 @@ import com.raytheon.uf.viz.core.HDF5Util;
import com.raytheon.uf.viz.core.cache.CacheObject;
import com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetriever;
/**
* Client side version of radar record that retrieves all data from hdf5 on
* demand and holds it in a cache.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 18, 2013 bsteffen Initial javadoc
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class DefaultVizRadarRecord extends VizRadarRecord {
private static final long serialVersionUID = -6878454982599668417L;
@ -71,9 +109,6 @@ public class DefaultVizRadarRecord extends VizRadarRecord {
if (object.getRawShortData() != null) {
size += object.getRawData().length * 2;
}
if (object.getAlphanumericValues() != null) {
size += object.getAlphanumericValues().length() * 2;
}
if (object.getAngleData() != null) {
size += object.getAngleData().length * 4;
}

View file

@ -42,6 +42,8 @@ import com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetrieverAndDisposer;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 26, 2011 mschenke Initial creation
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
*
* </pre>
*
@ -87,7 +89,6 @@ public class RadarRecordDataRetriever implements
object.setSymbologyBlock(null);
object.setSymbologyData(null);
object.setProductVals(null);
object.setAlphanumericValues(null);
object.setMapRecordVals(null);
object.setGsmMessage(null);
object.setStormIDs(null);
@ -129,9 +130,6 @@ public class RadarRecordDataRetriever implements
if (object.getMapProductVals() != null) {
objs.add(object.getMapProductVals());
}
if (object.getAlphanumericValues() != null) {
objs.add(object.getAlphanumericValues());
}
if (object.getMapRecordVals() != null) {
objs.add(object.getMapRecordVals());
}

View file

@ -85,6 +85,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* 2/14/2007 139 Phillippe Initial check-in. Refactor of initial implementation.
* Dec 17, 2007 600 bphillip Added dao pool usage
* Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed.
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
* </pre>
*
* @author bphillip
@ -409,8 +411,6 @@ public class RadarDecoder extends AbstractDecoder {
record.setMapRecordVals(recordVals);
record.setTabularBlock(tb);
}
record.setAlphanumericValues(l3Radar
.getAlphanumericValues());
}
try {

View file

@ -28,6 +28,8 @@ package com.raytheon.edex.plugin.radar.dao;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 02/06/09 1990 bphillip Initial creation
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
* </pre>
*
* @author bphillip
@ -165,17 +167,6 @@ public class RadarDao extends PluginDao {
dataStore.addDataRecord(bdr, sp);
}
if (radarRec.getAlphanumericValues() != null) {
byte[] data = DynamicSerializationManager.getManager(
SerializationType.Thrift).serialize(
radarRec.getAlphanumericValues());
ByteDataRecord bdr = new ByteDataRecord(
RadarStoredData.ALPHANUMERIC_ID, radarRec.getDataURI(),
data);
bdr.setCorrelationObject(radarRec);
dataStore.addDataRecord(bdr, sp);
}
if (radarRec.getTabularBlock() != null) {
byte[] data = DynamicSerializationManager.getManager(
SerializationType.Thrift).serialize(

View file

@ -157,8 +157,6 @@ public class Level3BaseRadar {
private TabularBlock tabularBlock;
private String alphanumericValues;
private GSMBlock gsmBlock;
private AlertAdaptationParameters aapMessage;
@ -584,45 +582,6 @@ public class Level3BaseRadar {
return tabBlock;
}
private String readAlphanumericAddOn() throws IOException {
if (theRadarData.available() != 0 && symbologyBlock == null) {
short temp = theRadarData.readShort();
while (theRadarData.available() != 0 && temp != -1) {
temp = theRadarData.readShort();
}
}
if (theRadarData.available() != 0 && graphicBlock == null) {
short temp = theRadarData.readShort();
while (theRadarData.available() != 0 && temp != -1) {
temp = theRadarData.readShort();
}
}
if (theRadarData.available() != 0 && tabularBlock == null) {
short temp = theRadarData.readShort();
while (theRadarData.available() != 0 && temp != -1) {
temp = theRadarData.readShort();
}
}
int lineLen = theRadarData.available();
if (lineLen > 0) {
byte[] buf = new byte[lineLen];
theRadarData.readFully(buf);
String temp = new String(buf);
// PSM is found in all products that have useful Site Adaptation
// Parameters. For this reason, we are dropping every other set of
// Site Adaptation Parameters.
if (temp.contains("PSM")) {
temp = temp.substring(temp.indexOf("PSM"));
} else {
temp = "";
}
return temp;
} else {
return "";
}
}
/**
*
* @return
@ -697,10 +656,6 @@ public class Level3BaseRadar {
return tabularBlock;
}
public String getAlphanumericValues() {
return alphanumericValues;
}
/**
* Goes through the radar header and reads in all the important fields.
*
@ -828,7 +783,6 @@ public class Level3BaseRadar {
symbologyBlock = readSymbologyBlock(symbologyBlockOffset);
graphicBlock = readGraphicBlock(graphicBlockOffset);
tabularBlock = readTabularBlock(tabularBlockOffset);
alphanumericValues = readAlphanumericAddOn();
}
if (tabularBlock != null) {

View file

@ -59,9 +59,9 @@ import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendDataPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendVolumeScanPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket.DMDAttributeIDs;
import com.raytheon.uf.common.dataplugin.radar.level3.DataLevelThreshold;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket.GFMAttributeIDs;
import com.raytheon.uf.common.dataplugin.radar.level3.DataLevelThreshold;
import com.raytheon.uf.common.dataplugin.radar.level3.GSMBlock.GSMMessage;
import com.raytheon.uf.common.dataplugin.radar.level3.GenericDataPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock;
@ -119,6 +119,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* 10/09/2007 465 randerso Updated to better represent level 3 data
* 20071129 472 jkorman Added IDecoderGettable interface.
* 03/04/2013 DCS51 zwang Handle MIGFA product
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
* </pre>
*
* @author bphillip
@ -1034,14 +1036,6 @@ public class RadarRecord extends PersistablePluginDataObject implements
return getStoredData().getGsmMessage();
}
public String getAlphanumericValues() {
return getStoredData().getAlphanumericValues();
}
public void setAlphanumericValues(String alphanumericValues) {
getStoredData().setAlphanumericValues(alphanumericValues);
}
public short getProductDependentValue(int value) {
return getProductDependentValues()[value];
}

View file

@ -41,6 +41,8 @@ import com.raytheon.uf.common.dataplugin.radar.util.RadarConstants.MapValues;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 29, 2011 bsteffen Initial creation
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
*
* </pre>
*
@ -65,8 +67,6 @@ public class RadarStoredData {
public static final String PRODUCT_VALS_ID = "ProductVals";
public static final String ALPHANUMERIC_ID = "AlphanumericValues";
public static final String TABULAR_ID = "Tabular";
public static final String DEPENDENT_VALS_ID = "DependentValues";
@ -95,8 +95,6 @@ public class RadarStoredData {
private Map<MapValues, Map<String, Map<MapValues, String>>> productVals = new HashMap<MapValues, Map<String, Map<MapValues, String>>>();
private String alphanumericValues;
private Map<MapValues, Map<MapValues, String>> mapRecordVals = new HashMap<MapValues, Map<MapValues, String>>();
private GSMMessage gsmMessage;
@ -170,14 +168,6 @@ public class RadarStoredData {
this.productVals = productVals;
}
public String getAlphanumericValues() {
return alphanumericValues;
}
public void setAlphanumericValues(String alphanumericValues) {
this.alphanumericValues = alphanumericValues;
}
public Map<MapValues, Map<MapValues, String>> getMapRecordVals() {
return mapRecordVals;
}

View file

@ -53,6 +53,8 @@ import com.raytheon.uf.common.serialization.SerializationException;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 21, 2011 mschenke Initial creation
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
*
* </pre>
*
@ -125,14 +127,6 @@ public class RadarDataRetriever {
SerializationType.Thrift).deserialize(bais);
radarData
.setProductVals((HashMap<RadarConstants.MapValues, Map<String, Map<RadarConstants.MapValues, String>>>) o);
} else if (record.getName().equals(
RadarStoredData.ALPHANUMERIC_ID)) {
ByteDataRecord byteData = (ByteDataRecord) record;
ByteArrayInputStream bais = new ByteArrayInputStream(
byteData.getByteData());
Object o = DynamicSerializationManager.getManager(
SerializationType.Thrift).deserialize(bais);
radarData.setAlphanumericValues((String) o);
} else if (record.getName().equals(
RadarStoredData.RECORD_VALS_ID)) {
ByteDataRecord byteData = (ByteDataRecord) record;

View file

@ -22,10 +22,10 @@ package com.raytheon.uf.common.dataplugin.radar.util;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.LinkedHashMap;
import org.geotools.referencing.GeodeticCalculator;
@ -36,6 +36,7 @@ import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket.DMDAttributeIDs;
import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock;
import com.raytheon.uf.common.dataplugin.radar.level3.Layer;
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.TextSymbolPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.generic.AreaComponent;
@ -55,6 +56,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* Aug 11, 2010 mnash Initial creation
* Dec 28, 2011 11705 gzhang Fix SCAN missing Rows error
* Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar
* HDF5.
*
* </pre>
*
@ -429,7 +432,26 @@ public class RadarRecordUtil {
public static Map<DHRValues, Double> getDHRValues(RadarRecord record) {
Map<DHRValues, Double> map = new HashMap<DHRValues, Double>();
String text = record.getAlphanumericValues();
String text = null;
SymbologyBlock sb = record.getSymbologyBlock();
if (sb != null) {
// According to the ICD the alphanumeric data for DHR can be found
// in the second layer of the symbology block in a TextSymbolPacketn
// with code 1.
for (Layer layer : sb.getLayers()) {
for (SymbologyPacket packet : layer.getPackets()) {
if (packet instanceof TextSymbolPacket) {
TextSymbolPacket tsp = (TextSymbolPacket) packet;
if (tsp.getTheText().contains("PSM")) {
text = tsp.getTheText();
}
}
}
}
}
if (text == null) {
return map;
}
int vi = 0;
int nv = text.length() / 8;
int precipCat = 0;

View file

@ -71,9 +71,6 @@ public class DefaultVizRadarRecord extends VizRadarRecord {
if (object.getRawShortData() != null) {
size += object.getRawData().length * 2;
}
if (object.getAlphanumericValues() != null) {
size += object.getAlphanumericValues().length() * 2;
}
if (object.getAngleData() != null) {
size += object.getAngleData().length * 4;
}