diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/META-INF/MANIFEST.MF index 80c6ba5369..ead09ff9dc 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Tcg Plug-in Bundle-SymbolicName: com.raytheon.uf.edex.plugin.tcg -Bundle-Version: 1.12.1174.qualifier +Bundle-Version: 1.14.0.qualifier Bundle-Vendor: RAYTHEON -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: com.raytheon.uf.common.dataplugin.tcg;bundle-version="1.0.0", com.raytheon.uf.edex.decodertools, com.raytheon.uf.common.pointdata, @@ -14,11 +14,11 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.tcg;bundle-version="1.0.0", javax.measure, com.raytheon.uf.edex.database, com.raytheon.uf.common.serialization, - com.raytheon.uf.common.dataplugin + com.raytheon.uf.common.dataplugin, + org.slf4j Import-Package: com.raytheon.edex.esb, com.raytheon.uf.common.datastorage.records, com.raytheon.uf.common.status, com.raytheon.uf.common.time, com.raytheon.uf.common.wmo, - com.raytheon.uf.edex.core, - org.apache.commons.logging + com.raytheon.uf.edex.core diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/TCGDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/TCGDecoder.java index c6a916e0c1..1941dadb05 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/TCGDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/TCGDecoder.java @@ -22,8 +22,8 @@ package com.raytheon.uf.edex.plugin.tcg; import java.util.ArrayList; import java.util.List; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.uf.common.dataplugin.PluginDataObject; @@ -42,6 +42,7 @@ import com.raytheon.uf.edex.plugin.tcg.decoder.TCGDataAdapter; * ------------ ---------- ----------- -------------------------- * Oct 28, 2009 jsanchez Initial creation * May 14, 2014 2536 bclement moved WMO Header to common + * Jun 24, 2014 3235 nabowle Switch to slf4j. * * * @@ -49,7 +50,8 @@ import com.raytheon.uf.edex.plugin.tcg.decoder.TCGDataAdapter; * @version 1.0 */ public class TCGDecoder { - private Log logger = LogFactory.getLog(getClass()); + private static final Logger logger = LoggerFactory + .getLogger(TCGDecoder.class); private final String pluginName; diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java index 030401f393..4d6c806ba7 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; +import java.util.Map.Entry; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -36,19 +37,21 @@ import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; import com.vividsolutions.jts.geom.Coordinate; /** - * TODO Add Description - * + * Parses a subset of Tropical Cyclone Guidance data that contain multiple storm + * track predictions from various models such as BAM(S/M/D) and LBAR. + * *
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Oct 26, 2009 jsanchez Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract - * + * Jun 23, 2014 3235 nabowle Clear the coordinates map properly. + * *- * + * * @author jsanchez * @version 1.0 */ @@ -68,6 +71,7 @@ public class HURData extends TCGDataAdapter { List
* * SOFTWARE HISTORY @@ -41,95 +41,126 @@ import org.apache.commons.logging.LogFactory; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Oct 26, 2009 jsanchez Initial creation + * Jun 24, 2014 3235 nabowle Switch to slf4j. Precompile patterns. * ** * @author jsanchez - * @version 1.0 + * @version 1.0 */ public class InternalReport { - private static Log logger = LogFactory.getLog(InternalReport.class); - - //CHGHUR or CHGQLM or TCEAT4 - public static final String PRODUCT_PTRN = "^((CHG|TCE)(.*))"; - + private static final Logger LOGGER = LoggerFactory + .getLogger(InternalReport.class); + + // CHGHUR or CHGQLM or TCEAT4 + public static final Pattern PRODUCT_PTRN = Pattern + .compile("^((CHG|TCE)(.*))"); + /* * Below are patterns mostly used for CHGQLM */ - //TROPICAL STORM IDA 11L - public static final String STORM_TYPE_INFO = "^((TROPICAL|HURRICANE|TYPHOON|EXTRATROPICAL|DISTURBANCE) +(.*))"; - + // TROPICAL STORM IDA 11L + public static final Pattern STORM_TYPE_INFO = Pattern + .compile("^((TROPICAL|HURRICANE|TYPHOON|EXTRATROPICAL|DISTURBANCE) +(.*))"); + public static final String HOUR_PTRN = "(\\d{1,2})"; - + public static final String MONTH_PTRN = "(\\w{3,3})"; - + public static final String DAY_PTRN = "(\\d{1,2})"; - //INITIAL TIME 18Z NOV 4 - public static final String INIT_TIME_INFO = "^((INITIAL TIME)(\\s{2,3})" + HOUR_PTRN + "Z " + MONTH_PTRN + "(\\s{1,2})" + DAY_PTRN + ")"; - - // 18 12.1 82.2 47./ 1.7 - public static final String FORECAST_POSITION_INFO = "^((\\s{1,3})(\\d{1,3})(\\s{12,14})((\\d{0,2}).\\d) +(.*))"; - + + // INITIAL TIME 18Z NOV 4 + public static final Pattern INIT_TIME_INFO = Pattern + .compile("^((INITIAL TIME)(\\s{2,3})" + HOUR_PTRN + "Z " + + MONTH_PTRN + "(\\s{1,2})" + DAY_PTRN + ")"); + + // 18 12.1 82.2 47./ 1.7 + public static final Pattern FORECAST_POSITION_INFO = Pattern + .compile("^((\\s{1,3})(\\d{1,3})(\\s{12,14})((\\d{0,2}).\\d) +(.*))"); + + /* * Below are patterns mostly used for CHGHUR */ - //16.5N 102.2W - public static final String LATLON_PTRN ="(((\\d{0,2}|90).\\d{1,1}[NS])(\\s{1,4})(\\d{0,3}.\\d{1,1}[EW]))"; + public static final String LATLON = "(((\\d{0,2}|90).\\d{1,1}[NS])(\\s{1,4})(\\d{0,3}.\\d{1,1}[EW]))"; - //BAMS - public static final String MODEL_PTRN ="(\\w{4,4})"; - - //BAMS 16.5N 102.2W 17.5N 102.0W 18.2N 101.7W 18.6N 102.0W - public static final String MODEL_INFO ="^(" + MODEL_PTRN + "(\\s{4,4})" + LATLON_PTRN + "+(.*))"; - - //091029 1200 - public static final String DATETIME= "(\\d{6,6}\\s{2,2}\\d{4,4})"; - - // 091029 1200 091030 0000 091030 1200 091031 0000 - public static final String DATETIME_INFO = "((.*)" + DATETIME + "+(.*))"; - - //(EP952009) + // 16.5N 102.2W + public static final Pattern LATLON_PTRN = Pattern.compile(LATLON); + + public static final String MODEL = "(\\w{4,4})"; + + // BAMS + public static final Pattern MODEL_PTRN = Pattern.compile(MODEL); + + // BAMS 16.5N 102.2W 17.5N 102.0W 18.2N 101.7W 18.6N 102.0W + public static final Pattern MODEL_INFO = Pattern.compile("^(" + MODEL + + "(\\s{4,4})" + LATLON + "+(.*))"); + + // 091029 1200 + public static final String DATETIME = "(\\d{6,6}\\s{2,2}\\d{4,4})"; + + // 091029 1200 091030 0000 091030 1200 091031 0000 + public static final Pattern DATETIME_INFO = Pattern.compile("((.*)" + + DATETIME + "+(.*))"); + + // (EP952009) public static final String STATIONID_PTRN = "\\(\\w{2,2}\\d{6,6}\\)"; - - //20091029 1200 + + // 20091029 1200 public static final String REFTIME_PTRN = "(\\d{8,8} \\d{4,4})"; - - //DISTURBANCE INVEST (EP952009) 20091029 1200 UTC - public static final String DATA_INFO = "((.*) " + STATIONID_PTRN + " " + REFTIME_PTRN + " " + "UTC)"; - - // ...INITIAL CONDITIONS... - public static final String INIT_CONDITION_PTRN = "((.*)(...INITIAL CONDITIONS...)+(.*))"; - - //STORM DISSIPATED AT 54 HRS AT THE ABOVE PSN. - public static final String STORM_DISSIPATED = "^(STORM DISSIPATED +(.*))"; - + + // DISTURBANCE INVEST (EP952009) 20091029 1200 UTC + public static final Pattern DATA_INFO = Pattern.compile("((.*) " + + STATIONID_PTRN + " " + REFTIME_PTRN + " " + "UTC)"); + + // ...INITIAL CONDITIONS... + public static final Pattern INIT_CONDITION_PTRN = Pattern + .compile("((.*)(...INITIAL CONDITIONS...)+(.*))"); + + // STORM DISSIPATED AT 54 HRS AT THE ABOVE PSN. + public static final Pattern STORM_DISSIPATED = Pattern + .compile("^(STORM DISSIPATED +(.*))"); + /* - * Below are used for TCE + * Below are used for TCE */ - public static final String NWS_INFO = "^((NWS TPC)(.*)(\\w{2,2}\\d{6,6}))"; - //1100 PM CDT FRI SEP 12 2008 - public static final String TCE_REFTIME_INFO = "^(\\d{3,4} (AM|PM) \\w{3,3} \\w{3,3} \\w{3,3}\\s{1,2}\\d{1,2}(.*))"; - - public static final String TCE_REFHOUR = "^((.*)(\\.\\.\\.\\d{4,4}Z\\.\\.\\.)(.*))"; - - public static final String LAT_PTRN = "(LATITUDE \\d{0,2}.\\d)"; - //RESERVE UNIT RECONNAISSANCE AIRCRAFT...TO BE NEAR LATITUDE 28.7 - public static final String LATITUDE_INFO = "^((.*)" + LAT_PTRN + "(.*))"; - - public static final String LON_PTRN = "(LONGITUDE \\d{0,3}.\\d)"; - //NORTH...LONGITUDE 94.5 WEST OR ABOUT 45 MILES...75 KM... - public static final String LONGITUDE_INFO = "^((.*)" + LON_PTRN + "(.*))"; - //FORECASTER STEWART - public static final String FORECASTER_PTRN = "^((FORECASTER)(.*))"; + public static final Pattern NWS_INFO = Pattern + .compile("^((NWS TPC)(.*)(\\w{2,2}\\d{6,6}))"); + + // 1100 PM CDT FRI SEP 12 2008 + public static final Pattern TCE_REFTIME_INFO = Pattern + .compile("^(\\d{3,4} (AM|PM) \\w{3,3} \\w{3,3} \\w{3,3}\\s{1,2}\\d{1,2}(.*))"); + + public static final Pattern TCE_REFHOUR = Pattern + .compile("^((.*)(\\.\\.\\.\\d{4,4}Z\\.\\.\\.)(.*))"); + + public static final Pattern LAT_PTRN = Pattern + .compile("(LATITUDE \\d{0,2}.\\d)"); + + // RESERVE UNIT RECONNAISSANCE AIRCRAFT...TO BE NEAR LATITUDE 28.7 + public static final Pattern LATITUDE_INFO = Pattern.compile("^((.*)" + + LAT_PTRN + "(.*))"); + + public static final Pattern LON_PTRN = Pattern + .compile("(LONGITUDE \\d{0,3}.\\d)"); + + // NORTH...LONGITUDE 94.5 WEST OR ABOUT 45 MILES...75 KM... + public static final Pattern LONGITUDE_INFO = Pattern.compile("^((.*)" + + LON_PTRN + "(.*))"); + + // FORECASTER STEWART + public static final Pattern FORECASTER_PTRN = Pattern + .compile("^((FORECASTER)(.*))"); private final InternalType lineType; + private final String reportLine; - + private List
- * + * * SOFTWARE HISTORY - * + * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 12, 2009 jsanchez Initial creation * Aug 30, 2013 2298 rjpeter Make getPluginName abstract - * + * Jun 24, 2014 3235 nabowle InternalReport patterns are now + * precompiled. + * *- * + * * @author jsanchez * @version 1.0 */ public class TCEData extends TCGDataAdapter { + private static final Pattern STATION_ID_PATTERN = Pattern.compile("(\\w{2,2}\\d{6,6})"); + + private static final Pattern REF_HOUR_PATTERN = Pattern.compile("(\\d{4,4})"); + private float latitude = -9999; private float longitude = -9999; @@ -132,8 +138,7 @@ public class TCEData extends TCGDataAdapter { } private void parseStationIdInfo(String stationIdInfo) { - Pattern p = Pattern.compile("(\\w{2,2}\\d{6,6})"); - Matcher m = p.matcher(stationIdInfo); + Matcher m = STATION_ID_PATTERN.matcher(stationIdInfo); if (m.find()) { stationId = m.group(); } @@ -147,8 +152,7 @@ public class TCEData extends TCGDataAdapter { } private void parseRefhour(String refhourInfo) { - Pattern p = Pattern.compile("(\\d{4,4})"); - Matcher m = p.matcher(refhourInfo); + Matcher m = REF_HOUR_PATTERN.matcher(refhourInfo); if (m.find()) { hour = Integer.parseInt(m.group().substring(0, 2)); minute = Integer.parseInt(m.group().substring(2)); @@ -156,8 +160,7 @@ public class TCEData extends TCGDataAdapter { } private void parseLatitude(String latitudeInfo) { - Pattern p = Pattern.compile(InternalReport.LAT_PTRN); - Matcher m = p.matcher(latitudeInfo); + Matcher m = InternalReport.LAT_PTRN.matcher(latitudeInfo); if (m.find()) { latitude = Float.parseFloat(m.group().substring(8).trim()); if (latitudeInfo.contains("SOUTH")) { @@ -168,8 +171,7 @@ public class TCEData extends TCGDataAdapter { } private void parseLongitude(String longitudeInfo) { - Pattern p = Pattern.compile(InternalReport.LON_PTRN); - Matcher m = p.matcher(longitudeInfo); + Matcher m = InternalReport.LON_PTRN.matcher(longitudeInfo); if (m.find()) { longitude = Float.parseFloat(m.group().substring(10).trim()); if (longitudeInfo.contains("WEST")) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCGDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCGDataAdapter.java index c8d5318a40..a6eeaf3662 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCGDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCGDataAdapter.java @@ -1,19 +1,19 @@ /** * 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. **/ @@ -26,8 +26,8 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.raytheon.edex.esb.Headers; import com.raytheon.uf.common.dataplugin.tcg.TCGStormType; @@ -40,7 +40,7 @@ import com.raytheon.uf.common.wmo.WMOHeader; import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; /** - * TODO Add Description + * Base class for Tropical Cyclone Guidance (TCG) products. * *
* @@ -52,6 +52,7 @@ import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; * Jun 28, 2012 #826 dgilling Ensure getDataTime properly * handles time zones. * May 14, 2014 2536 bclement moved WMO Header to common, removed constructDataURI() call + * Jun 24, 2014 3235 nabowle Switch to slf4j. * ** @@ -60,7 +61,8 @@ import com.raytheon.uf.edex.plugin.tcg.TropicalCycloneGuidanceDao; */ public abstract class TCGDataAdapter { - protected static Log logger = LogFactory.getLog(TCGDataAdapter.class); + protected static Logger logger = LoggerFactory + .getLogger(TCGDataAdapter.class); protected PointDataDescription pointDataDescription; @@ -136,7 +138,7 @@ public abstract class TCGDataAdapter { /** * Does this parser contain any more reports. - * + * * @return Does this parser contain any more reports. */ public boolean hasNext() { @@ -154,7 +156,7 @@ public abstract class TCGDataAdapter { /** * Get the next available report. Returns a null reference if no more * reports are available. - * + * * @return The next available report. */ public TropicalCycloneGuidance next() { @@ -200,7 +202,7 @@ public abstract class TCGDataAdapter { } /** - * + * * @param obsData * @return */