ASM #18361 - Some synoptic obs data not being decoded

Change-Id: I474a1c31787fb98f841ad20ddd5bccb2a9a1e0d9

Former-commit-id: a53d7f9691e47257915174556c97c6af139d1d52
This commit is contained in:
Melissa Porricel 2016-05-02 15:35:58 -04:00
parent 600d805bcb
commit 45c1f60ebb
6 changed files with 408 additions and 4 deletions

View file

@ -29,11 +29,17 @@
<parameter name="peakWindSpeedTime" numDims="1" type="LONG" unit="seconds since 1-1-1970" /> <parameter name="peakWindSpeedTime" numDims="1" type="LONG" unit="seconds since 1-1-1970" />
<parameter name="peakWindSpeed" numDims="1" type="FLOAT" unit="m/sec" /> <parameter name="peakWindSpeed" numDims="1" type="FLOAT" unit="m/sec" />
<parameter name="peakWindDir" numDims="1" type="FLOAT" unit="°" /> <parameter name="peakWindDir" numDims="1" type="FLOAT" unit="°" />
<parameter name="peakWindSpeedTimeOneMin" numDims="1" type="LONG" unit="seconds since 1-1-1970" />
<parameter name="peakWindSpeedOneMin" numDims="1" type="FLOAT" unit="m/sec" />
<parameter name="peakWindDirOneMin" numDims="1" type="FLOAT" unit="°" />
<parameter name="lowestPressure" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="lowestPressureTime" numDims="1" type="LONG" unit="seconds since 1-1-1970" />
<parameter name="seaLevelPress" numDims="1" type="FLOAT" unit="Pa" /> <parameter name="seaLevelPress" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="altimeter" numDims="1" type="FLOAT" unit="Pa" /> <parameter name="altimeter" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="stationPress" numDims="1" type="FLOAT" unit="Pa" /> <parameter name="stationPress" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="pressChangeChar" numDims="1" type="INT" /> <parameter name="pressChangeChar" numDims="1" type="INT" />
<parameter name="pressChange3Hour" numDims="1" type="FLOAT" unit="Pa" /> <parameter name="pressChange3Hour" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="pressChange24Hour" numDims="1" type="FLOAT" unit="Pa" />
<parameter name="totCloudAmount" numDims="1" type="INT" /> <parameter name="totCloudAmount" numDims="1" type="INT" />
<parameter name="lowCloudHeight" numDims="1" type="INT" unit="m" /> <parameter name="lowCloudHeight" numDims="1" type="INT" unit="m" />
<parameter name="lowCloudAmount" numDims="1" type="INT" /> <parameter name="lowCloudAmount" numDims="1" type="INT" />
@ -46,10 +52,13 @@
<parameter name="wx_past_1" numDims="1" type="INT" /> <parameter name="wx_past_1" numDims="1" type="INT" />
<parameter name="wx_past_2" numDims="1" type="INT" /> <parameter name="wx_past_2" numDims="1" type="INT" />
<parameter name="precip1Hour" numDims="1" type="FLOAT" unit="mm" /> <parameter name="precip1Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="precip3Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="precip6Hour" numDims="1" type="FLOAT" unit="mm" /> <parameter name="precip6Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="precip12Hour" numDims="1" type="FLOAT" unit="mm" /> <parameter name="precip12Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="precip18Hour" numDims="1" type="FLOAT" unit="mm" /> <parameter name="precip18Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="precip24Hour" numDims="1" type="FLOAT" unit="mm" /> <parameter name="precip24Hour" numDims="1" type="FLOAT" unit="mm" />
<parameter name="snowDepth" numDims="1" type="FLOAT" unit="mm" />
<parameter name="stateOfGroundWithSnow" numDims="1" type="INT" />
<parameter name="equivWindSpeed10m" numDims="1" type="FLOAT" unit="m/sec" /> <parameter name="equivWindSpeed10m" numDims="1" type="FLOAT" unit="m/sec" />
<parameter name="equivWindSpeed20m" numDims="1" type="FLOAT" unit="m/sec" /> <parameter name="equivWindSpeed20m" numDims="1" type="FLOAT" unit="m/sec" />
<parameter name="iceCode" numDims="1" type="INT" /> <parameter name="iceCode" numDims="1" type="INT" />

View file

