diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF index 3e92d9edce..21fd8fcd28 100644 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.d2d.xy.adapters/META-INF/MANIFEST.MF @@ -1,46 +1,31 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: Adapters +Bundle-Name: D2D Graph Adapters Bundle-SymbolicName: com.raytheon.uf.viz.d2d.xy.adapters;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-Activator: com.raytheon.uf.viz.d2d.xy.adapters.Activator +Bundle-Version: 1.14.0.qualifier Bundle-Vendor: RAYTHEON -Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core -Eclipse-BuddyPolicy: ext, global -Require-Bundle: org.eclipse.core.runtime, - com.raytheon.uf.viz.xy.crosssection;bundle-version="1.0.0", - com.raytheon.uf.viz.xy.varheight;bundle-version="1.12.1174", - com.raytheon.uf.viz.core;bundle-version="1.12.1174", - com.raytheon.uf.viz.xy;bundle-version="1.12.1174", - com.raytheon.viz.core;bundle-version="1.12.1174", - com.raytheon.viz.core.graphing;bundle-version="1.12.1174", - com.raytheon.uf.viz.xy.timeseries;bundle-version="1.12.1174", - javax.measure;bundle-version="1.0.0", - com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174", - com.raytheon.uf.common.comm;bundle-version="1.12.1174", - com.raytheon.uf.common.style;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: com.raytheon.uf.common.dataplugin, - com.raytheon.uf.common.dataplugin.grid, - com.raytheon.uf.common.dataplugin.grid.util, - com.raytheon.uf.common.dataplugin.radar, - com.raytheon.uf.common.dataplugin.radar.util, - com.raytheon.uf.common.dataquery.requests, - com.raytheon.uf.common.datastorage, - com.raytheon.uf.common.datastorage.records, +Bundle-ActivationPolicy: lazy +Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14.0", + com.raytheon.uf.viz.xy, + com.raytheon.viz.core.graphing, + com.raytheon.uf.viz.xy.crosssection;bundle-version="1.14.0", + com.raytheon.uf.viz.xy.varheight;bundle-version="1.13.0", + com.raytheon.uf.viz.xy.timeseries;bundle-version="1.13.0", com.raytheon.uf.common.geospatial, - com.raytheon.uf.common.gridcoverage, - com.raytheon.uf.common.parameter, - com.raytheon.uf.common.pointdata, - com.raytheon.uf.common.status, - com.raytheon.uf.common.time, - com.raytheon.uf.viz.objectiveanalysis.rsc, + com.raytheon.uf.common.dataplugin, + com.raytheon.uf.common.dataplugin.grid;bundle-version="1.13.0", + com.raytheon.uf.common.pointdata;bundle-version="1.13.0", + com.raytheon.uf.viz.objectiveanalysis, com.raytheon.viz.grid, - com.raytheon.viz.grid.inv, - com.raytheon.viz.radar.util, - org.eclipse.swt.graphics -Export-Package: com.raytheon.uf.viz.d2d.xy.adapters, - com.raytheon.uf.viz.d2d.xy.adapters.crosssection, + com.raytheon.viz.radar, + com.raytheon.uf.common.datastorage, + com.raytheon.uf.common.time, + com.raytheon.uf.common.style, + com.raytheon.uf.common.comm, + javax.measure, + org.eclipse.swt;bundle-version="3.8.0" +Import-Package: com.raytheon.viz.core.map +Export-Package: com.raytheon.uf.viz.d2d.xy.adapters.crosssection, com.raytheon.uf.viz.d2d.xy.adapters.timeseries, com.raytheon.uf.viz.d2d.xy.adapters.varheight -Bundle-ActivationPolicy: lazy diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/Activator.java b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/Activator.java deleted file mode 100644 index c42a872b84..0000000000 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/Activator.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.raytheon.uf.viz.d2d.xy.adapters; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "com.raytheon.uf.viz.d2d.xy.adapters"; - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext - * ) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * - * @see - * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/crosssection/GridCSAdapter.java b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/crosssection/GridCSAdapter.java index e3e90181ec..bd265171b0 100644 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/crosssection/GridCSAdapter.java +++ b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/crosssection/GridCSAdapter.java @@ -63,15 +63,17 @@ import com.vividsolutions.jts.geom.Coordinate; *
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Nov 23, 2009 mschenke Initial creation - * Feb 04, 2011 7953 bkowal Fill values will now be placed - * in the data array for anything - * below 300MB for RUC80. - * Oct 2, 2012 DR 15259 M.Porricelli Allow plotting when 3 levels - * available (DGEX) - * Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references + * Date Ticket# Engineer Description + * ------------- -------- ------------ ---------------------------------------- + * Nov 23, 2009 mschenke Initial creation + * Feb 04, 2011 7953 bkowal Fill values will now be placed in the + * data array for anything below 300MB for + * RUC80. + * Oct 02, 2012 15259 M.Porricelli Allow plotting when 3 levels available + * (DGEX) + * Sep 09, 2013 2277 mschenke Got rid of ScriptCreator references + * Feb 17, 2014 2661 bsteffen Remove unnecessary output. + * * ** @@ -368,9 +370,6 @@ public class GridCSAdapter extends AbstractCrossSectionAdapter
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * May 7, 2010 bsteffen Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * May 07, 2010 bsteffen Initial creation + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** @@ -281,53 +283,38 @@ public class GridTimeSeriesAdapter extends } Request request = Request.buildPointRequest(index); - boolean isVectorData = false; - boolean isIcon = displayType == DisplayType.ICON; for (GridRecord rec : gribs) { - IDataRecord[] records = cache.get(rec); if (records == null) { records = DataCubeContainer.getDataRecord(rec, request, null); cache.put(rec, records); } - double specificValue = Double.NaN; - double vectorDirection = Double.NaN; - - // received a (wind) vector result - if (records.length > 1) { - float[] vectorDirections = (float[]) records[1].getDataObject(); - vectorDirection = vectorDirections[0]; - isVectorData = true; - } - - float[] d = (float[]) records[0].getDataObject(); - specificValue = d[0]; - if (specificValue <= -999999) { - continue; - } + + DataTime time = rec.getDataTime(); XYData dataPoint = null; + + if(records.length == 2){ + double u = getValue(records[0]); + double v = getValue(records[1]); + double speed = Math.hypot(u, v); + double dir = Math.toDegrees(Math.atan2(-u, -v)); - // do I need to convert? - if (!rec.getLevel().equals(preferredLevel)) { - Unit> dataUnit = levelUnitMap.get(rec.getLevel()); - if (!dataUnit.equals(preferredUnit)) { - // convert - UnitConverter conv = dataUnit.getConverterTo(preferredUnit); - specificValue = conv.convert(specificValue); + if (!Double.isNaN(speed)) { + dataPoint = new XYWindImageData(time, speed, + speed, dir); + } + }else{ + double value = getValue(records[0]); + if (Double.isNaN(value)) { + continue; + } else if (isIcon) { + dataPoint = new XYIconImageData(time, + value, (int) value); + } else { + dataPoint = new XYData(time, value); } - } - - // create appropriate XYData class - if (isVectorData) { - dataPoint = new XYWindImageData(rec.getDataTime(), - specificValue, specificValue, vectorDirection); - } else if (isIcon) { - dataPoint = new XYIconImageData(rec.getDataTime(), - specificValue, (int) specificValue); - } else { - dataPoint = new XYData(rec.getDataTime(), specificValue); } data.add(dataPoint); @@ -339,6 +326,16 @@ public class GridTimeSeriesAdapter extends return list; } + private double getValue(IDataRecord record) { + FloatDataRecord floatRecord = (FloatDataRecord) record; + float value = floatRecord.getFloatData()[0]; + if (value < CubeUtil.MISSING) { + return Double.NaN; + } else { + return value; + } + } + @Override public void remove(DataTime time) { synchronized (recordsByTime) { diff --git a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java index a6a8222e56..03443fa3ec 100644 --- a/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java +++ b/cave/com.raytheon.uf.viz.d2d.xy.adapters/src/com/raytheon/uf/viz/d2d/xy/adapters/timeseries/PointDataTimeSeriesAdapter.java @@ -69,11 +69,12 @@ import com.vividsolutions.jts.geom.Coordinate; *
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * May 07, 2010 bsteffen Initial creation - * May 09, 2013 1869 bsteffen Modified D2D time series of point data to - * work without dataURI. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * May 07, 2010 bsteffen Initial creation + * May 09, 2013 1869 bsteffen Modified D2D time series of point data to + * work without dataURI. + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** @@ -131,7 +132,6 @@ public class PointDataTimeSeriesAdapter extends String parameter = resourceData.getYParameter().code; - boolean isIcon = displayType == DisplayType.ICON; Map
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * May 7, 2010 bsteffen Initial creation - * Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * May 7, 2010 bsteffen Initial creation + * Sep 9, 2013 2277 mschenke Got rid of ScriptCreator references + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** @@ -89,10 +90,10 @@ public class GridVarHeightAdapter extends AbstractVarHeightAdapter
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * May 07, 2010 bsteffen Initial creation - * May 13, 2013 1869 bsteffen Modified D2D height Graphs to work - * without dataURI column. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * May 07, 2010 bsteffen Initial creation + * May 13, 2013 1869 bsteffen Modified D2D height Graphs to work + * without dataURI column. + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** @@ -145,27 +147,29 @@ public class PointDataVarHeightAdapter extends Number[] y = pdv.getNumberAllLevels(heightScale.getParameter()); // array and checks for wind direction - Number[] windDir = null; - boolean hasWind1Unit = false; + Number[] windV = null; if (pdc.getParameters().contains(parameter + "[1]")) { - hasWind1Unit = true; - windDir = pdv.getNumberAllLevels(parameter + "[1]"); + windV = pdv.getNumberAllLevels(parameter + "[1]"); } // look for valid data points for (int i = 0; i < x.length; i++) { - if (y[i].intValue() > -9998 && x[i].intValue() > -9998) { + if (y[i].intValue() > CubeUtil.MISSING + && x[i].intValue() > CubeUtil.MISSING) { if (y[i].doubleValue() >= min && y[i].doubleValue() <= max) { - if (hasWind1Unit) { - double windSpeed = x[i].doubleValue(); - double windDirection = windDir[i].doubleValue(); - list.add(new XYWindImageData(x[i], y[i], windSpeed, - windDirection)); + if (windV != null) { + double u = x[i].doubleValue(); + double v = windV[i].doubleValue(); + + double speed = Math.hypot(u, v); + double dir = Math.toDegrees(Math.atan2(-u, -v)); + + list.add(new XYWindImageData(speed, y[i], speed, + dir)); } else { list.add(new XYData(x[i], y[i])); } } - } else { } } if (!list.isEmpty()) { diff --git a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Derivative.py b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Derivative.py index 61c045d51e..75c4bc6075 100644 --- a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Derivative.py +++ b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Derivative.py @@ -43,10 +43,8 @@ def execute(A0, A1, B0, B1): if isinstance(A0, tuple): # Do derivitive of components of the vector - u0 = A0[2] - v0 = A0[3] - u1 = A1[2] - v1 = A1[3] + u0,v0 = A0 + u1,v1 = A1 uDeriv = execute(u0, u1, B0, B1) vDeriv = execute(v0, v1, B0, B1) return Vector.componentsTo(uDeriv, vDeriv) diff --git a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Heli.py b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Heli.py index 855eef14aa..1f9d2f2754 100644 --- a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Heli.py +++ b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/Heli.py @@ -20,8 +20,7 @@ def execute(uStk, vStk, RM5): - umot = RM5[2] - vmot = RM5[3] + umot,vmot = RM5 u1 = uStk[0] v1 = vStk[0] u2 = uStk[-1] diff --git a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/VertCirc.py b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/VertCirc.py index 1c69e95bce..c8408145eb 100644 --- a/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/VertCirc.py +++ b/cave/com.raytheon.uf.viz.derivparam.python/localization/derivedParameters/functions/VertCirc.py @@ -22,4 +22,4 @@ def execute(wind, pvv): """ Combine wind with PVV to prepare the data for Cross Section to do Vertical Circulation Calculations """ - return (pvv, wind[1], wind[2], wind[3] ) + return (wind[0], wind[1], pvv ) diff --git a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/DerivedRequestableData.java b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/DerivedRequestableData.java index 4c7cff2725..43e556e222 100644 --- a/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/DerivedRequestableData.java +++ b/cave/com.raytheon.uf.viz.derivparam/src/com/raytheon/uf/viz/derivparam/data/DerivedRequestableData.java @@ -82,15 +82,10 @@ public class DerivedRequestableData extends AbstractRequestableData { List
* * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 1, 2011 bsteffen Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Dec 01, 2011 bsteffen Initial creation + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. + * * ** * @author bsteffen * @version 1.0 */ - public class CrossSectionRotation { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(CrossSectionRotation.class); @@ -61,7 +62,7 @@ public class CrossSectionRotation { List
* SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Dec 4, 2007 njensen Initial creation - * 02/17/09 njensen Refactored to new rsc architecture - * Feb 9, 2011 8244 bkowal Enabled the magnification capability. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Dec 04, 2007 njensen Initial creation + * Feb 17, 2009 njensen Refactored to new rsc architecture + * Feb 09, 2011 8244 bkowal Enabled the magnification capability. + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** * @author njensen * @version 1.0 */ - public class CrossSectionContourResource extends AbstractCrossSectionResource implements IResourceDataChanged { private static final transient IUFStatusHandler statusHandler = UFStatus @@ -214,7 +214,7 @@ public class CrossSectionContourResource extends AbstractCrossSectionResource } } List
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description + * Date Ticket# Engineer Description * ------------- -------- ----------- -------------------------- - * Jun 15, 2010 bsteffen Initial creation - * Feb 14, 2011 8244 bkowal enabled magnification capability. + * Jun 15, 2010 bsteffen Initial creation + * Feb 14, 2011 8244 bkowal enabled magnification capability. * Sep 23, 2013 2363 bsteffen Add more vector configuration options. - * Dec 11, 2013 DR 16795 D. Friedman Transform pixel coordinate in inspect + * Dec 11, 2013 16795 D. Friedman Transform pixel coordinate in inspect + * Feb 17, 2014 2661 bsteffen Use only u,v for vectors. * ** * @author bsteffen * @version 1.0 */ - public class CrossSectionVectorResource extends AbstractCrossSectionResource { + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(AbstractCrossSectionResource.class); /* Unknown source, provides acceptable density. */ private static final int VECTOR_SPACING = 60; @@ -90,8 +93,10 @@ public class CrossSectionVectorResource extends AbstractCrossSectionResource { sr = StyleManager.getInstance().getStyleRule( StyleManager.StyleType.ARROW, match); } catch (StyleException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + statusHandler.handle( + Priority.INFO, + "Unable to load Style rule for: " + + resourceData.getParameter(), e); } if (sr != null) { prefs = sr.getPreferences(); @@ -110,8 +115,8 @@ public class CrossSectionVectorResource extends AbstractCrossSectionResource { if (sliceMap.get(time) == null) { return; } - float[] uData = sliceMap.get(time).get(2); - float[] vData = sliceMap.get(time).get(3); + float[] uData = sliceMap.get(time).get(0); + float[] vData = sliceMap.get(time).get(1); double density = getCapability(DensityCapability.class).getDensity(); RGB color = getCapability(ColorableCapability.class).getColor(); @@ -193,16 +198,11 @@ public class CrossSectionVectorResource extends AbstractCrossSectionResource { && y < geometry.getGridRange().getSpan(1) && sliceMap.get(time) != null) { int index = y * geometry.getGridRange().getSpan(0) + x; - float[] ufd = sliceMap.get(time).get(2); - float[] vfd = sliceMap.get(time).get(3); + float[] ufd = sliceMap.get(time).get(0); + float[] vfd = sliceMap.get(time).get(1); double val = Math.hypot(ufd[index], vfd[index]); - ColorMapParameters colorMapParams = getCapability( - ColorMapCapability.class).getColorMapParameters(); - if (colorMapParams != null) { - val = colorMapParams.getDataToDisplayConverter().convert( - val); - } + s = sampleFormat.format(val); } } catch (Exception e) {