index shift for physical element to retain byte type
Former-commit-id: 2efecc8347
This commit is contained in:
parent
8c6594a26c
commit
a3472e4ae4
2 changed files with 20 additions and 18 deletions
|
@ -81,18 +81,18 @@ INSERT INTO awips.satellite_physical_elements VALUES (61,'Polar Vis');
|
|||
INSERT INTO awips.satellite_physical_elements VALUES (62,'Polar 3.9u');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (63,'Polar 3.7u');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (64,'Polar IR');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (68,'OHA One Hour Precipitation');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (69,'DSP Storm Total Precipitation');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (70,'DTA Storm Total Precipitation');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (68,'OHA');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (69,'DSP');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (70,'DTA');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (71,'DAA');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (72,'N0C');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (73,'N0X');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (74,'N0Q 265-level Level 1 Base Reflectivity');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (75,'HHC Hybrid Hydrometeor Classification');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (76,'EET Enhanced Echo Tops');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (77,'N0R 16-level Base Reflectivity');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (78,'DHR Digital Hybrid Reflectivity');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (79,'DVL Digital VIL');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (80,'N1P One Hour Precipitation');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (81,'NTP Storm Total Precipitation');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (74,'N0Q');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (75,'HHC');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (76,'EET');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (77,'N0R');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (78,'DHR');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (79,'DVL');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (80,'N1P');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (81,'NTP');
|
||||
INSERT INTO awips.satellite_physical_elements VALUES (82,'WTF');
|
||||
|
|
|
@ -109,6 +109,8 @@ public class SatelliteDecoder {
|
|||
private static final String SAT_HDR_TT = "TI";
|
||||
|
||||
private static final int GINI_HEADER_SIZE = 512;
|
||||
|
||||
private static final int UCAR = 99;
|
||||
|
||||
private static final int INITIAL_READ = GINI_HEADER_SIZE + 128;
|
||||
|
||||
|
@ -192,7 +194,7 @@ public class SatelliteDecoder {
|
|||
|
||||
// read the source
|
||||
byte sourceByte = byteBuffer.get(0);
|
||||
if (entityByte == 99) sourceByte = (byte) (100+byteBuffer.get(0));
|
||||
if (entityByte == UCAR) sourceByte = (byte) (100+byteBuffer.get(0));
|
||||
SatelliteSource source = dao.getSource(sourceByte);
|
||||
if (source == null) {
|
||||
throw new UnrecognizedDataException(
|
||||
|
@ -202,7 +204,7 @@ public class SatelliteDecoder {
|
|||
|
||||
// read the sector ID
|
||||
byte sectorByte = byteBuffer.get(2);
|
||||
if (entityByte == 99) sectorByte = (byte) (100+byteBuffer.get(2));
|
||||
if (entityByte == UCAR) sectorByte = (byte) (100+byteBuffer.get(2));
|
||||
SatelliteSectorId sector = dao.getSectorId(sectorByte);
|
||||
if (sector == null) {
|
||||
throw new UnrecognizedDataException(
|
||||
|
@ -216,7 +218,7 @@ public class SatelliteDecoder {
|
|||
* products start at 68 in satellite_physical_elements
|
||||
* - can't change to int, must keep it byte because of ISpatialEnabled in viz.rsc??
|
||||
*/
|
||||
if (entityByte == 99) physByte = (byte) (50+byteBuffer.get(3));
|
||||
if (entityByte == UCAR) physByte = (byte) (50+byteBuffer.get(3));
|
||||
|
||||
SatellitePhysicalElement physElem = dao
|
||||
.getPhysicalElement(physByte);
|
||||
|
@ -230,7 +232,7 @@ public class SatelliteDecoder {
|
|||
|
||||
// read the units
|
||||
SatelliteUnit unit = dao.getUnit(byteBuffer.get(3));
|
||||
if (entityByte == 99) {
|
||||
if (entityByte == UCAR) {
|
||||
unit = dao.getUnit((int) (100+byteBuffer.get(3)));
|
||||
}
|
||||
if (unit != null) {
|
||||
|
@ -239,9 +241,9 @@ public class SatelliteDecoder {
|
|||
|
||||
// read the century
|
||||
intValue = 1900 + byteBuffer.get(8);
|
||||
if (byteBuffer.get(8) < 100) {
|
||||
intValue = 2000 + byteBuffer.get(8);
|
||||
}
|
||||
// correction for pngg2gini
|
||||
if (entityByte == UCAR && byteBuffer.get(8) < 100)
|
||||
intValue = 2000 + byteBuffer.get(8);
|
||||
calendar.set(Calendar.YEAR, intValue);
|
||||
|
||||
// read the month of the year
|
||||
|
|
Loading…
Add table
Reference in a new issue