@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip; import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip;
import com.raytheon.uf.common.dataplugin.sfcobs.AncPressure;
import com.raytheon.uf.common.dataplugin.sfcobs.InterWinds; import com.raytheon.uf.common.dataplugin.sfcobs.InterWinds;
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon; import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataContainer;
@ -54,6 +55,8 @@ import com.raytheon.uf.common.serialization.SerializationException;
* Apr 04, 2014 2906 bclement made getDescription() and static constants public * Apr 04, 2014 2906 bclement made getDescription() and static constants public
* Apr 22, 2014 2906 bclement removed WMO header, timeObs and timeNominal from HDF5 (times still in DB) * Apr 22, 2014 2906 bclement removed WMO header, timeObs and timeNominal from HDF5 (times still in DB)
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J * Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* Apr 20, 2016 DR18361 MPorricelli Added snowDepth, 24hour pressure change, 3hr precip,
* 1-minute peak wind, lowest pressure
* *
* </pre> * </pre>
* *
@ -105,8 +108,12 @@ public class SfcObsPointDataTransform {
public static final String PRESS_CHANGE_CHAR = "pressChangeChar"; public static final String PRESS_CHANGE_CHAR = "pressChangeChar";
public static final String PRESS_CHANGE_24HR = "pressChange24Hour";
public static final String PRECIP1_HOUR = "precip1Hour"; public static final String PRECIP1_HOUR = "precip1Hour";
public static final String PRECIP3_HOUR = "precip3Hour";
public static final String PRECIP6_HOUR = "precip6Hour"; public static final String PRECIP6_HOUR = "precip6Hour";
public static final String PRECIP12_HOUR = "precip12Hour"; public static final String PRECIP12_HOUR = "precip12Hour";
@ -115,6 +122,10 @@ public class SfcObsPointDataTransform {
public static final String PRECIP24_HOUR = "precip24Hour"; public static final String PRECIP24_HOUR = "precip24Hour";
public static final String SNOW_DEPTH = "snowDepth";
public static final String STATE_OF_GROUND_WITH_SNOW = "stateOfGroundWithSnow";
public static final String TEMPERATURE = "temperature"; public static final String TEMPERATURE = "temperature";
public static final String DEWPOINT = "dewpoint"; public static final String DEWPOINT = "dewpoint";
@ -131,6 +142,16 @@ public class SfcObsPointDataTransform {
public static final String PEAK_WIND_SPEED_TIME = "peakWindSpeedTime"; public static final String PEAK_WIND_SPEED_TIME = "peakWindSpeedTime";
public static final String PEAK_WIND_DIR_1MIN = "peakWindDirOneMin";
public static final String PEAK_WIND_SPEED_1MIN = "peakWindSpeedOneMin";
public static final String PEAK_WIND_SPEED_TIME_1MIN = "peakWindSpeedTimeOneMin";
public static final String LOWEST_PRESSURE = "lowestPressure";
public static final String LOWEST_PRESSURE_TIME = "lowestPressureTime";
public static final String SEA_LEVEL_PRESS = "seaLevelPress"; public static final String SEA_LEVEL_PRESS = "seaLevelPress";
public static final String ALTIMETER = "altimeter"; public static final String ALTIMETER = "altimeter";
@ -238,11 +259,18 @@ public class SfcObsPointDataTransform {
sb.append("peakWindDir,"); sb.append("peakWindDir,");
sb.append("peakWindSpeed,"); sb.append("peakWindSpeed,");
sb.append("peakWindSpeedTimeOneMin,");
sb.append("peakWindDirOneMin,");
sb.append("peakWindSpeedOneMin,");
sb.append("lowestPressure,");
sb.append("lowestPressureTime,");
sb.append("seaLevelPress,"); sb.append("seaLevelPress,");
sb.append("altimeter,"); sb.append("altimeter,");
sb.append("stationPress,"); sb.append("stationPress,");
sb.append("pressChangeChar,"); sb.append("pressChangeChar,");
sb.append("pressChange3Hour,"); sb.append("pressChange3Hour,");
sb.append("pressChange24Hour,");
sb.append("visibility,"); sb.append("visibility,");
sb.append("wx_past_1,"); sb.append("wx_past_1,");
@ -259,10 +287,14 @@ public class SfcObsPointDataTransform {
sb.append("precip1Hour,"); sb.append("precip1Hour,");
sb.append("precip6Hour,"); sb.append("precip6Hour,");
sb.append("precip3Hour,");
sb.append("precip12Hour,"); sb.append("precip12Hour,");
sb.append("precip18Hour,"); sb.append("precip18Hour,");
sb.append("precip24Hour,"); sb.append("precip24Hour,");
sb.append("snowDepth,");
sb.append("stateOfGroundWithSnow,");
sb.append("equivWindSpeed10m,"); sb.append("equivWindSpeed10m,");
sb.append("equivWindSpeed20m,"); sb.append("equivWindSpeed20m,");
@ -382,6 +414,12 @@ public class SfcObsPointDataTransform {
pdv.setFloat(PEAK_WIND_SPEED, getFloat(record.getPeakWindSpeed())); pdv.setFloat(PEAK_WIND_SPEED, getFloat(record.getPeakWindSpeed()));
pdv.setLong(PEAK_WIND_SPEED_TIME, record.getPeakWindTime()); pdv.setLong(PEAK_WIND_SPEED_TIME, record.getPeakWindTime());
pdv.setFloat(PEAK_WIND_DIR, getFloat(record.getPeakWindDir())); pdv.setFloat(PEAK_WIND_DIR, getFloat(record.getPeakWindDir()));
pdv.setFloat(PEAK_WIND_SPEED_1MIN, getFloat(record.getPeakWindSpeedOneMin()));
pdv.setLong(PEAK_WIND_SPEED_TIME_1MIN, record.getPeakWindTimeOneMin());
pdv.setFloat(PEAK_WIND_DIR_1MIN, getFloat(record.getPeakWindDirOneMin()));
pdv.setFloat(LOWEST_PRESSURE, getFloat(record.getLowestPressure()));
pdv.setLong(LOWEST_PRESSURE_TIME, record.getLowestPressureTime());
pdv.setFloat(SEA_LEVEL_PRESS, pdv.setFloat(SEA_LEVEL_PRESS,
getFloat(record.getPressureSealevel())); getFloat(record.getPressureSealevel()));
@ -445,6 +483,10 @@ public class SfcObsPointDataTransform {
pdv.setFloat(PRECIP1_HOUR, v); pdv.setFloat(PRECIP1_HOUR, v);
break; break;
} }
case 10800: {
pdv.setFloat(PRECIP3_HOUR, v);
break;
}
case 21600: { case 21600: {
pdv.setFloat(PRECIP6_HOUR, v); pdv.setFloat(PRECIP6_HOUR, v);
break; break;
@ -464,8 +506,22 @@ public class SfcObsPointDataTransform {
} // switch } // switch
} // for } // for
} }
} pdv.setFloat(SNOW_DEPTH,
getFloat(record.getSnowDepth()));
pdv.setFloat(STATE_OF_GROUND_WITH_SNOW,
getFloat(record.getStateOfGroundWithSnow()));
List<AncPressure> pressure = record.getAncPressure();
if ((pressure != null) && (pressure.size() > 0)) {
for (AncPressure press : pressure) {
float pressValue = press.getValue().floatValue();
if (press.getTimePeriod() == 86400) {
pdv.setFloat(PRESS_CHANGE_24HR, pressValue);
}
}
}
}
int idx = 0; int idx = 0;
List<InterWinds> winds = record.getInterWinds(); List<InterWinds> winds = record.getInterWinds();
if ((winds != null) && (winds.size() > 0)) { if ((winds != null) && (winds.size() > 0)) {
@ -522,6 +578,12 @@ public class SfcObsPointDataTransform {
obs.setPeakWindSpeed(pdv.getNumber(PEAK_WIND_SPEED).doubleValue()); obs.setPeakWindSpeed(pdv.getNumber(PEAK_WIND_SPEED).doubleValue());
obs.setPeakWindTime(pdv.getNumber(PEAK_WIND_SPEED_TIME).longValue()); obs.setPeakWindTime(pdv.getNumber(PEAK_WIND_SPEED_TIME).longValue());
obs.setPeakWindDir(pdv.getNumber(PEAK_WIND_DIR).intValue()); obs.setPeakWindDir(pdv.getNumber(PEAK_WIND_DIR).intValue());
obs.setPeakWindSpeedOneMin(pdv.getNumber(PEAK_WIND_SPEED_1MIN).doubleValue());
obs.setPeakWindTimeOneMin(pdv.getNumber(PEAK_WIND_SPEED_TIME_1MIN).longValue());
obs.setPeakWindDirOneMin(pdv.getNumber(PEAK_WIND_DIR_1MIN).intValue());
obs.setLowestPressure(pdv.getNumber(LOWEST_PRESSURE).intValue());
obs.setLowestPressureTime(pdv.getNumber(LOWEST_PRESSURE_TIME).longValue());
obs.setPressureSealevel(pdv.getNumber(SEA_LEVEL_PRESS).intValue()); obs.setPressureSealevel(pdv.getNumber(SEA_LEVEL_PRESS).intValue());
obs.setPressureAltimeter(pdv.getNumber(ALTIMETER).intValue()); obs.setPressureAltimeter(pdv.getNumber(ALTIMETER).intValue());
@ -573,6 +635,9 @@ public class SfcObsPointDataTransform {
.intValue()); .intValue());
obs.setSecondarySwellWaveHeight(pdv.getNumber(SEC_SWELL_WV_HGT) obs.setSecondarySwellWaveHeight(pdv.getNumber(SEC_SWELL_WV_HGT)
.doubleValue()); .doubleValue());
obs.setSnowDepth(pdv.getNumber(SNOW_DEPTH).doubleValue());
obs.setStateOfGroundWithSnow(pdv.getNumber(STATE_OF_GROUND_WITH_SNOW).intValue());
// TODO : Intermediate winds // TODO : Intermediate winds
} }

View file

@ -59,6 +59,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
* Sep 30, 2014 #3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} * Sep 30, 2014 #3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()}
* calls, added HUMIDITY_PATTERN. * calls, added HUMIDITY_PATTERN.
* May 26, 2015 #4525 mapeters Fix pressure unit conversion. * May 26, 2015 #4525 mapeters Fix pressure unit conversion.
* Apr 20, 2016 DR18361 MPorricelli Added decoding of snowDepth
* *
* </pre> * </pre>
* *
@ -356,6 +357,22 @@ public class SynopticGroups {
return decodedItem; return decodedItem;
} }
public static DataItem decodeSnowDepth(String groupData,
int lookingForSect) {
DataItem decodedItem = null;
if ((groupData != null) && (groupData.length() == 5)) {
if ((groupData.charAt(0) == '4') && (lookingForSect == 3)) {
Integer val = AbstractSfcObsDecoder.getInt(groupData, 2, 5);
if ((val != null) && (val >= 0) && (val < 997)) {
decodedItem = new DataItem("snowDepth");
decodedItem.setDataValue((double)val * 10);
}
}
}
return decodedItem;
}
/** /**
* Get the value of the sign character. 0 = positive, 1 = negative; * Get the value of the sign character. 0 = positive, 1 = negative;
* *

View file

@ -62,6 +62,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
* Sep 30, 2014 3629 mapeters Conformed to changes in ISynoptic constants. * Sep 30, 2014 3629 mapeters Conformed to changes in ISynoptic constants.
* May 26, 2015 4525 mapeters Fix pressure unit conversion. * May 26, 2015 4525 mapeters Fix pressure unit conversion.
* Dec 17, 2015 5166 kbisanz Update logging to use SLF4J * Dec 17, 2015 5166 kbisanz Update logging to use SLF4J
* Apr 20, 2016 DR18361 MPorricelli Added decoding of snowDepth
* *
* </pre> * </pre>
* *
@ -99,6 +100,10 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
private Double windGust912 = null; private Double windGust912 = null;
private DataItem snowDepth = null;
private Integer stateOfGroundWithSnow = -9999;
private static final UnitConverter daPaToPa = SI.DEKA(SI.PASCAL) private static final UnitConverter daPaToPa = SI.DEKA(SI.PASCAL)
.getConverterTo(SI.PASCAL); .getConverterTo(SI.PASCAL);
@ -164,6 +169,8 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
// jjj regional data // jjj regional data
closeGroup(3); closeGroup(3);
} else if ("4".equals(element.substring(0, 1)) && doGroup(4)) { } else if ("4".equals(element.substring(0, 1)) && doGroup(4)) {
stateOfGroundWithSnow = AbstractSfcObsDecoder.getInt(element, 1, 2);
snowDepth = SynopticGroups.decodeSnowDepth(element, 3);
closeGroup(4); closeGroup(4);
} else if (P589.matcher(element).find() && doGroup(5)) { } else if (P589.matcher(element).find() && doGroup(5)) {
int sign = 0; int sign = 0;
@ -274,7 +281,12 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
receiver.addPressure(press); receiver.addPressure(press);
} }
} }
if (snowDepth != null) {
receiver.setSnowDepth(snowDepth.getDataValue());
}
if ((stateOfGroundWithSnow != null) && (stateOfGroundWithSnow >= -9999)) {
receiver.setStateOfGroundWithSnow(stateOfGroundWithSnow);
}
// Use the 10 minute gust data if present // Use the 10 minute gust data if present
if (windGust910 != null) { if (windGust910 != null) {
receiver.setWindGust(windGust910); receiver.setWindGust(windGust910);

View file

@ -58,6 +58,8 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
* updated deprecated {@link TimeTools} usage.\ * updated deprecated {@link TimeTools} usage.\
* Sep 30, 2014 #3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()} * Sep 30, 2014 #3629 mapeters Replaced {@link AbstractSfcObsDecoder#matchElement()}
* calls, added Pattern constants. * calls, added Pattern constants.
* Apr 20, 2016 DR18361 MPorricelli Added decoding of 1-minute peak wind and lowest
* pressure data
* *
* </pre> * </pre>
* *
@ -78,6 +80,8 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
private static final Pattern PEAK_WIND_4 = Pattern.compile("4[/0-9]{4}"); private static final Pattern PEAK_WIND_4 = Pattern.compile("4[/0-9]{4}");
private static final Pattern LOWEST_PRESS_PREV_HOUR = Pattern.compile("5[/0-9]{4}");
private static final Pattern CONT_WIND_SPEED = Pattern.compile("6[/0-9]{4}"); private static final Pattern CONT_WIND_SPEED = Pattern.compile("6[/0-9]{4}");
private static final Pattern CONT_WIND_SPEED_INTERNAL = Pattern private static final Pattern CONT_WIND_SPEED_INTERNAL = Pattern
@ -85,9 +89,20 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
private static final Pattern TIDE = Pattern.compile("TIDE[/0-9]{4}"); private static final Pattern TIDE = Pattern.compile("TIDE[/0-9]{4}");
private static final Pattern LOW_PRESS_TIME = Pattern.compile("7[/0-9]{4}");
private static final Pattern CMAN_PEAK_WIND_1_MIN = Pattern.compile("8[/0-9]{5}");
private static final Pattern PEAK_WIND_1_MIN = Pattern.compile("8[/0-9]{4}");
private static final Pattern PEAK_WIND_1_MIN_TIME = Pattern.compile("9[/0-9]{4}");
private static final UnitConverter knotsToMSec = NonSI.KNOT private static final UnitConverter knotsToMSec = NonSI.KNOT
.getConverterTo(SI.METERS_PER_SECOND); .getConverterTo(SI.METERS_PER_SECOND);
private static final UnitConverter daPaToPa = SI.DEKA(SI.PASCAL)
.getConverterTo(SI.PASCAL);
private static final int NUM_WINDS = 6; private static final int NUM_WINDS = 6;
private Double wind10mSpeed = null; private Double wind10mSpeed = null;
@ -102,6 +117,22 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
private Double pkWindSpeed = null; private Double pkWindSpeed = null;
private Integer pkWindTimeHourOneMin = null;
private Integer pkWindTimeMinuteOneMin = null;
private Integer pkWindDirectionOneMin = null;
private Double pkWindSpeedOneMin = null;
private Boolean pkWindSpeedOneMinInKnots = false;
private Double lowestPressure = null;
private Integer lowestPressureTimeHour = null;
private Integer lowestPressureTimeMinute = null;
private Integer windTimeHour = null; private Integer windTimeHour = null;
private Integer windTimeMinute = null; private Integer windTimeMinute = null;
@ -197,6 +228,19 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
pkWindSpeed = spd.doubleValue(); pkWindSpeed = spd.doubleValue();
} }
closeGroup(4); closeGroup(4);
} else if (doGroup(5)
&& LOWEST_PRESS_PREV_HOUR.matcher(element).find()) {
// 5plplplpl plplplpl is the lowest pressure during the previous hour, in tenths of hPa.
// This group shall only be reported when the pressure is less than 1009 hPa. Otherwise,
// the group will be missing. When pressure exceeds 1000 hPa, the leading "1" will be dropped.
// For example, 1004.2 hPa will be coded as 50042.
Integer press = AbstractSfcObsDecoder.getInt(element, 1, 5);
if (press < 1000) {
lowestPressure = daPaToPa.convert((double)press + 10000);
} else {
lowestPressure = daPaToPa.convert((double)press);
}
closeGroup(5);
} else if (doGroup(6) } else if (doGroup(6)
&& CONT_WIND_SPEED.matcher(element).find()) { && CONT_WIND_SPEED.matcher(element).find()) {
// Continuous wind speed data // Continuous wind speed data
@ -231,6 +275,50 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
} }
} }
closeGroup(6); closeGroup(6);
} else if (doGroup(7) && LOW_PRESS_TIME.matcher(element).find()) {
// 7hhmm hhmm is the hour and minute (UTC) of the lowest pressure during the previous hour
lowestPressureTimeHour = AbstractSfcObsDecoder
.getInt(element, 1, 3);
lowestPressureTimeMinute = AbstractSfcObsDecoder.getInt(element, 3,
5);
closeGroup(7);
} else if (doGroup(8)
&& CMAN_PEAK_WIND_1_MIN.matcher(element).find()) {
// 8ddff or 8ddfff dd is true direction, in tens of degrees, from which the highest
// peak one minute wind during the previous hour was blowing. For fixed buoys, ff is the
// associated speed, in units indicated by iSubw. For C-MAN reports, fff is the associated
// speed in knots.
pkWindDirectionOneMin = AbstractSfcObsDecoder.getInt(element, 1, 3);
if ((pkWindDirectionOneMin != null) && (pkWindDirectionOneMin >= 0)) {
pkWindDirectionOneMin *= 10;
}
Integer spd = AbstractSfcObsDecoder.getInt(element, 3, 6);
if ((spd != null) && (spd >= 0)) {
pkWindSpeedOneMin = spd.doubleValue();
}
pkWindSpeedOneMinInKnots = true;
closeGroup(8);
} else if (doGroup(8) && PEAK_WIND_1_MIN.matcher(element).find()) {
// 8ddff or 8ddfff dd is true direction, in tens of degrees, from which the highest
// peak one minute wind during the previous hour was blowing. For fixed buoys, ff is the
// associated speed, in units indicated by iSubw.
pkWindDirectionOneMin = AbstractSfcObsDecoder.getInt(element, 1, 3);
if ((pkWindDirectionOneMin != null) && (pkWindDirectionOneMin >= 0)) {
pkWindDirectionOneMin *= 10;
}
Integer spd = AbstractSfcObsDecoder.getInt(element, 3, 5);
if ((spd != null) && (spd >= 0)) {
pkWindSpeedOneMin = spd.doubleValue();
}
closeGroup(8);
} else if (doGroup(9) && PEAK_WIND_1_MIN_TIME.matcher(element).find()) {
// 9hhmm hhmm is the hour and minute (UTC) of the highest peak one-minute wind
// during the previous hour
pkWindTimeHourOneMin = AbstractSfcObsDecoder
.getInt(element, 1, 3);
pkWindTimeMinuteOneMin = AbstractSfcObsDecoder.getInt(element, 3,
5);
closeGroup(9);
} else if (TIDE.matcher(element).find()) { } else if (TIDE.matcher(element).find()) {
// Tidal data in feet. // Tidal data in feet.
@ -249,8 +337,13 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
pkWindTimeMinute = null; pkWindTimeMinute = null;
pkWindDirection = -9999; pkWindDirection = -9999;
pkWindSpeed = -9999.0; pkWindSpeed = -9999.0;
pkWindTimeHourOneMin = null;
pkWindTimeMinuteOneMin = null;
pkWindDirectionOneMin = -9999;
pkWindSpeedOneMin = -9999.0;
windSpeeds = null; windSpeeds = null;
windDirs = null; windDirs = null;
pkWindSpeedOneMinInKnots = false;
} }
/** /**
@ -311,6 +404,36 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
receiver.setPeakWindSpeed(wSpeed); receiver.setPeakWindSpeed(wSpeed);
receiver.setPeakWindTime(newT.getTimeInMillis()); receiver.setPeakWindTime(newT.getTimeInMillis());
} }
// One-minute peak wind data
if ((pkWindTimeHourOneMin != null) && (pkWindTimeMinuteOneMin != null)) {
Calendar obsT = receiver.getTimeObs();
Integer year = getParent().getHeader().getYear();
if (year == -1) {
year = null;
}
Integer month = getParent().getHeader().getMonth();
if (month == -1) {
month = null;
}
Calendar newT = AbstractSynopticDecoder.calculateObsDateTime(
obsT, obsT.get(Calendar.DAY_OF_MONTH), pkWindTimeHourOneMin,
year, month);
newT.set(Calendar.MINUTE, pkWindTimeMinuteOneMin);
// Now do we have valid speed and direction
if (pkWindDirectionOneMin != null) {
receiver.setPeakWindDirOneMin(pkWindDirectionOneMin);
}
wSpeed = pkWindSpeedOneMin;
if (wSpeed > -9999) {
if (inKnots || pkWindSpeedOneMinInKnots) {
wSpeed = knotsToMSec.convert(wSpeed);
}
}
receiver.setPeakWindSpeedOneMin(wSpeed);
receiver.setPeakWindTimeOneMin(newT.getTimeInMillis());
}
// 10 minutes observations. // 10 minutes observations.
if ((windSpeeds != null) && (windDirs != null)) { if ((windSpeeds != null) && (windDirs != null)) {
// Do we need to override the observation time // Do we need to override the observation time
@ -359,7 +482,28 @@ public class Sec5MaritimeDecoder extends SynopticSec5Decoder {
} // for } // for
} }
} }
// Lowest pressure data
if ((lowestPressureTimeHour != null) && (lowestPressureTimeMinute != null)) {
Calendar obsT = receiver.getTimeObs();
Integer year = getParent().getHeader().getYear();
if (year == -1) {
year = null;
}
Integer month = getParent().getHeader().getMonth();
if (month == -1) {
month = null;
}
Calendar newT = AbstractSynopticDecoder.calculateObsDateTime(
obsT, obsT.get(Calendar.DAY_OF_MONTH), lowestPressureTimeHour,
year, month);
newT.set(Calendar.MINUTE, lowestPressureTimeMinute);
if (lowestPressure != null) {
receiver.setLowestPressure(lowestPressure.intValue());
}
receiver.setLowestPressureTime(newT.getTimeInMillis());
}
} }
return receiver; return receiver;
} }

View file

@ -70,7 +70,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Jun 11, 2014 2061 bsteffen Remove IDecoderGettable * Jun 11, 2014 2061 bsteffen Remove IDecoderGettable
* Jul 27, 2015 4360 rferrel Named unique constraint. Made reportType and corIndicator non-nullable. * Jul 27, 2015 4360 rferrel Named unique constraint. Made reportType and corIndicator non-nullable.
* * Apr 20, 2016 DR18361 MPorricelli Added 1-min peak wind, snow depth, lowest pressure
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -204,6 +204,23 @@ public class ObsCommon extends PersistablePluginDataObject implements
@XmlElement @XmlElement
@DynamicSerializeElement @DynamicSerializeElement
private Long peakWindTime = -1L; private Long peakWindTime = -1L;
// Direction of the one-minute peak wind observation in angular degrees
@Transient
@XmlElement
@DynamicSerializeElement
private Integer peakWindDirOneMin = -9999;
// Speed of the one-minute peak wind observation in meters per second.
@Transient
@XmlElement
@DynamicSerializeElement
private Double peakWindSpeedOneMin = -9999.0;
// Time of the one-minute peak wind observation.
@Transient
@XmlElement
@DynamicSerializeElement
private Long peakWindTimeOneMin = -1L;
// The equivilent 10 meter wind speed in meters per second. // The equivilent 10 meter wind speed in meters per second.
@Transient @Transient
@ -223,6 +240,18 @@ public class ObsCommon extends PersistablePluginDataObject implements
@DynamicSerializeElement @DynamicSerializeElement
private Integer pressureAltimeter = -9999; private Integer pressureAltimeter = -9999;
// Lowest pressure in Pascals.
@Transient
@XmlElement
@DynamicSerializeElement
private Integer lowestPressure = -9999;
// Time of the lowest pressure.
@Transient
@XmlElement
@DynamicSerializeElement
private Long lowestPressureTime = -1L;
// Sea level pressure in Pascals. // Sea level pressure in Pascals.
@Transient @Transient
@XmlElement @XmlElement
@ -382,6 +411,18 @@ public class ObsCommon extends PersistablePluginDataObject implements
@DynamicSerializeElement @DynamicSerializeElement
private Double secondarySwellWaveHeight = -9999.0; private Double secondarySwellWaveHeight = -9999.0;
// Snow depth in mm
@Transient
@XmlElement
@DynamicSerializeElement
private Double snowDepth = -9999.0;
// State of ground (category)
@Transient
@XmlElement
@DynamicSerializeElement
private Integer stateOfGroundWithSnow = -9999;
@Transient @Transient
@XmlElement @XmlElement
@DynamicSerializeElement @DynamicSerializeElement
@ -704,6 +745,62 @@ public class ObsCommon extends PersistablePluginDataObject implements
public void setPeakWindTime(Long peakWindTime) { public void setPeakWindTime(Long peakWindTime) {
this.peakWindTime = peakWindTime; this.peakWindTime = peakWindTime;
} }
/**
* Get the direction of the one-minute peak wind observation.
*
* @return The direction of the one-minute peak wind observation in angular degrees
*/
public Integer getPeakWindDirOneMin() {
return peakWindDirOneMin;
}
/**
* Set the direction of the peak wind observation.
*
* @param peakWindDirOneMin
* The direction of the peak wind observation in angular degrees
*/
public void setPeakWindDirOneMin(Integer peakWindDirOneMin) {
this.peakWindDirOneMin = peakWindDirOneMin;
}
/**
* Get the speed of the one-minute peak wind observation.
*
* @return The speed of the one-minute peak wind observation in meters per second.
*/
public Double getPeakWindSpeedOneMin() {
return peakWindSpeedOneMin;
}
/**
* Set the speed of the one-minute peak wind observation.
*
* @param peakWindSpeedOneMin
* The speed of the one-minute peak wind observation in meters per second.
*/
public void setPeakWindSpeedOneMin(Double peakWindSpeedOneMin) {
this.peakWindSpeedOneMin = peakWindSpeedOneMin;
}
/**
* Set the time of the one-minute peak wind observation.
*
* @return The time of the one-minute peak wind observation (msecs from 1-1-1970).
*/
public Long getPeakWindTimeOneMin() {
return peakWindTimeOneMin;
}
/**
* Get the time of the one-minute peak wind observation.
*
* @param peakWindTimeOneMin
* The time of the one-minute peak wind observation (msecs from 1-1-1970).
*/
public void setPeakWindTimeOneMin(Long peakWindTimeOneMin) {
this.peakWindTimeOneMin = peakWindTimeOneMin;
}
/** /**
* Get the equivilent 10 meter wind speed. * Get the equivilent 10 meter wind speed.
@ -742,6 +839,40 @@ public class ObsCommon extends PersistablePluginDataObject implements
public void setWind20mSpeed(Double windSpeed) { public void setWind20mSpeed(Double windSpeed) {
this.wind20mSpeed = windSpeed; this.wind20mSpeed = windSpeed;
} }
/**
* Get the lowest pressure of previous hour.
*
* @return Lowest pressure in Pa
*/
public Integer getLowestPressure() {
return lowestPressure;
}
/**
* Set the lowest pressure of previous hour.
*
* @param lowestPressure
* The lowest pressure in Pa
*/
public void setLowestPressure(Integer lowestPressure) {
this.lowestPressure = lowestPressure;
}
/**
* Get observation time of the lowest pressure of previous hour.
*
* @return Time of the lowest pressure (msecs from 1-1-1970)
*/
public Long getLowestPressureTime() {
return lowestPressureTime;
}
/**
* Set the observation time of the lowest pressure.
*
* @param lowestPressureTime
* The time of the lowest pressure observation (msecs from 1-1-1970).
*/
public void setLowestPressureTime(Long lowestPressureTime) {
this.lowestPressureTime = lowestPressureTime;
}
/** /**
* Get the altimeter setting. * Get the altimeter setting.
@ -1263,6 +1394,32 @@ public class ObsCommon extends PersistablePluginDataObject implements
secondarySwellWaveHeight = height; secondarySwellWaveHeight = height;
} }
/**
* @return the snowDepth
*/
public Double getSnowDepth() {
return snowDepth;
}
/**
* @param snowDepth
* the snowDepth to set
*/
public void setSnowDepth(Double snowDepth) {
this.snowDepth = snowDepth;
}
/**
* @return stateOfGroundWithSnow indicator
*/
public Integer getStateOfGroundWithSnow() {
return stateOfGroundWithSnow;
}
/**
* @param stateOfGroundWithSnow
* the stateOfGroundWithSnow indicator to set
*/
public void setStateOfGroundWithSnow(Integer stateOfGroundWithSnow) {
this.stateOfGroundWithSnow = stateOfGroundWithSnow;
}
/** /**
* @return the ancClouds * @return the ancClouds
*/ */