diff --git a/deltaScripts/13.6.1/bufruaTimeColumns.sh b/deltaScripts/13.6.1/bufruaTimeColumns.sh new file mode 100644 index 0000000000..2e42d30698 --- /dev/null +++ b/deltaScripts/13.6.1/bufruaTimeColumns.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# DR #1992 - this update script will drop the refHour and validTime columns +# from the bufrua column, refTime has the exact same value. + +PSQL="/awips2/psql/bin/psql" + +${PSQL} -U awips -d metadata -c "ALTER TABLE bufrua DROP COLUMN IF EXISTS validtime, DROP COLUMN IF EXISTS refhour;" diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrua/res/pointdata/bufruadb.xml b/edexOsgi/com.raytheon.edex.plugin.bufrua/res/pointdata/bufruadb.xml index fd334fafa9..610025c88d 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrua/res/pointdata/bufruadb.xml +++ b/edexOsgi/com.raytheon.edex.plugin.bufrua/res/pointdata/bufruadb.xml @@ -24,8 +24,11 @@ - - + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java index 33a15728a1..4d44e9d655 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java @@ -51,6 +51,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Mar 03, 2008 969 jkorman Initial implementation. * May 09, 2013 1869 bsteffen Modified D2D time series of point data to * work without dataURI. + * Jul 19, 2013 1992 bsteffen Remove redundant time columns from + * bufrua. * * * @@ -113,13 +115,13 @@ public abstract class AbstractBUFRUAAdapter extends BUFRPointDataAdapter obsData.setPluginName(getPluginName()); obsData.setWmoHeader(wmoHeader.getWmoHeader()); - Calendar validTime = obsData.getValidTime(); + Calendar validTime = obsData.getDataTime() + .getRefTimeAsCalendar(); // Now offset the "record" validTime using the hour mapping. int hour = validTime.get(Calendar.HOUR_OF_DAY); validTime.add(Calendar.HOUR_OF_DAY, HOUR_MAP[hour]); // Set the new validTime back into the UAObs record. - obsData.setValidTime(validTime); Calendar maxFutureTime = Calendar.getInstance(); maxFutureTime.add(Calendar.HOUR, 12); @@ -128,7 +130,6 @@ public abstract class AbstractBUFRUAAdapter extends BUFRPointDataAdapter return null; } - obsData.setRefHour(TimeTools.copy(validTime)); obsData.setDataTime(new DataTime(TimeTools.copy(validTime))); // We have times now, so ok to get container. @@ -184,7 +185,7 @@ public abstract class AbstractBUFRUAAdapter extends BUFRPointDataAdapter Calendar obsTime = getTimeInfo(dataList); if (obsTime != null) { obsData = new UAObs(); - obsData.setValidTime(obsTime); + obsData.setDataTime(new DataTime(obsTime)); } if (isValidTime(obsData)) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java index 89ecdfa76c..668fe416c0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java @@ -20,7 +20,6 @@ package com.raytheon.uf.common.dataplugin.bufrua; import java.util.ArrayList; -import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -93,6 +92,8 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Jun 20, 2013 2128 bsteffen Ensure setDataURI sets the dataURI. + * Jul 19, 2013 1992 bsteffen Remove redundant time columns from + * bufrua. * * * @@ -174,18 +175,6 @@ public class UAObs extends PersistablePluginDataObject implements @Transient private Integer levelId; - // Time of the observation. - @Column - @XmlElement - @DynamicSerializeElement - private Calendar validTime; - - // Time of the observation to the nearest hour. - @Column - @XmlElement - @DynamicSerializeElement - private Calendar refHour; - // The observation report type. @DataURI(position = 1) @Column @@ -450,40 +439,6 @@ public class UAObs extends PersistablePluginDataObject implements this.reportType = reportType; } - /** - * @return the validTime - */ - public Calendar getValidTime() { - return validTime; - } - - /** - * @param validTime - * the validTime to set - */ - public void setValidTime(Calendar validTime) { - this.validTime = validTime; - } - - /** - * Get the reference hour - * - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * Set the reference hour - * - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - /** * Get the station pressure at the observation site. * diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsAdapter.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsAdapter.java index 7fe6987bbb..3608889078 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsAdapter.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObsAdapter.java @@ -36,12 +36,14 @@ import com.raytheon.uf.common.sounding.adapter.AbstractVerticalSoundingAdapter; import com.raytheon.uf.edex.decodertools.time.TimeTools; /** - * TODO Add Description + * Adapter for convertung UAObs data into Vertical Soundings. * *
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2013 1992       bsteffen    Remove redundant time columns from
+ *                                     bufrua.
  * 
  * 
  * 
