NEXRCOMP added into new satellite.gini decoder restructure for 14.4.1

Former-commit-id: 8604678a0b
This commit is contained in:
mjames-upc 2015-03-09 16:45:57 -06:00
parent c30abec01b
commit 148d9664ca
7 changed files with 61 additions and 15 deletions

View file

@ -97,6 +97,7 @@ import com.raytheon.uf.edex.plugin.satellite.gini.lookup.NumericLookupTable;
* Nov 04, 2014 2714 bclement moved from satellite to satellite.gini * Nov 04, 2014 2714 bclement moved from satellite to satellite.gini
* renamed from SatelliteDecoder to GiniDecoder * renamed from SatelliteDecoder to GiniDecoder
* replaced database lookups with in memory tables * replaced database lookups with in memory tables
* Mar 06, 2015 mjames Added support for UCAR NEXRCOMP GINI images
* *
* </pre> * </pre>
* *
@ -115,6 +116,10 @@ public class GiniSatelliteDecoder {
private static final int GINI_HEADER_SIZE = 512; private static final int GINI_HEADER_SIZE = 512;
private static final int UCAR = 99;
private static final int UCAR_PRODUCT_OFFSET = 100;
private static final int INITIAL_READ = GINI_HEADER_SIZE + 128; private static final int INITIAL_READ = GINI_HEADER_SIZE + 128;
private final IPerformanceStatusHandler perfLog = PerformanceStatus private final IPerformanceStatusHandler perfLog = PerformanceStatus
@ -277,15 +282,6 @@ public class GiniSatelliteDecoder {
// get the scanning mode // get the scanning mode
int scanMode = byteBuffer.get(37); int scanMode = byteBuffer.get(37);
// read the source
byte sourceByte = byteBuffer.get(0);
String source = sourceTable.lookup(sourceByte);
if (source == null) {
throw new UnrecognizedDataException(
"Unknown satellite source id: " + sourceByte);
}
record.setSource(source);
// read the creating entity // read the creating entity
byte entityByte = byteBuffer.get(1); byte entityByte = byteBuffer.get(1);
String entity = creatingEntityTable.lookup(entityByte); String entity = creatingEntityTable.lookup(entityByte);
@ -294,9 +290,20 @@ public class GiniSatelliteDecoder {
"Unknown satellite entity id: " + entityByte); "Unknown satellite entity id: " + entityByte);
} }
record.setCreatingEntity(entity); record.setCreatingEntity(entity);
// read the source
byte sourceByte = byteBuffer.get(0);
if (entityByte == UCAR) sourceByte = (byte) (UCAR_PRODUCT_OFFSET+byteBuffer.get(0));
String source = sourceTable.lookup(sourceByte);
if (source == null) {
throw new UnrecognizedDataException(
"Unknown satellite source id: " + sourceByte);
}
record.setSource(source);
// read the sector ID // read the sector ID
byte sectorByte = byteBuffer.get(2); byte sectorByte = byteBuffer.get(2);
if (entityByte == UCAR) sectorByte = (byte) (UCAR_PRODUCT_OFFSET+byteBuffer.get(2));
String sector = sectorIdTable.lookup(sectorByte); String sector = sectorIdTable.lookup(sectorByte);
if (sector == null) { if (sector == null) {
throw new UnrecognizedDataException( throw new UnrecognizedDataException(
@ -305,7 +312,8 @@ public class GiniSatelliteDecoder {
record.setSectorID(sector); record.setSectorID(sector);
// read the physical element // read the physical element
byte physByte = byteBuffer.get(3); int physByte = byteBuffer.get(3);
if (entityByte == UCAR) physByte = (int) (UCAR_PRODUCT_OFFSET+byteBuffer.get(3));
String physElem = physicalElementTable.lookup(physByte); String physElem = physicalElementTable.lookup(physByte);
if (physElem == null) { if (physElem == null) {
throw new UnrecognizedDataException( throw new UnrecognizedDataException(
@ -316,12 +324,18 @@ public class GiniSatelliteDecoder {
// read the units // read the units
String unit = unitTable.lookup(byteBuffer.get(3)); String unit = unitTable.lookup(byteBuffer.get(3));
if (entityByte == UCAR) {
unit = unitTable.lookup((int) (UCAR_PRODUCT_OFFSET+byteBuffer.get(3)));
}
if (unit != null) { if (unit != null) {
record.setUnits(unit); record.setUnits(unit);
} }
// read the century // read the century
intValue = 1900 + byteBuffer.get(8); intValue = 1900 + byteBuffer.get(8);
// correction for pngg2gini
if (entityByte == UCAR && byteBuffer.get(8) < 100)
intValue = 2000 + byteBuffer.get(8);
calendar.set(Calendar.YEAR, intValue); calendar.set(Calendar.YEAR, intValue);
// read the month of the year // read the month of the year

View file

@ -31,4 +31,5 @@
Cell: (301) 787-9925 Cell: (301) 787-9925
--> -->
<regex>TI[CGT]... ....</regex> <regex>TI[CGT]... ....</regex>
<regex>.*NEXRCOMP.*</regex>
</requestPatterns> </requestPatterns>

View file

@ -40,4 +40,5 @@
<entry index="27" value="NOAA17" /> <entry index="27" value="NOAA17" />
<entry index="28" value="NOAA18" /> <entry index="28" value="NOAA18" />
<entry index="29" value="NOAA19" /> <entry index="29" value="NOAA19" />
</numericLookupTable> <entry index="99" value="NEXRCOMP" />
</numericLookupTable>

View file

@ -83,4 +83,18 @@
<entry index="62" value="Polar 3.9u" /> <entry index="62" value="Polar 3.9u" />
<entry index="63" value="Polar 3.7u" /> <entry index="63" value="Polar 3.7u" />
<entry index="64" value="Polar IR" /> <entry index="64" value="Polar IR" />
</numericLookupTable> <entry index="118" value="OHA" />
<entry index="119" value="DSP" />
<entry index="120" value="DTA" />
<entry index="121" value="DAA" />
<entry index="122" value="N0C" />
<entry index="123" value="N0X" />
<entry index="124" value="N0Q" />
<entry index="125" value="HHC" />
<entry index="126" value="EET" />
<entry index="127" value="N0R" />
<entry index="128" value="DHR" />
<entry index="129" value="DVL" />
<entry index="130" value="N1P" />
<entry index="131" value="NTP" />
</numericLookupTable>

View file

@ -30,4 +30,5 @@
<entry index="8" value="Puerto Rico National" /> <entry index="8" value="Puerto Rico National" />
<entry index="9" value="Supernational" /> <entry index="9" value="Supernational" />
<entry index="10" value="NH Composite - Meteosat-GOES E-GOES W-GMS" /> <entry index="10" value="NH Composite - Meteosat-GOES E-GOES W-GMS" />
</numericLookupTable> <entry index="101" value="CONUS" />
</numericLookupTable>

View file

@ -20,4 +20,5 @@
--> -->
<numericLookupTable id="sources"> <numericLookupTable id="sources">
<entry index="1" value="NESDIS" /> <entry index="1" value="NESDIS" />
</numericLookupTable> <entry index="101" value="UCAR" />
</numericLookupTable>

View file

@ -36,4 +36,18 @@
<entry index="57" value="IRPixel" /> <entry index="57" value="IRPixel" />
<entry index="60" value="PercentOfNormalTPWPixel" /> <entry index="60" value="PercentOfNormalTPWPixel" />
<entry index="64" value="IRPixel" /> <entry index="64" value="IRPixel" />
</numericLookupTable> <entry index="118" value="IRPixel" />
<entry index="119" value="IRPixel" />
<entry index="120" value="IRPixel" />
<entry index="121" value="IRPixel" />
<entry index="122" value="IRPixel" />
<entry index="123" value="IRPixel" />
<entry index="124" value="IRPixel" />
<entry index="125" value="IRPixel" />
<entry index="126" value="IRPixel" />
<entry index="127" value="IRPixel" />
<entry index="128" value="IRPixel" />
<entry index="129" value="IRPixel" />
<entry index="130" value="IRPixel" />
<entry index="131" value="IRPixel" />
</numericLookupTable>