@@ -181,7 +183,7 @@ public class UAObsAdapter extends AbstractVerticalSoundingAdapter { sounding.setDisplayFormat(icao); sounding.setName(icao); - sounding.setObsTime(obsData.getValidTime()); + sounding.setObsTime(obsData.getDataTime().getRefTimeAsCalendar()); sounding.setDataTime(obsData.getDataTime()); List layers = interleave(obsData); @@ -651,10 +653,10 @@ public class UAObsAdapter extends AbstractVerticalSoundingAdapter { String key = getKey(obs); if (obsMap.containsKey(key)) { UAObs mapped = obsMap.get(key); - + // if compare(mapped,obs) < 0 then mapped has newer data int c = UAObs.getCorComparator().compare(mapped, obs); - if(c < 0) { + if (c < 0) { obsMap.put(key, obs); } } else { @@ -668,18 +670,19 @@ public class UAObsAdapter extends AbstractVerticalSoundingAdapter { } /** - * Create a key for a UAObs by concatenating the station identifier, - * report type code and the valid time in milliseconds. - * @param data A UAObs instance to key. + * Create a key for a UAObs by concatenating the station identifier, report + * type code and the valid time in milliseconds. + * + * @param data + * A UAObs instance to key. * @return The generated key, returns null if the UAObs reference is null. */ private static String getKey(UAObs data) { String key = null; if (data != null) { - key = String - .format("%s:%4d:%d", data.getStationId(), data - .getReportType(), data.getValidTime() - .getTimeInMillis()); + key = String.format("%s:%4d:%d", data.getStationId(), + data.getReportType(), data.getDataTime().getRefTime() + .getTime()); } return key; } @@ -803,14 +806,12 @@ public class UAObsAdapter extends AbstractVerticalSoundingAdapter { SurfaceObsLocation loc = new SurfaceObsLocation("72558"); UAObs[] obs = new UAObs[2]; obs[0] = new UAObs(); - obs[0].setValidTime(TimeTools.copy(c)); obs[0].setLocation(loc); obs[0].setReportType(2020); obs[0].setCorIndicator(null); loc = new SurfaceObsLocation("72558"); obs[1] = new UAObs(); - obs[1].setValidTime(TimeTools.copy(c)); obs[1].setLocation(loc); obs[1].setReportType(2020); obs[1].setCorIndicator("CCA"); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java index 9ced3fa49c..968264b596 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/dao/BufrUAPointDataTransform.java @@ -35,20 +35,22 @@ import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.edex.decodertools.time.TimeTools; /** - * TODO Add Description + * Converts a PointDataContainer into a UAObs record. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Aug 19, 2009            jkorman     Initial creation
- *
+ * Jul 19, 2013 1992       bsteffen    Remove redundant time columns from
+ *                                     bufrua.
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public class BufrUAPointDataTransform { @@ -121,9 +123,7 @@ public class BufrUAPointDataTransform { obs = new UAObs(uri); long vt = pdv.getNumber("validTime").longValue(); - obs.setValidTime(TimeTools.newCalendar(vt)); - obs.setRefHour(TimeTools.newCalendar(vt)); obs.setDataTime(new DataTime(TimeTools.newCalendar(vt))); SurfaceObsLocation location = new SurfaceObsLocation(); diff --git a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java index 06ae3e9471..8b17aad0a3 100644 --- a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java +++ b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java @@ -20,6 +20,7 @@ package gov.noaa.nws.ncep.edex.uengine.tasks.profile; * Nov 2011 Chin Chen changed Ncuair table query algorithm for performance improvement * 01/05/2012 S. Gurung Removed references to UAIR (performed cleanup) * 02/28/2012 Chin Chen modify several sounding query algorithms for better performance + * 07/19/2013 1992 bsteffen Remove redundant time columns from bufrua. * * * @author Chin Chen @@ -151,8 +152,8 @@ public class ObservedSoundingQuery { else { return pf; } - fields.add("validTime");// the synoptic time field name defined in UAObs - values.add(refTimeCal); + fields.add("dataTime.refTime");// the synoptic time field name defined in UAObs + values.add(refTimeCal.getTime()); dao = new CoreDao(DaoConfig.forClass(UAObs.class)); try { lUairRecords = (List) dao.queryByCriteria(fields, values);