Issue #2791 Move DataSource/DataDestination to its own project, add DataFilter.
Former-commit-id:9122b6da99
[formerly9122b6da99
[formerly ba5ff870337c7ac66d633077d84de867e5df967c]] Former-commit-id:8650074737
Former-commit-id:d3043fda5a
This commit is contained in:
parent
61af779433
commit
a1ac082c94
127 changed files with 1930 additions and 2169 deletions
|
@ -37,7 +37,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.common.velocity;bundle-version="1.0.0",
|
com.raytheon.uf.common.velocity;bundle-version="1.0.0",
|
||||||
ch.qos.logback;bundle-version="1.0.13",
|
ch.qos.logback;bundle-version="1.0.13",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
org.reflections;bundle-version="0.9.9"
|
org.reflections;bundle-version="0.9.9",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Eclipse-BuddyPolicy: ext, registered, global
|
Eclipse-BuddyPolicy: ext, registered, global
|
||||||
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.comm, ch.qos.logback
|
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.comm, ch.qos.logback
|
||||||
|
|
|
@ -13,14 +13,14 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
|
|
||||||
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
||||||
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
|
import com.raytheon.uf.common.colormap.image.ColorMapData.ColorMapDataType;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteBufferWrapper;
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities;
|
import com.raytheon.uf.common.numeric.buffer.IntBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.IntBufferWrapper;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.OffsetDataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ShortBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.OffsetDataSource;
|
||||||
import com.raytheon.uf.viz.core.DrawableImage;
|
import com.raytheon.uf.viz.core.DrawableImage;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode;
|
||||||
|
|
|
@ -2,57 +2,32 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: GFE in D2D
|
Bundle-Name: GFE in D2D
|
||||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.gfe;singleton:=true
|
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.gfe;singleton:=true
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.uf.viz.d2d.gfe.Activator
|
Bundle-Activator: com.raytheon.uf.viz.d2d.gfe.Activator
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core
|
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
|
||||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
|
||||||
com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174",
|
|
||||||
com.raytheon.uf.common.colormap;bundle-version="1.12.1174"
|
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
com.raytheon.uf.common.dataquery.requests,
|
org.eclipse.ui;bundle-version="3.8.0",
|
||||||
com.raytheon.uf.common.dataquery.responses,
|
com.raytheon.uf.viz.core;bundle-version="1.14.2",
|
||||||
com.raytheon.uf.common.datastorage.records,
|
com.raytheon.uf.common.serialization,
|
||||||
com.raytheon.uf.common.geospatial,
|
|
||||||
com.raytheon.uf.common.geospatial.interpolation,
|
|
||||||
com.raytheon.uf.common.localization,
|
|
||||||
com.raytheon.uf.common.message,
|
|
||||||
com.raytheon.uf.common.serialization.comm,
|
com.raytheon.uf.common.serialization.comm,
|
||||||
|
com.raytheon.uf.common.dataplugin.gfe,
|
||||||
|
com.raytheon.viz.grid;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.colormap,
|
||||||
|
com.raytheon.uf.common.dataplugin,
|
||||||
|
com.raytheon.uf.common.dataquery,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.localization;bundle-version="1.14.0",
|
||||||
|
com.raytheon.viz.core.graphing,
|
||||||
com.raytheon.uf.common.status,
|
com.raytheon.uf.common.status,
|
||||||
|
com.raytheon.uf.viz.xy.timeseries;bundle-version="1.13.0",
|
||||||
com.raytheon.uf.common.style,
|
com.raytheon.uf.common.style,
|
||||||
com.raytheon.uf.common.style.level,
|
|
||||||
com.raytheon.uf.common.time,
|
|
||||||
com.raytheon.uf.viz.core,
|
|
||||||
com.raytheon.uf.viz.core.catalog,
|
|
||||||
com.raytheon.uf.viz.core.datastructure,
|
|
||||||
com.raytheon.uf.viz.core.drawables,
|
|
||||||
com.raytheon.uf.viz.core.exception,
|
|
||||||
com.raytheon.uf.viz.core.requests,
|
|
||||||
com.raytheon.uf.viz.core.rsc,
|
|
||||||
com.raytheon.uf.viz.core.rsc.capabilities,
|
|
||||||
com.raytheon.uf.viz.core.status,
|
|
||||||
com.raytheon.uf.viz.productbrowser,
|
com.raytheon.uf.viz.productbrowser,
|
||||||
com.raytheon.uf.viz.xy.timeseries,
|
com.raytheon.viz.volumebrowser;bundle-version="1.13.0",
|
||||||
com.raytheon.uf.viz.xy.timeseries.adapter,
|
javax.measure,
|
||||||
com.raytheon.uf.viz.xy.timeseries.rsc,
|
org.jep
|
||||||
com.raytheon.viz.core.contours,
|
|
||||||
com.raytheon.viz.core.graphing.xy,
|
|
||||||
com.raytheon.viz.grid.rsc,
|
|
||||||
com.raytheon.viz.grid.rsc.general,
|
|
||||||
com.raytheon.viz.volumebrowser.datacatalog,
|
|
||||||
com.raytheon.viz.volumebrowser.vbui,
|
|
||||||
com.vividsolutions.jts.geom,
|
|
||||||
javax.measure.unit,
|
|
||||||
jep,
|
|
||||||
org.eclipse.swt.graphics,
|
|
||||||
org.geotools.coverage.grid,
|
|
||||||
org.geotools.geometry,
|
|
||||||
org.opengis.geometry,
|
|
||||||
org.opengis.metadata.spatial,
|
|
||||||
org.opengis.referencing.operation
|
|
||||||
Export-Package: com.raytheon.uf.viz.d2d.gfe,
|
Export-Package: com.raytheon.uf.viz.d2d.gfe,
|
||||||
com.raytheon.uf.viz.d2d.gfe.browser,
|
com.raytheon.uf.viz.d2d.gfe.browser,
|
||||||
com.raytheon.uf.viz.d2d.gfe.rsc,
|
com.raytheon.uf.viz.d2d.gfe.rsc,
|
||||||
|
|
|
@ -10,11 +10,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
com.raytheon.uf.viz.core;bundle-version="1.14.1",
|
com.raytheon.uf.viz.core;bundle-version="1.14.1",
|
||||||
com.raytheon.viz.ui;bundle-version="1.14.0",
|
com.raytheon.viz.ui;bundle-version="1.14.0",
|
||||||
de.micromata.opengis.kml,
|
de.micromata.opengis.kml,
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.colormap,
|
com.raytheon.uf.common.colormap,
|
||||||
com.raytheon.uf.common.time,
|
com.raytheon.uf.common.time,
|
||||||
com.raytheon.uf.viz.core.maps,
|
com.raytheon.uf.viz.core.maps,
|
||||||
com.raytheon.viz.pointdata,
|
com.raytheon.viz.pointdata,
|
||||||
com.raytheon.viz.radar,
|
com.raytheon.viz.radar,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
|
||||||
javax.measure
|
javax.measure
|
||||||
Export-Package: com.raytheon.uf.viz.kml.export
|
Export-Package: com.raytheon.uf.viz.kml.export
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.kml.export.graphics.ext;
|
package com.raytheon.uf.viz.kml.export.graphics.ext;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
import java.nio.IntBuffer;
|
import java.nio.IntBuffer;
|
||||||
|
@ -30,13 +31,13 @@ import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
||||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteBufferWrapper;
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.IntBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.IntBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ShortBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedByteBufferWrapper;
|
import com.raytheon.uf.common.numeric.filter.UnsignedFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedShortBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
|
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
|
||||||
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
|
import com.raytheon.uf.viz.core.drawables.IColormappedImage;
|
||||||
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
|
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
|
||||||
|
@ -55,6 +56,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
* ------------- -------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Jun 01, 2012 bsteffen Initial creation
|
* Jun 01, 2012 bsteffen Initial creation
|
||||||
* Jan 23, 2014 2703 bsteffen Use data to get width and height.
|
* Jan 23, 2014 2703 bsteffen Use data to get width and height.
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -90,33 +93,45 @@ public class KmlColormappedImage extends KmlImage implements IColormappedImage {
|
||||||
|
|
||||||
public DataSource getData(GridGeometry2D geometry) throws VizException {
|
public DataSource getData(GridGeometry2D geometry) throws VizException {
|
||||||
loadData();
|
loadData();
|
||||||
|
Rectangle gridRange = geometry.getGridRange2D();
|
||||||
|
DataSource source = null;
|
||||||
switch (data.getDataType()) {
|
switch (data.getDataType()) {
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
return new FloatBufferWrapper(((FloatBuffer) data.getBuffer()),
|
source = new FloatBufferWrapper(((FloatBuffer) data.getBuffer()),
|
||||||
geometry);
|
gridRange);
|
||||||
|
break;
|
||||||
case BYTE: {
|
case BYTE: {
|
||||||
return new UnsignedByteBufferWrapper(
|
source = UnsignedFilter.apply(new ByteBufferWrapper(
|
||||||
((ByteBuffer) data.getBuffer()), geometry);
|
((ByteBuffer) data.getBuffer()), gridRange));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SIGNED_BYTE: {
|
case SIGNED_BYTE: {
|
||||||
return new ByteBufferWrapper(((ByteBuffer) data.getBuffer()),
|
source = new ByteBufferWrapper(((ByteBuffer) data.getBuffer()),
|
||||||
geometry);
|
gridRange);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case INT: {
|
case INT: {
|
||||||
return new IntBufferWrapper(((IntBuffer) data.getBuffer()),
|
source = new IntBufferWrapper(((IntBuffer) data.getBuffer()),
|
||||||
geometry);
|
gridRange);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SHORT: {
|
case SHORT: {
|
||||||
return new ShortBufferWrapper(((ShortBuffer) data.getBuffer()),
|
source = new ShortBufferWrapper(((ShortBuffer) data.getBuffer()),
|
||||||
geometry);
|
gridRange);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case UNSIGNED_SHORT: {
|
case UNSIGNED_SHORT: {
|
||||||
return new UnsignedShortBufferWrapper(
|
source = UnsignedFilter.apply(new ShortBufferWrapper(
|
||||||
((ShortBuffer) data.getBuffer()), geometry);
|
((ShortBuffer) data.getBuffer()), gridRange));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
throw new UnsupportedOperationException(
|
||||||
|
"Kml Export does not supprt image type: "
|
||||||
|
+ data.getDataType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new UnsupportedOperationException(
|
return new GeographicDataSource(source, geometry);
|
||||||
"Kml Export does not supprt image type: " + data.getDataType());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,5 +183,4 @@ public class KmlColormappedImage extends KmlImage implements IColormappedImage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
|
@ -37,8 +37,8 @@ import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.DrawableImage;
|
import com.raytheon.uf.viz.core.DrawableImage;
|
||||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||||
import com.raytheon.uf.viz.kml.export.KmlFeatureGenerator;
|
import com.raytheon.uf.viz.kml.export.KmlFeatureGenerator;
|
||||||
|
@ -123,7 +123,7 @@ public abstract class KmlGroundOverlayGenerator extends KmlFeatureGenerator {
|
||||||
} else {
|
} else {
|
||||||
interp = new NearestNeighborInterpolation();
|
interp = new NearestNeighborInterpolation();
|
||||||
}
|
}
|
||||||
FloatArrayWrapper dst = new FloatArrayWrapper(dest);
|
FloatBufferWrapper dst = new FloatBufferWrapper(dest.getGridRange2D());
|
||||||
return reproj.reprojectedGrid(interp, data, dst).getArray();
|
return reproj.reprojectedGrid(interp, data, dst).getArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@ import org.opengis.referencing.operation.TransformException;
|
||||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.AbstractDataWrapper;
|
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -161,7 +161,7 @@ public class KmlMosaicImageExtension extends
|
||||||
}
|
}
|
||||||
GridGeometry2D geom = new GridGeometry2D(range, bigenv);
|
GridGeometry2D geom = new GridGeometry2D(range, bigenv);
|
||||||
// fullDest is the end location of reprojected data values
|
// fullDest is the end location of reprojected data values
|
||||||
FloatArrayWrapper fullDest = new FloatArrayWrapper(geom);
|
FloatBufferWrapper fullDest = new FloatBufferWrapper(range);
|
||||||
Arrays.fill(fullDest.getArray(), Float.NaN);
|
Arrays.fill(fullDest.getArray(), Float.NaN);
|
||||||
Interpolation interp = new NearestNeighborInterpolation();
|
Interpolation interp = new NearestNeighborInterpolation();
|
||||||
for (DrawableImage image : images) {
|
for (DrawableImage image : images) {
|
||||||
|
@ -223,12 +223,12 @@ public class KmlMosaicImageExtension extends
|
||||||
|
|
||||||
private final Comparator<Double> mosaicComparator;
|
private final Comparator<Double> mosaicComparator;
|
||||||
|
|
||||||
private final AbstractDataWrapper fullDest;
|
private final BufferWrapper fullDest;
|
||||||
|
|
||||||
private final GridEnvelope2D envelope;
|
private final GridEnvelope2D envelope;
|
||||||
|
|
||||||
public MosaicDataDestination(Comparator<Double> mosaicComparator,
|
public MosaicDataDestination(Comparator<Double> mosaicComparator,
|
||||||
AbstractDataWrapper fullDest, GridEnvelope2D envelope) {
|
BufferWrapper fullDest, GridEnvelope2D envelope) {
|
||||||
this.mosaicComparator = mosaicComparator;
|
this.mosaicComparator = mosaicComparator;
|
||||||
this.fullDest = fullDest;
|
this.fullDest = fullDest;
|
||||||
this.envelope = envelope;
|
this.envelope = envelope;
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: VIIRS Satellite
|
Bundle-Name: VIIRS Satellite
|
||||||
Bundle-SymbolicName: com.raytheon.uf.viz.npp.viirs;singleton:=true
|
Bundle-SymbolicName: com.raytheon.uf.viz.npp.viirs;singleton:=true
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.uf.viz.npp.viirs.Activator
|
Bundle-Activator: com.raytheon.uf.viz.npp.viirs.Activator
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
|
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
|
||||||
|
@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
||||||
org.geotools;bundle-version="2.6.4",
|
org.geotools;bundle-version="2.6.4",
|
||||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||||
|
@ -26,7 +26,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.viz.alerts;bundle-version="1.12.1174",
|
com.raytheon.viz.alerts;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.viz.npp;bundle-version="1.0.0",
|
com.raytheon.uf.viz.npp;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.viz.npp.viirs.rsc
|
Export-Package: com.raytheon.uf.viz.npp.viirs.rsc
|
||||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Map;
|
||||||
import javax.measure.converter.UnitConverter;
|
import javax.measure.converter.UnitConverter;
|
||||||
import javax.measure.unit.Unit;
|
import javax.measure.unit.Unit;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
import org.geotools.coverage.grid.GridEnvelope2D;
|
import org.geotools.coverage.grid.GridEnvelope2D;
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
import org.opengis.geometry.Envelope;
|
import org.opengis.geometry.Envelope;
|
||||||
|
@ -40,12 +39,18 @@ import com.raytheon.uf.common.datastorage.Request;
|
||||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||||
import com.raytheon.uf.common.datastorage.records.ShortDataRecord;
|
import com.raytheon.uf.common.datastorage.records.ShortDataRecord;
|
||||||
|
import com.raytheon.uf.common.geospatial.data.UnitConvertingDataFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridDownscaler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridDownscaler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ShortArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedShortArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.FillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.InverseFillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.UnsignedFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.HDF5Util;
|
import com.raytheon.uf.viz.core.HDF5Util;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||||
|
@ -58,9 +63,11 @@ import com.raytheon.uf.viz.derivparam.data.AbstractRequestableData;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Jan 19, 2012 mschenke Initial creation
|
* Jan 19, 2012 mschenke Initial creation
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -152,8 +159,8 @@ public class VIIRSRequestableData extends AbstractRequestableData {
|
||||||
double diffRatioY = recordLevelRect.getHeight()
|
double diffRatioY = recordLevelRect.getHeight()
|
||||||
/ requestLevelRect.getHeight();
|
/ requestLevelRect.getHeight();
|
||||||
|
|
||||||
GeneralGridGeometry requestSliceGeometry = null;
|
GridGeometry2D requestSliceGeometry = null;
|
||||||
GeneralGridGeometry recordSliceGeometry = null;
|
GridGeometry2D recordSliceGeometry = null;
|
||||||
|
|
||||||
Request req = request.request;
|
Request req = request.request;
|
||||||
Request recordRequest = req;
|
Request recordRequest = req;
|
||||||
|
@ -212,19 +219,22 @@ public class VIIRSRequestableData extends AbstractRequestableData {
|
||||||
|
|
||||||
GridReprojection reprojection = new GridReprojection(
|
GridReprojection reprojection = new GridReprojection(
|
||||||
recordSliceGeometry, requestSliceGeometry);
|
recordSliceGeometry, requestSliceGeometry);
|
||||||
UnsignedShortArrayWrapper dest = new UnsignedShortArrayWrapper(
|
ShortBufferWrapper rawDest = new ShortBufferWrapper(
|
||||||
requestSliceGeometry);
|
requestSliceGeometry.getGridRange2D());
|
||||||
dest.setFillValue(noData);
|
DataDestination dest = InverseFillValueFilter.apply(
|
||||||
UnsignedShortArrayWrapper source = new UnsignedShortArrayWrapper(
|
(DataDestination) rawDest, noData);
|
||||||
|
ShortBufferWrapper rawSource = new ShortBufferWrapper(
|
||||||
((ShortDataRecord) record).getShortData(),
|
((ShortDataRecord) record).getShortData(),
|
||||||
recordSliceGeometry);
|
recordSliceGeometry.getGridRange2D());
|
||||||
source.setFillValue(noData);
|
DataSource source = UnsignedFilter.apply(rawSource);
|
||||||
|
|
||||||
|
source = FillValueFilter.apply(source, noData);
|
||||||
reprojection.reprojectedGrid(new BilinearInterpolation(),
|
reprojection.reprojectedGrid(new BilinearInterpolation(),
|
||||||
source, dest);
|
source, dest);
|
||||||
|
|
||||||
ShortDataRecord scaled = new ShortDataRecord(
|
ShortDataRecord scaled = new ShortDataRecord(
|
||||||
record.getName(), record.getGroup(),
|
record.getName(), record.getGroup(),
|
||||||
dest.getArray());
|
rawDest.getArray());
|
||||||
copyRecord(scaled, record);
|
copyRecord(scaled, record);
|
||||||
// set correct sizes after copying attributes
|
// set correct sizes after copying attributes
|
||||||
scaled.setIntSizes(new int[] {
|
scaled.setIntSizes(new int[] {
|
||||||
|
@ -286,26 +296,16 @@ public class VIIRSRequestableData extends AbstractRequestableData {
|
||||||
}
|
}
|
||||||
float[] floatData = new float[width * height];
|
float[] floatData = new float[width * height];
|
||||||
final UnitConverter converter = dataUnit.getConverterTo(Unit.ONE);
|
final UnitConverter converter = dataUnit.getConverterTo(Unit.ONE);
|
||||||
FloatArrayWrapper destination = new FloatArrayWrapper(floatData,
|
DataDestination destination = new FloatBufferWrapper(floatData,
|
||||||
width, height) {
|
width, height);
|
||||||
@Override
|
destination = UnitConvertingDataFilter
|
||||||
public void setDataValueInternal(double dataValue, int index) {
|
.apply(destination, converter);
|
||||||
// Apply unit converter for each value
|
ShortBufferWrapper shortData = new ShortBufferWrapper(
|
||||||
super.setDataValueInternal(converter.convert(dataValue),
|
|
||||||
index);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
destination.setFillValue(Float.NaN);
|
|
||||||
UnsignedShortArrayWrapper source = new UnsignedShortArrayWrapper(
|
|
||||||
((ShortDataRecord) record).getShortData(), width, height);
|
((ShortDataRecord) record).getShortData(), width, height);
|
||||||
source.setFillValue(noDataValue);
|
DataSource source = UnsignedFilter.apply(shortData);
|
||||||
|
source = FillValueFilter.apply(source, noDataValue);
|
||||||
|
|
||||||
// For each point, set in destination
|
DataUtilities.copy(source, destination, width, height);
|
||||||
for (int y = 0; y < height; ++y) {
|
|
||||||
for (int x = 0; x < width; ++x) {
|
|
||||||
destination.setDataValue(source.getDataValue(x, y), x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create float data record from converted data
|
// Create float data record from converted data
|
||||||
FloatDataRecord fdr = new FloatDataRecord(record.getName(),
|
FloatDataRecord fdr = new FloatDataRecord(record.getName(),
|
||||||
|
|
|
@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.viz.sounding;bundle-version="1.11.17",
|
com.raytheon.uf.viz.sounding;bundle-version="1.11.17",
|
||||||
com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.11.17",
|
com.raytheon.uf.common.dataplugin.bufrua;bundle-version="1.11.17",
|
||||||
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
|
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.viz.objectiveanalysis.rsc
|
Export-Package: com.raytheon.uf.viz.objectiveanalysis.rsc
|
||||||
|
|
|
@ -2,10 +2,8 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: QPF Plug-in
|
Bundle-Name: QPF Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.uf.viz.qpf;singleton:=true
|
Bundle-SymbolicName: com.raytheon.uf.viz.qpf;singleton:=true
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.uf.viz.qpf.Activator
|
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui,
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
com.raytheon.uf.viz.core,
|
com.raytheon.uf.viz.core,
|
||||||
|
@ -19,7 +17,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.viz.pointdata;bundle-version="1.11.1",
|
com.raytheon.viz.pointdata;bundle-version="1.11.1",
|
||||||
com.raytheon.uf.common.dataplugin.qpf;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataplugin.qpf;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.12.1153",
|
com.raytheon.uf.viz.productbrowser;bundle-version="1.12.1153",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.viz.qpf
|
Export-Package: com.raytheon.uf.viz.qpf
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.viz.qpf;
|
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The activator class controls the plug-in life cycle
|
|
||||||
*/
|
|
||||||
public class Activator extends AbstractUIPlugin {
|
|
||||||
|
|
||||||
// The plug-in ID
|
|
||||||
public static final String PLUGIN_ID = "com.raytheon.uf.viz.qpf";
|
|
||||||
|
|
||||||
// The shared instance
|
|
||||||
private static Activator plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constructor
|
|
||||||
*/
|
|
||||||
public Activator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public void start(BundleContext context) throws Exception {
|
|
||||||
super.start(context);
|
|
||||||
plugin = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public void stop(BundleContext context) throws Exception {
|
|
||||||
plugin = null;
|
|
||||||
super.stop(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shared instance
|
|
||||||
*
|
|
||||||
* @return the shared instance
|
|
||||||
*/
|
|
||||||
public static Activator getDefault() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an image descriptor for the image file at the given plug-in
|
|
||||||
* relative path
|
|
||||||
*
|
|
||||||
* @param path
|
|
||||||
* the path
|
|
||||||
* @return the image descriptor
|
|
||||||
*/
|
|
||||||
public static ImageDescriptor getImageDescriptor(String path) {
|
|
||||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Require-Bundle: com.raytheon.uf.common.colormap,
|
Require-Bundle: com.raytheon.uf.common.colormap,
|
||||||
com.raytheon.uf.common.dataplugin,
|
com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.style,
|
com.raytheon.uf.common.style,
|
||||||
com.raytheon.uf.common.topo,
|
com.raytheon.uf.common.topo,
|
||||||
com.raytheon.uf.common.wxmath,
|
com.raytheon.uf.common.wxmath,
|
||||||
|
@ -16,11 +16,12 @@ Require-Bundle: com.raytheon.uf.common.colormap,
|
||||||
com.raytheon.uf.viz.d2d.core,
|
com.raytheon.uf.viz.d2d.core,
|
||||||
com.raytheon.uf.viz.d2d.ui,
|
com.raytheon.uf.viz.d2d.ui,
|
||||||
com.raytheon.uf.viz.xy,
|
com.raytheon.uf.viz.xy,
|
||||||
com.raytheon.viz.core.contours,
|
com.raytheon.viz.core.contours;bundle-version="1.14.0",
|
||||||
com.raytheon.viz.core.graphing,
|
com.raytheon.viz.core.graphing,
|
||||||
javax.measure,
|
javax.measure,
|
||||||
org.eclipse.core.runtime;bundle-version="3.8.0",
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
org.eclipse.ui;bundle-version="3.8.0"
|
org.eclipse.ui;bundle-version="3.8.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Import-Package: com.raytheon.viz.core.imagery,
|
Import-Package: com.raytheon.viz.core.imagery,
|
||||||
com.raytheon.viz.core.map,
|
com.raytheon.viz.core.map,
|
||||||
com.raytheon.viz.core.rsc.jts
|
com.raytheon.viz.core.rsc.jts
|
||||||
|
|
|
@ -35,7 +35,9 @@ import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.ValidRangeFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -67,11 +69,13 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Nov 29, 2007 njensen Initial creation
|
* Nov 29, 2007 njensen Initial creation
|
||||||
* 02/17/09 njensen Refactored to new rsc architecture
|
* Feb 17, 2009 njensen Refactored to new rsc architecture
|
||||||
* Dec 11, 2013 DR 16795 D. Friedman Transform pixel coordinate in inspect
|
* Dec 11, 2013 16795 D. Friedman Transform pixel coordinate in inspect
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -285,8 +289,10 @@ public class CrossSectionImageResource extends AbstractCrossSectionResource
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FloatArrayWrapper source = new FloatArrayWrapper(sliceData, geometry);
|
DataSource source = new FloatBufferWrapper(sliceData,
|
||||||
source.setValidRange(-9998, Double.POSITIVE_INFINITY);
|
geometry.getGridRange2D());
|
||||||
|
source = ValidRangeFilter
|
||||||
|
.apply(source, -9998, Double.POSITIVE_INFINITY);
|
||||||
GridSampler sampler = new GridSampler(source,
|
GridSampler sampler = new GridSampler(source,
|
||||||
new BilinearInterpolation());
|
new BilinearInterpolation());
|
||||||
GridReprojection reproj = new GridReprojection(geometry,
|
GridReprojection reproj = new GridReprojection(geometry,
|
||||||
|
|
|
@ -2,25 +2,27 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Timeheight
|
Bundle-Name: Timeheight
|
||||||
Bundle-SymbolicName: com.raytheon.uf.viz.xy.timeheight;singleton:=true
|
Bundle-SymbolicName: com.raytheon.uf.viz.xy.timeheight;singleton:=true
|
||||||
Bundle-Version: 1.0.1.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Require-Bundle: com.raytheon.uf.common.colormap,
|
Require-Bundle: com.raytheon.uf.common.colormap,
|
||||||
com.raytheon.uf.common.dataplugin,
|
com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.style,
|
com.raytheon.uf.common.style,
|
||||||
com.raytheon.uf.viz.core,
|
com.raytheon.uf.viz.core;bundle-version="1.14.2",
|
||||||
com.raytheon.uf.viz.d2d.core,
|
com.raytheon.uf.viz.d2d.core,
|
||||||
com.raytheon.uf.viz.d2d.ui,
|
com.raytheon.uf.viz.d2d.ui,
|
||||||
com.raytheon.uf.viz.xy,
|
com.raytheon.uf.viz.xy,
|
||||||
com.raytheon.uf.viz.xy.varheight,
|
com.raytheon.uf.viz.xy.varheight;bundle-version="1.13.0",
|
||||||
com.raytheon.viz.core.contours,
|
com.raytheon.viz.core.contours;bundle-version="1.14.0",
|
||||||
com.raytheon.viz.core.graphing,
|
com.raytheon.viz.core.graphing,
|
||||||
com.raytheon.viz.grid,
|
com.raytheon.viz.grid;bundle-version="1.14.0",
|
||||||
javax.measure,
|
javax.measure,
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
org.eclipse.ui
|
org.eclipse.ui;bundle-version="3.8.0",
|
||||||
|
com.raytheon.uf.common.dataplugin,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Import-Package: com.raytheon.viz.core.imagery,
|
Import-Package: com.raytheon.viz.core.imagery,
|
||||||
com.raytheon.viz.core.map,
|
com.raytheon.viz.core.map,
|
||||||
com.raytheon.viz.core.rsc
|
com.raytheon.viz.core.rsc
|
||||||
|
|
|
@ -30,7 +30,9 @@ import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.ValidRangeFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||||
import com.raytheon.uf.common.style.StyleException;
|
import com.raytheon.uf.common.style.StyleException;
|
||||||
import com.raytheon.uf.common.style.StyleManager;
|
import com.raytheon.uf.common.style.StyleManager;
|
||||||
|
@ -58,11 +60,13 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Dec 4, 2007 njensen Initial creation
|
* Dec 04, 2007 njensen Initial creation
|
||||||
* Feb 20, 2009 njensen Refactored to new rsc architecture
|
* Feb 20, 2009 njensen Refactored to new rsc architecture
|
||||||
* Dec 11, 2013 DR 16795 D. Friedman Transform pixel coordinate in inspect
|
* Dec 11, 2013 16795 D. Friedman Transform pixel coordinate in inspect
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -269,8 +273,10 @@ public class TimeHeightImageResource extends AbstractTimeHeightResource
|
||||||
if (sliceData == null) {
|
if (sliceData == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
FloatArrayWrapper source = new FloatArrayWrapper(sliceData, geometry);
|
DataSource source = new FloatBufferWrapper(sliceData,
|
||||||
source.setValidRange(-9998, Double.POSITIVE_INFINITY);
|
geometry.getGridRange2D());
|
||||||
|
source = ValidRangeFilter
|
||||||
|
.apply(source, -9998, Double.POSITIVE_INFINITY);
|
||||||
GridSampler sampler = new GridSampler(source,
|
GridSampler sampler = new GridSampler(source,
|
||||||
new BilinearInterpolation());
|
new BilinearInterpolation());
|
||||||
GridReprojection reproj = new GridReprojection(geometry,
|
GridReprojection reproj = new GridReprojection(geometry,
|
||||||
|
|
|
@ -7,13 +7,14 @@ Bundle-Vendor: Raytheon
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14.1",
|
Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14.1",
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
org.eclipse.ui,
|
org.eclipse.ui;bundle-version="3.8.0",
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.util,
|
com.raytheon.uf.common.util,
|
||||||
com.raytheon.uf.common.wxmath,
|
com.raytheon.uf.common.wxmath,
|
||||||
com.raytheon.uf.common.style,
|
com.raytheon.uf.common.style,
|
||||||
com.raytheon.uf.common.status,
|
com.raytheon.uf.common.status,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
|
||||||
org.apache.commons.collections
|
org.apache.commons.collections
|
||||||
Import-Package: com.raytheon.viz.core.interval
|
Import-Package: com.raytheon.viz.core.interval
|
||||||
Export-Package: com.raytheon.viz.core.contours,
|
Export-Package: com.raytheon.viz.core.contours,
|
||||||
|
|
|
@ -21,7 +21,7 @@ package com.raytheon.viz.core.contours;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||||
import com.raytheon.uf.viz.core.IExtent;
|
import com.raytheon.uf.viz.core.IExtent;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
|
|
|
@ -32,9 +32,13 @@ import org.opengis.coverage.grid.GridEnvelope;
|
||||||
import org.opengis.referencing.operation.MathTransform;
|
import org.opengis.referencing.operation.MathTransform;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities;
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.FillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.InverseFillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||||
import com.raytheon.uf.common.wxmath.Constants;
|
import com.raytheon.uf.common.wxmath.Constants;
|
||||||
import com.raytheon.uf.common.wxmath.DistFilter;
|
import com.raytheon.uf.common.wxmath.DistFilter;
|
||||||
|
@ -325,8 +329,7 @@ public abstract class ContourRenderable implements IRenderable {
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
LoopProperties loopProps = paintProps
|
LoopProperties loopProps = paintProps
|
||||||
.getLoopProperties();
|
.getLoopProperties();
|
||||||
if (loopProps != null && loopProps
|
if (loopProps != null && loopProps.isLooping()) {
|
||||||
.isLooping()) {
|
|
||||||
/**
|
/**
|
||||||
* If the display is looping, wait a few ms to
|
* If the display is looping, wait a few ms to
|
||||||
* let contouring finish so that if the
|
* let contouring finish so that if the
|
||||||
|
@ -452,14 +455,17 @@ public abstract class ContourRenderable implements IRenderable {
|
||||||
// smoothingDistance is in km
|
// smoothingDistance is in km
|
||||||
float npts = (float) (distanceInPoints
|
float npts = (float) (distanceInPoints
|
||||||
* contourPrefs.getSmoothingDistance() / (distanceInM / 1000));
|
* contourPrefs.getSmoothingDistance() / (distanceInM / 1000));
|
||||||
FloatArrayWrapper data = new FloatArrayWrapper(gridGeometry);
|
FloatBufferWrapper data = new FloatBufferWrapper(nx, ny);
|
||||||
data.setFillValue(Constants.LEGACY_NAN);
|
DataDestination dest = InverseFillValueFilter.apply(
|
||||||
DataUtilities.copy(dataRecord[0], data, nx, ny);
|
(DataDestination) data, Constants.LEGACY_NAN);
|
||||||
|
DataUtilities.copy(dataRecord[0], dest, nx, ny);
|
||||||
float[] dataArray = data.getArray();
|
float[] dataArray = data.getArray();
|
||||||
dataArray = DistFilter.filter(dataArray, npts, nx, ny, 1);
|
dataArray = DistFilter.filter(dataArray, npts, nx, ny, 1);
|
||||||
data = new FloatArrayWrapper(dataArray, gridGeometry);
|
data = new FloatBufferWrapper(dataArray, nx, ny);
|
||||||
data.setFillValue(Constants.LEGACY_NAN);
|
DataSource source = FillValueFilter.apply((DataSource) data,
|
||||||
return new DataSource[] {data};
|
Constants.LEGACY_NAN);
|
||||||
|
source = new GeographicDataSource(source, gridGeometry);
|
||||||
|
return new DataSource[] { data };
|
||||||
} else {
|
} else {
|
||||||
return dataRecord;
|
return dataRecord;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,13 +44,13 @@ import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.CRSCache;
|
import com.raytheon.uf.common.geospatial.CRSCache;
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities.MinMax;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.OffsetDataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
||||||
import com.raytheon.uf.common.geospatial.util.WorldWrapChecker;
|
import com.raytheon.uf.common.geospatial.util.WorldWrapChecker;
|
||||||
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
|
import com.raytheon.uf.common.numeric.DataUtilities.MinMax;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
import com.raytheon.uf.common.numeric.source.OffsetDataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -352,7 +352,7 @@ public class ContourSupport {
|
||||||
|
|
||||||
if (copyData) {
|
if (copyData) {
|
||||||
subgridSource = DataUtilities.copy(subgridSource,
|
subgridSource = DataUtilities.copy(subgridSource,
|
||||||
new FloatArrayWrapper(szX, szY), szX, szY);
|
new FloatBufferWrapper(szX, szY), szX, szY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use ported legacy code to determine contour interval
|
// Use ported legacy code to determine contour interval
|
||||||
|
@ -1072,9 +1072,9 @@ public class ContourSupport {
|
||||||
int maxX = (int) (sz[0] - 1);
|
int maxX = (int) (sz[0] - 1);
|
||||||
int maxY = (int) (sz[1] - 1);
|
int maxY = (int) (sz[1] - 1);
|
||||||
|
|
||||||
DataSource uWSource = new FloatArrayWrapper(uW, (int) sz[0],
|
DataSource uWSource = new FloatBufferWrapper(uW, (int) sz[0],
|
||||||
(int) sz[1]);
|
(int) sz[1]);
|
||||||
DataSource vWSource = new FloatArrayWrapper(vW, (int) sz[0],
|
DataSource vWSource = new FloatBufferWrapper(vW, (int) sz[0],
|
||||||
(int) sz[1]);
|
(int) sz[1]);
|
||||||
|
|
||||||
makeStreamLines(uWSource, vWSource, minX, minY, maxX, maxY, sz,
|
makeStreamLines(uWSource, vWSource, minX, minY, maxX, maxY, sz,
|
||||||
|
|
|
@ -24,8 +24,8 @@ import java.nio.FloatBuffer;
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
|
@ -59,7 +59,8 @@ public class GriddedContourDisplay extends ContourRenderable {
|
||||||
|
|
||||||
public GriddedContourDisplay(IMapDescriptor descriptor,
|
public GriddedContourDisplay(IMapDescriptor descriptor,
|
||||||
final GridGeometry2D gridGeometry, final FloatBuffer fb) {
|
final GridGeometry2D gridGeometry, final FloatBuffer fb) {
|
||||||
this(descriptor, gridGeometry, new FloatBufferWrapper(fb, gridGeometry));
|
this(descriptor, gridGeometry, new GeographicDataSource(fb,
|
||||||
|
gridGeometry));
|
||||||
}
|
}
|
||||||
|
|
||||||
public GriddedContourDisplay(IMapDescriptor descriptor,
|
public GriddedContourDisplay(IMapDescriptor descriptor,
|
||||||
|
|
|
@ -23,8 +23,8 @@ import java.nio.FloatBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public class GriddedStreamlineDisplay extends GriddedContourDisplay {
|
||||||
public GriddedStreamlineDisplay(IMapDescriptor descriptor,
|
public GriddedStreamlineDisplay(IMapDescriptor descriptor,
|
||||||
GridGeometry2D gridGeometry, FloatBuffer ufb, FloatBuffer vfb) {
|
GridGeometry2D gridGeometry, FloatBuffer ufb, FloatBuffer vfb) {
|
||||||
super(descriptor, gridGeometry, ufb);
|
super(descriptor, gridGeometry, ufb);
|
||||||
this.vSource = new FloatBufferWrapper(vfb, gridGeometry);
|
this.vSource = new GeographicDataSource(vfb, gridGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GriddedStreamlineDisplay(IMapDescriptor descriptor,
|
public GriddedStreamlineDisplay(IMapDescriptor descriptor,
|
||||||
|
|
|
@ -27,8 +27,8 @@ import org.geotools.referencing.GeodeticCalculator;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.IExtent;
|
import com.raytheon.uf.viz.core.IExtent;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
|
||||||
|
@ -143,8 +143,8 @@ public class GriddedVectorDisplay extends AbstractGriddedDisplay<Coordinate> {
|
||||||
IMapDescriptor descriptor, GeneralGridGeometry gridGeometryOfGrid,
|
IMapDescriptor descriptor, GeneralGridGeometry gridGeometryOfGrid,
|
||||||
double densityFactor, boolean gridRelative,
|
double densityFactor, boolean gridRelative,
|
||||||
DisplayType displayType, VectorGraphicsConfig config) {
|
DisplayType displayType, VectorGraphicsConfig config) {
|
||||||
this(new FloatBufferWrapper(magnitude, gridGeometryOfGrid),
|
this(new GeographicDataSource(magnitude, gridGeometryOfGrid),
|
||||||
new FloatBufferWrapper(direction, gridGeometryOfGrid),
|
new GeographicDataSource(direction, gridGeometryOfGrid),
|
||||||
descriptor, gridGeometryOfGrid, densityFactor, gridRelative,
|
descriptor, gridGeometryOfGrid, densityFactor, gridRelative,
|
||||||
displayType, config);
|
displayType, config);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,10 @@ import java.text.ParseException;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.AxisSwapDataSource;
|
import com.raytheon.uf.common.numeric.array.FloatArray2DWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.filter.InvalidRangeFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArray2DWrapper;
|
import com.raytheon.uf.common.numeric.source.AxisSwapDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.InvalidRangeDataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Port of the fortCon.f routine. Minimal changes made to make it perform better
|
* Port of the fortCon.f routine. Minimal changes made to make it perform better
|
||||||
|
@ -116,7 +116,7 @@ public class FortConBuf {
|
||||||
DataSource source = new FloatArray2DWrapper(data, nx, ny);
|
DataSource source = new FloatArray2DWrapper(data, nx, ny);
|
||||||
source = new AxisSwapDataSource(source);
|
source = new AxisSwapDataSource(source);
|
||||||
if (config.badlo < config.badhi) {
|
if (config.badlo < config.badhi) {
|
||||||
source = new InvalidRangeDataSource(source, config.badlo,
|
source = InvalidRangeFilter.apply(source, config.badlo,
|
||||||
config.badhi);
|
config.badhi);
|
||||||
}
|
}
|
||||||
return contour(source, ny, nx, config);
|
return contour(source, ny, nx, config);
|
||||||
|
|
|
@ -24,9 +24,9 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.AxisSwapDataSource;
|
import com.raytheon.uf.common.numeric.array.FloatArray2DWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.AxisSwapDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArray2DWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.viz.core.contours.util.StreamLineContainer.StreamLinePoint;
|
import com.raytheon.viz.core.contours.util.StreamLineContainer.StreamLinePoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,23 +2,21 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Viz Data Access
|
Bundle-Name: Viz Data Access
|
||||||
Bundle-SymbolicName: com.raytheon.viz.dataaccess
|
Bundle-SymbolicName: com.raytheon.viz.dataaccess
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.viz.dataaccess.Activator
|
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Eclipse-BuddyPolicy: ext, global
|
Bundle-ActivationPolicy: lazy
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui;bundle-version="3.8.0",
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
com.raytheon.uf.viz.core;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
com.raytheon.uf.common.time;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
||||||
com.raytheon.viz.core;bundle-version="1.12.1174",
|
com.raytheon.viz.core;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
||||||
javax.measure;bundle-version="1.0.0",
|
javax.measure;bundle-version="1.0.0",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0",
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-ActivationPolicy: lazy
|
|
||||||
Export-Package: com.raytheon.viz.dataaccess.rsc,
|
Export-Package: com.raytheon.viz.dataaccess.rsc,
|
||||||
com.raytheon.viz.dataaccess.rsc.geometry,
|
com.raytheon.viz.dataaccess.rsc.geometry,
|
||||||
com.raytheon.viz.dataaccess.rsc.grid
|
com.raytheon.viz.dataaccess.rsc.grid
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
com.raytheon.viz.dataaccess.rsc.grid.GenericGridResourceData
|
|
||||||
com.raytheon.viz.dataaccess.rsc.geometry.GenericGeometryResourceData
|
|
|
@ -1,50 +0,0 @@
|
||||||
package com.raytheon.viz.dataaccess;
|
|
||||||
|
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The activator class controls the plug-in life cycle
|
|
||||||
*/
|
|
||||||
public class Activator extends AbstractUIPlugin {
|
|
||||||
|
|
||||||
// The plug-in ID
|
|
||||||
public static final String PLUGIN_ID = "com.raytheon.viz.dataaccess"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
// The shared instance
|
|
||||||
private static Activator plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constructor
|
|
||||||
*/
|
|
||||||
public Activator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
||||||
*/
|
|
||||||
public void start(BundleContext context) throws Exception {
|
|
||||||
super.start(context);
|
|
||||||
plugin = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
||||||
*/
|
|
||||||
public void stop(BundleContext context) throws Exception {
|
|
||||||
plugin = null;
|
|
||||||
super.stop(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shared instance
|
|
||||||
*
|
|
||||||
* @return the shared instance
|
|
||||||
*/
|
|
||||||
public static Activator getDefault() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -33,7 +33,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||||
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
||||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.style.StyleException;
|
import com.raytheon.uf.common.style.StyleException;
|
||||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||||
import com.raytheon.uf.common.style.level.Level.LevelType;
|
import com.raytheon.uf.common.style.level.Level.LevelType;
|
||||||
|
@ -56,10 +56,12 @@ import com.raytheon.viz.dataaccess.rsc.AbstractDataAccessResource;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Jan 8, 2013 bkowal Initial creation
|
* Jan 8, 2013 bkowal Initial creation
|
||||||
* Jan 31, 2013 #1555 bkowal Refactor
|
* Jan 31, 2013 1555 bkowal Refactor
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -96,7 +98,8 @@ public class GenericGridResource extends
|
||||||
GridGeometry2D gridGeometry = gridData.getGridGeometry();
|
GridGeometry2D gridGeometry = gridData.getGridGeometry();
|
||||||
|
|
||||||
// Extract the raw data
|
// Extract the raw data
|
||||||
FloatBufferWrapper bufferWrapper = new FloatBufferWrapper(gridGeometry);
|
FloatBufferWrapper bufferWrapper = new FloatBufferWrapper(
|
||||||
|
gridGeometry.getGridRange2D());
|
||||||
bufferWrapper = gridData.populateData(bufferWrapper);
|
bufferWrapper = gridData.populateData(bufferWrapper);
|
||||||
Buffer buffer = bufferWrapper.getBuffer();
|
Buffer buffer = bufferWrapper.getBuffer();
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.activetable,
|
com.raytheon.uf.common.activetable,
|
||||||
com.raytheon.uf.viz.image.export;bundle-version="1.14.0",
|
com.raytheon.uf.viz.image.export;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.viz.kml.export
|
com.raytheon.uf.viz.kml.export;bundle-version="1.14.1",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.viz.gfe,
|
Export-Package: com.raytheon.viz.gfe,
|
||||||
com.raytheon.viz.gfe.constants,
|
com.raytheon.viz.gfe.constants,
|
||||||
|
|
|
@ -1,54 +1,48 @@
|
||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Grid Plug-in
|
Bundle-Name: Grid Display Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.viz.grid;singleton:=true
|
Bundle-SymbolicName: com.raytheon.viz.grid;singleton:=true
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.viz.grid.Activator
|
|
||||||
Bundle-Vendor: Raytheon
|
Bundle-Vendor: Raytheon
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core, com.raytheon.uf.common.dataplugin.grid.coverage
|
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core, com.raytheon.uf.common.dataplugin.grid.coverage
|
||||||
Eclipse-BuddyPolicy: ext, global
|
Eclipse-BuddyPolicy: ext, global
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui;bundle-version="3.8.0",
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
javax.measure,
|
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.13.0";visibility:=reexport,
|
||||||
org.geotools,
|
com.raytheon.uf.viz.core;bundle-version="1.14.2",
|
||||||
com.raytheon.viz.core.contours,
|
|
||||||
com.raytheon.viz.pointdata,
|
|
||||||
com.raytheon.uf.viz.core,
|
|
||||||
com.raytheon.uf.common.dataplugin,
|
com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.datastorage,
|
com.raytheon.uf.common.datastorage,
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
|
com.raytheon.viz.core.contours;bundle-version="1.14.0",
|
||||||
|
com.raytheon.viz.pointdata,
|
||||||
com.raytheon.viz.radar,
|
com.raytheon.viz.radar,
|
||||||
com.raytheon.uf.viz.productbrowser,
|
com.raytheon.uf.viz.productbrowser,
|
||||||
com.raytheon.uf.common.dataplugin.radar,
|
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.viz.points,
|
com.raytheon.uf.viz.points,
|
||||||
com.raytheon.uf.common.gridcoverage,
|
|
||||||
com.raytheon.uf.common.dataplugin.grid,
|
|
||||||
com.raytheon.uf.common.dataplugin.level,
|
|
||||||
com.raytheon.uf.common.colormap,
|
com.raytheon.uf.common.colormap,
|
||||||
com.raytheon.uf.viz.derivparam
|
com.raytheon.uf.viz.derivparam;bundle-version="1.14.0",
|
||||||
Bundle-ActivationPolicy: lazy
|
com.raytheon.uf.common.style,
|
||||||
|
com.raytheon.uf.common.localization;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.status,
|
||||||
|
com.raytheon.uf.common.serialization,
|
||||||
|
com.raytheon.uf.common.serialization.comm,
|
||||||
|
com.raytheon.uf.common.dataquery,
|
||||||
|
com.raytheon.uf.common.comm,
|
||||||
|
com.raytheon.uf.common.derivparam,
|
||||||
|
com.raytheon.uf.common.pointdata;bundle-version="1.13.0",
|
||||||
|
com.raytheon.uf.viz.d2d.core,
|
||||||
|
com.raytheon.uf.common.topo;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
|
||||||
|
javax.measure
|
||||||
Export-Package: com.raytheon.viz.grid,
|
Export-Package: com.raytheon.viz.grid,
|
||||||
com.raytheon.viz.grid.inv,
|
com.raytheon.viz.grid.inv,
|
||||||
com.raytheon.viz.grid.rsc,
|
com.raytheon.viz.grid.rsc,
|
||||||
com.raytheon.viz.grid.rsc.general,
|
com.raytheon.viz.grid.rsc.general,
|
||||||
com.raytheon.viz.grid.util,
|
com.raytheon.viz.grid.util,
|
||||||
com.raytheon.viz.grid.xml
|
com.raytheon.viz.grid.xml
|
||||||
Import-Package: com.raytheon.uf.common.comm,
|
Import-Package: com.raytheon.viz.alerts,
|
||||||
com.raytheon.uf.common.derivparam.tree,
|
|
||||||
com.raytheon.uf.common.localization,
|
|
||||||
com.raytheon.uf.common.parameter,
|
|
||||||
com.raytheon.uf.common.pointdata,
|
|
||||||
com.raytheon.uf.common.serialization,
|
|
||||||
com.raytheon.uf.common.style,
|
|
||||||
com.raytheon.uf.common.style.arrow,
|
|
||||||
com.raytheon.uf.common.style.contour,
|
|
||||||
com.raytheon.uf.common.style.image,
|
|
||||||
com.raytheon.uf.common.style.level,
|
|
||||||
com.raytheon.uf.common.time,
|
|
||||||
com.raytheon.uf.common.topo,
|
|
||||||
com.raytheon.uf.viz.d2d.core.map,
|
|
||||||
com.raytheon.viz.alerts,
|
|
||||||
com.raytheon.viz.alerts.observers,
|
com.raytheon.viz.alerts.observers,
|
||||||
com.raytheon.viz.core.rsc,
|
com.raytheon.viz.core.rsc,
|
||||||
com.raytheon.viz.core.rsc.displays
|
com.raytheon.viz.core.units
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.viz.grid;
|
|
||||||
|
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
||||||
import org.osgi.framework.BundleContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The activator class controls the plug-in life cycle
|
|
||||||
*/
|
|
||||||
public class Activator extends AbstractUIPlugin {
|
|
||||||
|
|
||||||
// The plug-in ID
|
|
||||||
public static final String PLUGIN_ID = "com.raytheon.viz.grid";
|
|
||||||
|
|
||||||
// The shared instance
|
|
||||||
private static Activator plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constructor
|
|
||||||
*/
|
|
||||||
public Activator() {
|
|
||||||
plugin = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public void start(BundleContext context) throws Exception {
|
|
||||||
super.start(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public void stop(BundleContext context) throws Exception {
|
|
||||||
plugin = null;
|
|
||||||
super.stop(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the shared instance
|
|
||||||
*
|
|
||||||
* @return the shared instance
|
|
||||||
*/
|
|
||||||
public static Activator getDefault() {
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -29,7 +29,7 @@ import java.util.Map;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
|
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
|
||||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import javax.measure.unit.UnitFormat;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.raytheon.viz.grid.rsc.general.D2DGridResource;
|
import com.raytheon.viz.grid.rsc.general.D2DGridResource;
|
||||||
|
|
|
@ -46,9 +46,9 @@ import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities;
|
import com.raytheon.uf.common.numeric.DataUtilities.MinMax;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities.MinMax;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
|
@ -45,12 +45,12 @@ import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
||||||
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
||||||
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
import com.raytheon.uf.common.gridcoverage.GridCoverage;
|
||||||
import com.raytheon.uf.common.gridcoverage.LatLonGridCoverage;
|
import com.raytheon.uf.common.gridcoverage.LatLonGridCoverage;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -233,7 +233,7 @@ public class D2DGridResource extends GridResource<GridResourceData> implements
|
||||||
.getCoordinateReferenceSystem());
|
.getCoordinateReferenceSystem());
|
||||||
DataSource oldScalar = data.getScalarData();
|
DataSource oldScalar = data.getScalarData();
|
||||||
FloatBufferWrapper newScalar = new FloatBufferWrapper(
|
FloatBufferWrapper newScalar = new FloatBufferWrapper(
|
||||||
gridGeometry);
|
gridGeometry.getGridRange2D());
|
||||||
for (int i = 0; i < gridRange.width; i++) {
|
for (int i = 0; i < gridRange.width; i++) {
|
||||||
for (int j = 0; j < gridRange.height; j++) {
|
for (int j = 0; j < gridRange.height; j++) {
|
||||||
double dir = oldScalar.getDataValue(i, j);
|
double dir = oldScalar.getDataValue(i, j);
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.opengis.referencing.operation.TransformException;
|
||||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||||
import com.raytheon.uf.common.time.CombinedDataTime;
|
import com.raytheon.uf.common.time.CombinedDataTime;
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
|
|
|
@ -38,16 +38,16 @@ import org.opengis.referencing.operation.MathTransform;
|
||||||
import org.opengis.referencing.operation.TransformException;
|
import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
|
import com.raytheon.uf.common.geospatial.data.UnitConvertingDataFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojectionDataSource;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojectionDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.Interpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.source.OffsetDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.OffsetDataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnitConvertingDataSource;
|
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -85,11 +85,11 @@ public class GeneralGridData {
|
||||||
|
|
||||||
private GridGeometry2D gridGeometry;
|
private GridGeometry2D gridGeometry;
|
||||||
|
|
||||||
private DataSource scalarData;
|
private GeographicDataSource scalarData;
|
||||||
|
|
||||||
private DataSource uComponent = null;
|
private GeographicDataSource uComponent = null;
|
||||||
|
|
||||||
private DataSource vComponent = null;
|
private GeographicDataSource vComponent = null;
|
||||||
|
|
||||||
private Unit<?> dataUnit;
|
private Unit<?> dataUnit;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class GeneralGridData {
|
||||||
public static GeneralGridData createScalarData(
|
public static GeneralGridData createScalarData(
|
||||||
GeneralGridGeometry gridGeometry, FloatBuffer scalarData,
|
GeneralGridGeometry gridGeometry, FloatBuffer scalarData,
|
||||||
Unit<?> dataUnit) {
|
Unit<?> dataUnit) {
|
||||||
DataSource scalarSource = new FloatBufferWrapper(scalarData,
|
DataSource scalarSource = new GeographicDataSource(scalarData,
|
||||||
gridGeometry);
|
gridGeometry);
|
||||||
return createScalarData(gridGeometry, scalarSource, dataUnit);
|
return createScalarData(gridGeometry, scalarSource, dataUnit);
|
||||||
}
|
}
|
||||||
|
@ -159,8 +159,8 @@ public class GeneralGridData {
|
||||||
public static GeneralGridData createVectorDataUV(
|
public static GeneralGridData createVectorDataUV(
|
||||||
GeneralGridGeometry gridGeometry, FloatBuffer uComponent,
|
GeneralGridGeometry gridGeometry, FloatBuffer uComponent,
|
||||||
FloatBuffer vComponent, Unit<?> dataUnit) {
|
FloatBuffer vComponent, Unit<?> dataUnit) {
|
||||||
DataSource uSource = new FloatBufferWrapper(uComponent, gridGeometry);
|
DataSource uSource = new GeographicDataSource(uComponent, gridGeometry);
|
||||||
DataSource vSource = new FloatBufferWrapper(vComponent, gridGeometry);
|
DataSource vSource = new GeographicDataSource(vComponent, gridGeometry);
|
||||||
return createVectorDataUV(gridGeometry, uSource, vSource, dataUnit);
|
return createVectorDataUV(gridGeometry, uSource, vSource, dataUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,15 +183,18 @@ public class GeneralGridData {
|
||||||
private GeneralGridData(GeneralGridGeometry gridGeometry,
|
private GeneralGridData(GeneralGridGeometry gridGeometry,
|
||||||
DataSource scalarData, Unit<?> dataUnit) {
|
DataSource scalarData, Unit<?> dataUnit) {
|
||||||
this.gridGeometry = GridGeometry2D.wrap(gridGeometry);
|
this.gridGeometry = GridGeometry2D.wrap(gridGeometry);
|
||||||
this.scalarData = scalarData;
|
this.scalarData = GeographicDataSource.wrap(scalarData,
|
||||||
|
this.gridGeometry);
|
||||||
this.dataUnit = dataUnit;
|
this.dataUnit = dataUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GeneralGridData(GeneralGridGeometry gridGeometry,
|
private GeneralGridData(GeneralGridGeometry gridGeometry,
|
||||||
DataSource uComponent, DataSource vComponent, Unit<?> dataUnit) {
|
DataSource uComponent, DataSource vComponent, Unit<?> dataUnit) {
|
||||||
this.gridGeometry = GridGeometry2D.wrap(gridGeometry);
|
this.gridGeometry = GridGeometry2D.wrap(gridGeometry);
|
||||||
this.uComponent = uComponent;
|
this.uComponent = GeographicDataSource.wrap(uComponent,
|
||||||
this.vComponent = vComponent;
|
this.gridGeometry);
|
||||||
|
this.vComponent = GeographicDataSource.wrap(vComponent,
|
||||||
|
this.gridGeometry);
|
||||||
this.dataUnit = dataUnit;
|
this.dataUnit = dataUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,15 +219,17 @@ public class GeneralGridData {
|
||||||
// no need to actually convert if they are the same.
|
// no need to actually convert if they are the same.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
UnitConvertingDataFilter filter = new UnitConvertingDataFilter(
|
||||||
|
converter);
|
||||||
if (scalarData != null) {
|
if (scalarData != null) {
|
||||||
scalarData = new UnitConvertingDataSource(converter, scalarData);
|
scalarData = scalarData.applyFilters(filter);
|
||||||
}
|
}
|
||||||
if (uComponent != null) {
|
if (uComponent != null) {
|
||||||
uComponent = new UnitConvertingDataSource(converter, uComponent);
|
uComponent = uComponent.applyFilters(filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (vComponent != null) {
|
if (vComponent != null) {
|
||||||
vComponent = new UnitConvertingDataSource(converter, vComponent);
|
vComponent = vComponent.applyFilters(filter);
|
||||||
}
|
}
|
||||||
dataUnit = unit;
|
dataUnit = unit;
|
||||||
return true;
|
return true;
|
||||||
|
@ -249,10 +254,12 @@ public class GeneralGridData {
|
||||||
if (isVector()) {
|
if (isVector()) {
|
||||||
sampler.setSource(getUComponent());
|
sampler.setSource(getUComponent());
|
||||||
float[] udata = reproj.reprojectedGrid(sampler,
|
float[] udata = reproj.reprojectedGrid(sampler,
|
||||||
new FloatArrayWrapper(newGeom)).getArray();
|
new FloatBufferWrapper(newGeom.getGridRange2D()))
|
||||||
|
.getArray();
|
||||||
sampler.setSource(getVComponent());
|
sampler.setSource(getVComponent());
|
||||||
float[] vdata = reproj.reprojectedGrid(sampler,
|
float[] vdata = reproj.reprojectedGrid(sampler,
|
||||||
new FloatArrayWrapper(newGeom)).getArray();
|
new FloatBufferWrapper(newGeom.getGridRange2D()))
|
||||||
|
.getArray();
|
||||||
// When reprojecting it is necessary to recalculate the
|
// When reprojecting it is necessary to recalculate the
|
||||||
// direction of vectors based off the change in the "up"
|
// direction of vectors based off the change in the "up"
|
||||||
// direction
|
// direction
|
||||||
|
@ -299,11 +306,12 @@ public class GeneralGridData {
|
||||||
return (uComponent != null && vComponent != null);
|
return (uComponent != null && vComponent != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSource getMagnitude() {
|
public GeographicDataSource getMagnitude() {
|
||||||
return new MagnitudeDataSource(uComponent, vComponent);
|
DataSource rawSource = new MagnitudeDataSource(uComponent, vComponent);
|
||||||
|
return new GeographicDataSource(rawSource, this.gridGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSource getScalarData() {
|
public GeographicDataSource getScalarData() {
|
||||||
if (isVector()) {
|
if (isVector()) {
|
||||||
return getMagnitude();
|
return getMagnitude();
|
||||||
} else {
|
} else {
|
||||||
|
@ -318,8 +326,10 @@ public class GeneralGridData {
|
||||||
* wind is coming from the north and moving to the south.
|
* wind is coming from the north and moving to the south.
|
||||||
* @see #getDirectionTo()
|
* @see #getDirectionTo()
|
||||||
*/
|
*/
|
||||||
public DataSource getDirectionFrom() {
|
public GeographicDataSource getDirectionFrom() {
|
||||||
return new DirectionFromDataSource(uComponent, vComponent);
|
DataSource rawSource = new DirectionFromDataSource(uComponent,
|
||||||
|
vComponent);
|
||||||
|
return new GeographicDataSource(rawSource, this.gridGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -327,15 +337,16 @@ public class GeneralGridData {
|
||||||
* mathematical deffinition of a vector.
|
* mathematical deffinition of a vector.
|
||||||
* @see #getDirectionFrom()
|
* @see #getDirectionFrom()
|
||||||
*/
|
*/
|
||||||
public DataSource getDirectionTo() {
|
public GeographicDataSource getDirectionTo() {
|
||||||
return new DirectionToDataSource(uComponent, vComponent);
|
DataSource rawSource = new DirectionToDataSource(uComponent, vComponent);
|
||||||
|
return new GeographicDataSource(rawSource, this.gridGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSource getUComponent() {
|
public GeographicDataSource getUComponent() {
|
||||||
return uComponent;
|
return uComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSource getVComponent() {
|
public GeographicDataSource getVComponent() {
|
||||||
return vComponent;
|
return vComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ import java.util.regex.Pattern;
|
||||||
import org.geotools.coverage.grid.GridEnvelope2D;
|
import org.geotools.coverage.grid.GridEnvelope2D;
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataUtilities;
|
import com.raytheon.uf.common.numeric.DataUtilities;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -166,11 +166,11 @@ public class GridMemoryManager {
|
||||||
dataBuffer.position(0);
|
dataBuffer.position(0);
|
||||||
dataBuffer.limit(numGridPoints);
|
dataBuffer.limit(numGridPoints);
|
||||||
FloatBufferWrapper uWrapper = new FloatBufferWrapper(
|
FloatBufferWrapper uWrapper = new FloatBufferWrapper(
|
||||||
dataBuffer.slice(), gridGeometry);
|
dataBuffer.slice(), gridRange);
|
||||||
dataBuffer.position(numGridPoints);
|
dataBuffer.position(numGridPoints);
|
||||||
dataBuffer.limit(numGridPoints * 2);
|
dataBuffer.limit(numGridPoints * 2);
|
||||||
FloatBufferWrapper vWrapper = new FloatBufferWrapper(
|
FloatBufferWrapper vWrapper = new FloatBufferWrapper(
|
||||||
dataBuffer.slice(), gridGeometry);
|
dataBuffer.slice(), gridRange);
|
||||||
DataUtilities.copy(data.getUComponent(), uWrapper,
|
DataUtilities.copy(data.getUComponent(), uWrapper,
|
||||||
gridRange.width, gridRange.height);
|
gridRange.width, gridRange.height);
|
||||||
DataUtilities.copy(data.getVComponent(), vWrapper,
|
DataUtilities.copy(data.getVComponent(), vWrapper,
|
||||||
|
@ -179,7 +179,7 @@ public class GridMemoryManager {
|
||||||
uWrapper, vWrapper, data.getDataUnit());
|
uWrapper, vWrapper, data.getDataUnit());
|
||||||
} else {
|
} else {
|
||||||
FloatBufferWrapper wrapper = new FloatBufferWrapper(dataBuffer,
|
FloatBufferWrapper wrapper = new FloatBufferWrapper(dataBuffer,
|
||||||
gridGeometry);
|
gridRange);
|
||||||
DataUtilities.copy(data.getScalarData(), wrapper,
|
DataUtilities.copy(data.getScalarData(), wrapper,
|
||||||
gridRange.width, gridRange.height);
|
gridRange.width, gridRange.height);
|
||||||
data = GeneralGridData.createScalarData(gridGeometry, wrapper,
|
data = GeneralGridData.createScalarData(gridGeometry, wrapper,
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: MPE Ui Plug-in
|
Bundle-Name: MPE Ui Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.viz.mpe.ui;singleton:=true
|
Bundle-SymbolicName: com.raytheon.viz.mpe.ui;singleton:=true
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Activator: com.raytheon.viz.mpe.ui.Activator
|
Bundle-Activator: com.raytheon.viz.mpe.ui.Activator
|
||||||
Bundle-Vendor: Raytheon
|
Bundle-Vendor: Raytheon
|
||||||
Require-Bundle: org.eclipse.ui,
|
Require-Bundle: org.eclipse.ui,
|
||||||
|
@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
|
||||||
com.raytheon.uf.viz.application,
|
com.raytheon.uf.viz.application,
|
||||||
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.viz.core.rsc;bundle-version="1.0.0",
|
com.raytheon.uf.viz.core.rsc;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
com.raytheon.uf.common.style;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.viz.mpe.ui.dialogs.gagetable.xml,
|
Export-Package: com.raytheon.viz.mpe.ui.dialogs.gagetable.xml,
|
||||||
com.raytheon.viz.mpe.ui.displays,
|
com.raytheon.viz.mpe.ui.displays,
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Satellite Plug-in
|
Bundle-Name: Satellite Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.edex.plugin.satellite
|
Bundle-SymbolicName: com.raytheon.edex.plugin.satellite
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Export-Package: com.raytheon.edex.plugin.satellite,
|
Export-Package: com.raytheon.edex.plugin.satellite,
|
||||||
|
@ -13,7 +13,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||||
|
@ -22,6 +22,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.awipstools;bundle-version="1.12.1174",
|
com.raytheon.uf.common.awipstools;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.edex.database;bundle-version="1.0.0",
|
com.raytheon.uf.edex.database;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.edex.menus;bundle-version="1.0.0"
|
com.raytheon.uf.edex.menus;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Import-Package: com.raytheon.edex.exception,
|
Import-Package: com.raytheon.edex.exception,
|
||||||
org.apache.commons.logging
|
org.apache.commons.logging
|
||||||
|
|
|
@ -43,12 +43,11 @@ import com.raytheon.uf.common.datastorage.StorageException;
|
||||||
import com.raytheon.uf.common.datastorage.StorageProperties;
|
import com.raytheon.uf.common.datastorage.StorageProperties;
|
||||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridDownscaler;
|
import com.raytheon.uf.common.geospatial.interpolation.GridDownscaler;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.time.TimeRange;
|
import com.raytheon.uf.common.time.TimeRange;
|
||||||
import com.raytheon.uf.edex.core.dataplugin.PluginRegistry;
|
import com.raytheon.uf.edex.core.dataplugin.PluginRegistry;
|
||||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||||
import com.raytheon.uf.edex.database.plugin.DataRecordWrapUtil;
|
|
||||||
import com.raytheon.uf.edex.database.plugin.DownscaleStoreUtil;
|
import com.raytheon.uf.edex.database.plugin.DownscaleStoreUtil;
|
||||||
import com.raytheon.uf.edex.database.plugin.DownscaleStoreUtil.IDataRecordCreator;
|
import com.raytheon.uf.edex.database.plugin.DownscaleStoreUtil.IDataRecordCreator;
|
||||||
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
||||||
|
@ -61,17 +60,18 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Feb 11, 2009 bphillip Initial creation
|
* Feb 11, 2009 bphillip Initial creation
|
||||||
* - AWIPS2 Baseline Repository --------
|
* Jul 09, 2012 798 jkorman Modified datastore population.
|
||||||
* 07/09/2012 798 jkorman Modified datastore population.
|
* Mar 25, 2013 1823 dgilling Modified getSatelliteData() and
|
||||||
* 03/25/2013 1823 dgilling Modified getSatelliteData() and
|
* getSatelliteInventory() to allow optional
|
||||||
* getSatelliteInventory() to allow optional
|
* input arguments.
|
||||||
* input arguments.
|
* Jun 24, 2013 2044 randerso Added methods to get data by TimeRange and
|
||||||
* 06/24/2013 2044 randerso Added methods to get data by TimeRange and
|
* getInventory with maxRecord limit
|
||||||
* getInventory with maxRecord limit
|
* Nov 14, 2013 2393 bclement moved interpolation code to parent class
|
||||||
* Nov 14, 2013 2393 bclement moved interpolation code to parent class
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bphillip
|
* @author bphillip
|
||||||
|
@ -148,8 +148,8 @@ public class SatelliteDao extends PluginDao {
|
||||||
coverage.getGridGeometry());
|
coverage.getGridGeometry());
|
||||||
|
|
||||||
Rectangle fullScale = downScaler.getDownscaleSize(0);
|
Rectangle fullScale = downScaler.getDownscaleSize(0);
|
||||||
DataWrapper1D dataSource = DataRecordWrapUtil.wrap(
|
BufferWrapper dataSource = BufferWrapper.wrapArray(
|
||||||
storageRecord, fullScale.width, fullScale.height, true);
|
storageRecord.getDataObject(), fullScale.width, fullScale.height);
|
||||||
|
|
||||||
int levels = DownscaleStoreUtil.storeInterpolated(dataStore,
|
int levels = DownscaleStoreUtil.storeInterpolated(dataStore,
|
||||||
downScaler, dataSource,
|
downScaler, dataSource,
|
||||||
|
@ -173,6 +173,12 @@ public class SatelliteDao extends PluginDao {
|
||||||
// always the same fill value
|
// always the same fill value
|
||||||
return fillValue;
|
return fillValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSigned() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// set the number of levels in the 'parent' satellite data.
|
// set the number of levels in the 'parent' satellite data.
|
||||||
satRecord.setInterpolationLevels(levels);
|
satRecord.setInterpolationLevels(levels);
|
||||||
|
@ -513,7 +519,7 @@ public class SatelliteDao extends PluginDao {
|
||||||
* @throws PluginException
|
* @throws PluginException
|
||||||
*/
|
*/
|
||||||
private IDataRecord createDataRecord(SatelliteRecord satRec, Object data,
|
private IDataRecord createDataRecord(SatelliteRecord satRec, Object data,
|
||||||
int downscaleLevel, Rectangle size) throws StorageException {
|
int downscaleLevel, Rectangle size) {
|
||||||
SatelliteMessageData msgData = null;
|
SatelliteMessageData msgData = null;
|
||||||
msgData = new SatelliteMessageData(data, size.width, size.height);
|
msgData = new SatelliteMessageData(data, size.width, size.height);
|
||||||
IDataRecord rec = msgData.getStorageRecord(satRec,
|
IDataRecord rec = msgData.getStorageRecord(satRec,
|
||||||
|
|
|
@ -104,6 +104,12 @@
|
||||||
install-size="0"
|
install-size="0"
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<plugin
|
||||||
|
id="com.raytheon.uf.common.numeric"
|
||||||
|
download-size="0"
|
||||||
|
install-size="0"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="com.raytheon.uf.common.geospatial"
|
id="com.raytheon.uf.common.geospatial"
|
||||||
download-size="0"
|
download-size="0"
|
||||||
|
|
|
@ -2,12 +2,12 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Dataaccess
|
Bundle-Name: Dataaccess
|
||||||
Bundle-SymbolicName: com.raytheon.uf.common.dataaccess
|
Bundle-SymbolicName: com.raytheon.uf.common.dataaccess
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Require-Bundle: com.raytheon.uf.common.time;visibility:=reexport,
|
Require-Bundle: com.raytheon.uf.common.time;visibility:=reexport,
|
||||||
com.raytheon.uf.common.datastorage,
|
com.raytheon.uf.common.datastorage,
|
||||||
com.raytheon.uf.common.geospatial;visibility:=reexport,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0";visibility:=reexport,
|
||||||
javax.measure;bundle-version="1.0.0",
|
javax.measure;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataplugin.level;visibility:=reexport,
|
com.raytheon.uf.common.dataplugin.level;visibility:=reexport,
|
||||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
|
@ -15,7 +15,8 @@ Require-Bundle: com.raytheon.uf.common.time;visibility:=reexport,
|
||||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.message;bundle-version="1.12.1174"
|
com.raytheon.uf.common.message;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Export-Package: com.raytheon.uf.common.dataaccess,
|
Export-Package: com.raytheon.uf.common.dataaccess,
|
||||||
com.raytheon.uf.common.dataaccess.exception,
|
com.raytheon.uf.common.dataaccess.exception,
|
||||||
com.raytheon.uf.common.dataaccess.geom,
|
com.raytheon.uf.common.dataaccess.geom,
|
||||||
|
|
|
@ -24,8 +24,8 @@ import javax.measure.unit.Unit;
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataaccess.IData;
|
import com.raytheon.uf.common.dataaccess.IData;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.geospatial.data.UnitConvertingDataFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnitConvertingDataDestination;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An IGridData represents data that is gridded, ie rectangular (when not
|
* An IGridData represents data that is gridded, ie rectangular (when not
|
||||||
|
@ -33,7 +33,7 @@ import com.raytheon.uf.common.geospatial.interpolation.data.UnitConvertingDataDe
|
||||||
*
|
*
|
||||||
* To get the data values out of the IGridData, use
|
* To get the data values out of the IGridData, use
|
||||||
* populateData(DataDestination) with a DataDestination in the format you are
|
* populateData(DataDestination) with a DataDestination in the format you are
|
||||||
* looking for. You can also use a {@link UnitConvertingDataDestination} to
|
* looking for. You can also use a {@link UnitConvertingDataFilter} to
|
||||||
* obtain the data in a specific unit.
|
* obtain the data in a specific unit.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -78,7 +78,7 @@ public interface IGridData extends IData {
|
||||||
* Populates the DataDestination argument with the raw data converted to the
|
* Populates the DataDestination argument with the raw data converted to the
|
||||||
* type to match the DataDestination. The destination must not be null. If
|
* type to match the DataDestination. The destination must not be null. If
|
||||||
* unit conversions are desired, use the
|
* unit conversions are desired, use the
|
||||||
* {@link UnitConvertingDataDestination} to specify what unit conversion
|
* {@link UnitConvertingDataFilter} to specify what unit conversion
|
||||||
* should be applied to the data.
|
* should be applied to the data.
|
||||||
*
|
*
|
||||||
* @param destination
|
* @param destination
|
||||||
|
|
|
@ -38,8 +38,8 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||||
import com.raytheon.uf.common.datastorage.Request;
|
import com.raytheon.uf.common.datastorage.Request;
|
||||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.vividsolutions.jts.geom.Envelope;
|
import com.vividsolutions.jts.geom.Envelope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,8 +28,8 @@ import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
||||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.time.DataTime;
|
import com.raytheon.uf.common.time.DataTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,9 +23,9 @@ import javax.measure.unit.Unit;
|
||||||
import javax.measure.unit.UnitFormat;
|
import javax.measure.unit.UnitFormat;
|
||||||
|
|
||||||
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.geospatial.data.UnitConvertingDataFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnitConvertingDataDestination;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ public class GridResponseData extends AbstractResponseData {
|
||||||
parameter = data.getParameter();
|
parameter = data.getParameter();
|
||||||
|
|
||||||
Unit<?> dataUnit = data.getUnit();
|
Unit<?> dataUnit = data.getUnit();
|
||||||
FloatArrayWrapper dataGrid = new FloatArrayWrapper(
|
FloatBufferWrapper dataGrid = new FloatBufferWrapper(data
|
||||||
data.getGridGeometry());
|
.getGridGeometry().getGridRange2D());
|
||||||
DataDestination dataDest = dataGrid;
|
DataDestination dataDest = dataGrid;
|
||||||
if (data.getUnit() != null) {
|
if (data.getUnit() != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -86,8 +86,8 @@ public class GridResponseData extends AbstractResponseData {
|
||||||
Unit<?> stdUnit = dataUnit.getStandardUnit();
|
Unit<?> stdUnit = dataUnit.getStandardUnit();
|
||||||
try {
|
try {
|
||||||
this.unit = UnitFormat.getUCUMInstance().format(stdUnit);
|
this.unit = UnitFormat.getUCUMInstance().format(stdUnit);
|
||||||
dataDest = new UnitConvertingDataDestination(
|
dataDest = UnitConvertingDataFilter.apply(dataDest,
|
||||||
dataUnit.toStandardUnit(), dataDest);
|
dataUnit.toStandardUnit());
|
||||||
} catch (IllegalArgumentException e2) {
|
} catch (IllegalArgumentException e2) {
|
||||||
/*
|
/*
|
||||||
* The standard unit is also unstringable so treat the data
|
* The standard unit is also unstringable so treat the data
|
||||||
|
|
|
@ -19,18 +19,13 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.dataaccess.util;
|
package com.raytheon.uf.common.dataaccess.util;
|
||||||
|
|
||||||
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
|
|
||||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
|
||||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
|
||||||
import com.raytheon.uf.common.datastorage.records.ShortDataRecord;
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D;
|
import com.raytheon.uf.common.numeric.filter.FillValueFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.filter.UnsignedFilter;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.IntArrayWrapper;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ShortArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedByteArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedShortArrayWrapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This methods in this utility may eventually be added to an abstract class.
|
* This methods in this utility may eventually be added to an abstract class.
|
||||||
|
@ -46,9 +41,11 @@ import com.raytheon.uf.common.geospatial.interpolation.data.UnsignedShortArrayWr
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Jan 03, 2012 bkowal Initial creation
|
* Jan 03, 2012 bkowal Initial creation
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move Data Source/Destination to numeric
|
||||||
|
* plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -70,58 +67,31 @@ public final class DataWrapperUtil {
|
||||||
* @param dataRecord the IDataRecord with raw data
|
* @param dataRecord the IDataRecord with raw data
|
||||||
* @return the array-wrapped data
|
* @return the array-wrapped data
|
||||||
*/
|
*/
|
||||||
public static DataWrapper1D constructArrayWrapper(IDataRecord dataRecord) {
|
public static DataSource constructArrayWrapper(IDataRecord dataRecord) {
|
||||||
return constructArrayWrapper(dataRecord, true);
|
return constructArrayWrapper(dataRecord, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DataWrapper1D constructArrayWrapper(IDataRecord dataRecord,
|
public static DataSource constructArrayWrapper(IDataRecord dataRecord,
|
||||||
boolean signed) {
|
boolean signed) {
|
||||||
DataWrapper1D arrayWrapper = null;
|
|
||||||
|
|
||||||
long[] dimensions = dataRecord.getSizes();
|
long[] dimensions = dataRecord.getSizes();
|
||||||
final int nx = (int) dimensions[0];
|
final int nx = (int) dimensions[0];
|
||||||
final int ny = (int) dimensions[1];
|
final int ny = (int) dimensions[1];
|
||||||
|
|
||||||
/*
|
DataSource source = BufferWrapper.wrapArray(
|
||||||
* determine the type of the data record and construct the appropriate
|
dataRecord.getDataObject(), nx, ny);
|
||||||
* array wrapper.
|
if (!signed) {
|
||||||
*/
|
if (source instanceof ByteBufferWrapper) {
|
||||||
if (dataRecord instanceof ByteDataRecord) {
|
source = UnsignedFilter.apply((ByteBufferWrapper) source);
|
||||||
ByteDataRecord byteDataRecord = (ByteDataRecord) dataRecord;
|
} else if (source instanceof ShortBufferWrapper) {
|
||||||
if (signed) {
|
source = UnsignedFilter.apply((ShortBufferWrapper) source);
|
||||||
arrayWrapper = new ByteArrayWrapper(byteDataRecord.getByteData(),
|
|
||||||
nx, ny);
|
|
||||||
} else {
|
|
||||||
arrayWrapper = new UnsignedByteArrayWrapper(
|
|
||||||
byteDataRecord.getByteData(), nx, ny);
|
|
||||||
}
|
|
||||||
} else if (dataRecord instanceof FloatDataRecord) {
|
|
||||||
FloatDataRecord floatDataRecord = (FloatDataRecord) dataRecord;
|
|
||||||
|
|
||||||
arrayWrapper = new FloatArrayWrapper(
|
|
||||||
floatDataRecord.getFloatData(), nx, ny);
|
|
||||||
} else if (dataRecord instanceof IntegerDataRecord) {
|
|
||||||
IntegerDataRecord integerDataRecord = (IntegerDataRecord) dataRecord;
|
|
||||||
|
|
||||||
arrayWrapper = new IntArrayWrapper(integerDataRecord.getIntData(),
|
|
||||||
nx, ny);
|
|
||||||
} else if (dataRecord instanceof ShortDataRecord) {
|
|
||||||
ShortDataRecord shortDataRecord = (ShortDataRecord) dataRecord;
|
|
||||||
|
|
||||||
if (signed) {
|
|
||||||
arrayWrapper = new ShortArrayWrapper(
|
|
||||||
shortDataRecord.getShortData(), nx, ny);
|
|
||||||
} else {
|
|
||||||
arrayWrapper = new UnsignedShortArrayWrapper(
|
|
||||||
shortDataRecord.getShortData(), nx, ny);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Number fillValue = dataRecord.getFillValue();
|
Number fillValue = dataRecord.getFillValue();
|
||||||
if (fillValue != null) {
|
if (fillValue != null) {
|
||||||
arrayWrapper.setFillValue(fillValue.doubleValue());
|
source = FillValueFilter.apply(source, fillValue.doubleValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
return arrayWrapper;
|
return source;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,7 +17,9 @@ Require-Bundle: org.geotools,
|
||||||
com.raytheon.uf.common.cache,
|
com.raytheon.uf.common.cache,
|
||||||
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174"
|
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||||
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Export-Package: com.raytheon.uf.common.dataplugin.gfe,
|
Export-Package: com.raytheon.uf.common.dataplugin.gfe,
|
||||||
com.raytheon.uf.common.dataplugin.gfe.config,
|
com.raytheon.uf.common.dataplugin.gfe.config,
|
||||||
com.raytheon.uf.common.dataplugin.gfe.dataaccess,
|
com.raytheon.uf.common.dataplugin.gfe.dataaccess,
|
||||||
|
@ -47,9 +49,6 @@ Import-Package: com.raytheon.edex.exception,
|
||||||
com.raytheon.uf.common.dataplugin,
|
com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.dataplugin.annotations,
|
com.raytheon.uf.common.dataplugin.annotations,
|
||||||
com.raytheon.uf.common.dataplugin.persist,
|
com.raytheon.uf.common.dataplugin.persist,
|
||||||
com.raytheon.uf.common.geospatial,
|
|
||||||
com.raytheon.uf.common.geospatial.interpolation,
|
|
||||||
com.raytheon.uf.common.geospatial.interpolation.data,
|
|
||||||
com.raytheon.uf.common.gridcoverage,
|
com.raytheon.uf.common.gridcoverage,
|
||||||
com.raytheon.uf.common.localization,
|
com.raytheon.uf.common.localization,
|
||||||
com.raytheon.uf.common.localization.exception,
|
com.raytheon.uf.common.localization.exception,
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.awt.image.Raster;
|
||||||
import java.awt.image.RenderedImage;
|
import java.awt.image.RenderedImage;
|
||||||
import java.lang.ref.SoftReference;
|
import java.lang.ref.SoftReference;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.FloatBuffer;
|
||||||
|
|
||||||
import javax.media.jai.BorderExtender;
|
import javax.media.jai.BorderExtender;
|
||||||
import javax.media.jai.Interpolation;
|
import javax.media.jai.Interpolation;
|
||||||
|
@ -34,6 +35,7 @@ import javax.media.jai.PlanarImage;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GridCoverage2D;
|
import org.geotools.coverage.grid.GridCoverage2D;
|
||||||
import org.geotools.coverage.grid.GridCoverageFactory;
|
import org.geotools.coverage.grid.GridCoverageFactory;
|
||||||
|
import org.geotools.coverage.grid.GridEnvelope2D;
|
||||||
import org.geotools.coverage.grid.GridGeometry2D;
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
import org.opengis.geometry.Envelope;
|
import org.opengis.geometry.Envelope;
|
||||||
import org.opengis.referencing.FactoryException;
|
import org.opengis.referencing.FactoryException;
|
||||||
|
@ -44,12 +46,17 @@ import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
|
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
|
||||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
|
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
|
import com.raytheon.uf.common.geospatial.data.GeographicDataSource;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.BilinearInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
import com.raytheon.uf.common.geospatial.interpolation.NearestNeighborInterpolation;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
import com.raytheon.uf.common.geospatial.interpolation.PrecomputedGridReprojection;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteBufferWrapper;
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.FillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.InverseFillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,6 +77,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* in Maputil.rotation
|
* in Maputil.rotation
|
||||||
* 07/17/13 #2185 bsteffen Cache computed grid reprojections.
|
* 07/17/13 #2185 bsteffen Cache computed grid reprojections.
|
||||||
* 08/13/13 #1571 randerso Passed fill values into interpolator.
|
* 08/13/13 #1571 randerso Passed fill values into interpolator.
|
||||||
|
* 03/07/14 #2791 bsteffen Move Data Source/Destination to numeric plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -490,22 +498,28 @@ public class RemapGrid {
|
||||||
float outputFill) throws FactoryException, TransformException {
|
float outputFill) throws FactoryException, TransformException {
|
||||||
|
|
||||||
GridGeometry2D sourceGeometry = MapUtil.getGridGeometry(sourceGloc);
|
GridGeometry2D sourceGeometry = MapUtil.getGridGeometry(sourceGloc);
|
||||||
|
GridEnvelope2D sourceRange = sourceGeometry.getGridRange2D();
|
||||||
|
|
||||||
ByteBuffer data = input.getBuffer();
|
ByteBuffer data = input.getBuffer();
|
||||||
ByteBuffer resampledData = null;
|
ByteBuffer resampledData = null;
|
||||||
|
|
||||||
GridGeometry2D destGeometry = MapUtil.getGridGeometry(destinationGloc);
|
GridGeometry2D destGeometry = MapUtil.getGridGeometry(destinationGloc);
|
||||||
|
GridEnvelope2D destRange = destGeometry.getGridRange2D();
|
||||||
GridReprojection interp = PrecomputedGridReprojection.getReprojection(
|
GridReprojection interp = PrecomputedGridReprojection.getReprojection(
|
||||||
sourceGeometry, destGeometry);
|
sourceGeometry, destGeometry);
|
||||||
|
|
||||||
ByteBufferWrapper source = new ByteBufferWrapper(data, sourceGeometry);
|
DataSource source = new ByteBufferWrapper(data, sourceRange.width,
|
||||||
source.setFillValue(inputFill);
|
sourceRange.height);
|
||||||
|
source = FillValueFilter.apply(source, inputFill);
|
||||||
|
|
||||||
ByteBufferWrapper dest = new ByteBufferWrapper(destGeometry);
|
ByteBufferWrapper bufferDest = new ByteBufferWrapper(destRange.width,
|
||||||
dest.setFillValue(outputFill);
|
destRange.height);
|
||||||
|
DataDestination dest = InverseFillValueFilter.apply(
|
||||||
|
(DataDestination) bufferDest, outputFill);
|
||||||
|
|
||||||
resampledData = interp.reprojectedGrid(
|
interp.reprojectedGrid(new NearestNeighborInterpolation(), source, dest);
|
||||||
new NearestNeighborInterpolation(), source, dest).getBuffer();
|
|
||||||
|
resampledData = bufferDest.getBuffer();
|
||||||
|
|
||||||
// Remap the the output data into a Grid2DFloat object
|
// Remap the the output data into a Grid2DFloat object
|
||||||
|
|
||||||
|
@ -582,15 +596,19 @@ public class RemapGrid {
|
||||||
GridReprojection interp = PrecomputedGridReprojection
|
GridReprojection interp = PrecomputedGridReprojection
|
||||||
.getReprojection(sourceGeometry, destGeometry);
|
.getReprojection(sourceGeometry, destGeometry);
|
||||||
|
|
||||||
FloatArrayWrapper source = new FloatArrayWrapper(data,
|
DataSource source = new GeographicDataSource(
|
||||||
sourceGeometry);
|
FloatBuffer.wrap(data), sourceGeometry);
|
||||||
source.setFillValue(inputFill);
|
source = FillValueFilter.apply(source, inputFill);
|
||||||
|
;
|
||||||
|
|
||||||
FloatArrayWrapper dest = new FloatArrayWrapper(destGeometry);
|
FloatBufferWrapper rawDest = new FloatBufferWrapper(
|
||||||
dest.setFillValue(outputFill);
|
destGeometry.getGridRange2D());
|
||||||
|
DataDestination dest = InverseFillValueFilter.apply(
|
||||||
|
(DataDestination) rawDest, outputFill);
|
||||||
|
|
||||||
f1 = interp.reprojectedGrid(new BilinearInterpolation(), source,
|
interp.reprojectedGrid(new BilinearInterpolation(), source, dest);
|
||||||
dest).getArray();
|
|
||||||
|
f1 = rawDest.getArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remap the the output data into a Grid2DFloat object
|
// Remap the the output data into a Grid2DFloat object
|
||||||
|
@ -645,7 +663,7 @@ public class RemapGrid {
|
||||||
Coordinate llc = destinationGloc
|
Coordinate llc = destinationGloc
|
||||||
.latLonCenter(new Coordinate(x1, y1));
|
.latLonCenter(new Coordinate(x1, y1));
|
||||||
rotation.set(x1, y1,
|
rotation.set(x1, y1,
|
||||||
(float) (-MapUtil.rotation(llc, sourceGloc)));
|
(float) (-MapUtil.rotation(llc, sourceGloc)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rotationRef = new SoftReference<Grid2DFloat>(rotation);
|
rotationRef = new SoftReference<Grid2DFloat>(rotation);
|
||||||
|
|
|
@ -48,11 +48,11 @@ import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||||
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.OffsetDataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.FloatBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
import com.raytheon.uf.common.numeric.source.OffsetDataSource;
|
||||||
import com.raytheon.uf.common.util.StringUtil;
|
import com.raytheon.uf.common.util.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -221,19 +221,19 @@ public class GFEGridFactory extends AbstractGridDataPluginFactory implements
|
||||||
if (slice instanceof ScalarGridSlice) {
|
if (slice instanceof ScalarGridSlice) {
|
||||||
// This also grabs vector data.
|
// This also grabs vector data.
|
||||||
Grid2DFloat data = ((ScalarGridSlice) slice).getScalarGrid();
|
Grid2DFloat data = ((ScalarGridSlice) slice).getScalarGrid();
|
||||||
dataSource = new FloatArrayWrapper(data.getFloats(), loc.getNx(),
|
dataSource = new FloatBufferWrapper(data.getFloats(), loc.getNx(),
|
||||||
loc.getNy());
|
loc.getNy());
|
||||||
} else if (slice instanceof DiscreteGridSlice) {
|
} else if (slice instanceof DiscreteGridSlice) {
|
||||||
DiscreteGridSlice discreteSlice = (DiscreteGridSlice) slice;
|
DiscreteGridSlice discreteSlice = (DiscreteGridSlice) slice;
|
||||||
Grid2DByte data = discreteSlice.getDiscreteGrid();
|
Grid2DByte data = discreteSlice.getDiscreteGrid();
|
||||||
keys = discreteSlice.getKeys();
|
keys = discreteSlice.getKeys();
|
||||||
dataSource = new ByteArrayWrapper(data.getBytes(), loc.getNx(),
|
dataSource = new ByteBufferWrapper(data.getBytes(), loc.getNx(),
|
||||||
loc.getNy());
|
loc.getNy());
|
||||||
} else if (slice instanceof WeatherGridSlice) {
|
} else if (slice instanceof WeatherGridSlice) {
|
||||||
WeatherGridSlice weatherSlice = (WeatherGridSlice) slice;
|
WeatherGridSlice weatherSlice = (WeatherGridSlice) slice;
|
||||||
Grid2DByte data = weatherSlice.getWeatherGrid();
|
Grid2DByte data = weatherSlice.getWeatherGrid();
|
||||||
keys = weatherSlice.getKeys();
|
keys = weatherSlice.getKeys();
|
||||||
dataSource = new ByteArrayWrapper(data.getBytes(), loc.getNx(),
|
dataSource = new ByteBufferWrapper(data.getBytes(), loc.getNx(),
|
||||||
loc.getNy());
|
loc.getNy());
|
||||||
} else {
|
} else {
|
||||||
throw new DataRetrievalException("Unknown slice of type "
|
throw new DataRetrievalException("Unknown slice of type "
|
||||||
|
|
|
@ -16,12 +16,12 @@ Export-Package: com.raytheon.uf.common.dataplugin.grid,
|
||||||
com.raytheon.uf.common.dataplugin.grid.units,
|
com.raytheon.uf.common.dataplugin.grid.units,
|
||||||
com.raytheon.uf.common.dataplugin.grid.util
|
com.raytheon.uf.common.dataplugin.grid.util
|
||||||
Require-Bundle: com.raytheon.uf.common.dataplugin,
|
Require-Bundle: com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.gridcoverage;visibility:=reexport,
|
com.raytheon.uf.common.gridcoverage;bundle-version="1.13.0";visibility:=reexport,
|
||||||
com.raytheon.uf.common.parameter;visibility:=reexport,
|
com.raytheon.uf.common.parameter;visibility:=reexport,
|
||||||
com.raytheon.uf.common.dataplugin.level;visibility:=reexport,
|
com.raytheon.uf.common.dataplugin.level;bundle-version="1.14.0";visibility:=reexport,
|
||||||
com.raytheon.uf.common.serialization,
|
com.raytheon.uf.common.serialization,
|
||||||
com.raytheon.uf.common.geospatial,
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.localization,
|
com.raytheon.uf.common.localization;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.datastorage,
|
com.raytheon.uf.common.datastorage,
|
||||||
com.raytheon.uf.common.comm,
|
com.raytheon.uf.common.comm,
|
||||||
com.raytheon.uf.common.dataquery,
|
com.raytheon.uf.common.dataquery,
|
||||||
|
@ -30,6 +30,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin,
|
||||||
com.raytheon.uf.common.serialization.comm,
|
com.raytheon.uf.common.serialization.comm,
|
||||||
com.raytheon.uf.common.status,
|
com.raytheon.uf.common.status,
|
||||||
com.raytheon.uf.common.style,
|
com.raytheon.uf.common.style,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
|
||||||
org.apache.commons.beanutils,
|
org.apache.commons.beanutils,
|
||||||
javax.measure,
|
javax.measure,
|
||||||
javax.persistence,
|
javax.persistence,
|
||||||
|
|
|
@ -47,7 +47,7 @@ import com.raytheon.uf.common.dataplugin.level.Level;
|
||||||
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapper;
|
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapper;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
|
import com.raytheon.uf.common.parameter.mapping.ParameterMapper;
|
||||||
import com.raytheon.uf.common.util.mapping.Mapper;
|
import com.raytheon.uf.common.util.mapping.Mapper;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Radar
|
Bundle-Name: Radar
|
||||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.radar
|
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.radar
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.common.geospatial
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.common.geospatial
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
|
@ -10,14 +10,15 @@ Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.localization;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
com.raytheon.uf.common.geospatial;bundle-version="1.14.0",
|
||||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
com.raytheon.uf.common.units;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||||
javax.persistence;bundle-version="1.0.0",
|
javax.persistence;bundle-version="1.0.0",
|
||||||
org.hibernate;bundle-version="1.0.0"
|
org.hibernate;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Export-Package: com.raytheon.uf.common.dataplugin.radar,
|
Export-Package: com.raytheon.uf.common.dataplugin.radar,
|
||||||
|
|
|
@ -50,11 +50,12 @@ import com.raytheon.uf.common.dataplugin.radar.util.RadarInfoDict;
|
||||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarUtil;
|
import com.raytheon.uf.common.dataplugin.radar.util.RadarUtil;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ByteArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.ShortArrayWrapper;
|
|
||||||
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
import com.raytheon.uf.common.geospatial.util.SubGridGeometryCalculator;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.ByteBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.FillValueFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.vividsolutions.jts.geom.Coordinate;
|
import com.vividsolutions.jts.geom.Coordinate;
|
||||||
import com.vividsolutions.jts.geom.Envelope;
|
import com.vividsolutions.jts.geom.Envelope;
|
||||||
|
|
||||||
|
@ -282,15 +283,13 @@ public class RadarGridFactory extends AbstractGridDataPluginFactory implements
|
||||||
int ny = radarRecord.getNumRadials();
|
int ny = radarRecord.getNumRadials();
|
||||||
byte[] bytes = radarRecord.getRawData();
|
byte[] bytes = radarRecord.getRawData();
|
||||||
if (bytes != null) {
|
if (bytes != null) {
|
||||||
ByteArrayWrapper wrapper = new ByteArrayWrapper(bytes, nx, ny);
|
ByteBufferWrapper wrapper = new ByteBufferWrapper(bytes, nx, ny);
|
||||||
wrapper.setFillValue(0);
|
return FillValueFilter.apply((DataSource) wrapper, 0);
|
||||||
return wrapper;
|
|
||||||
}
|
}
|
||||||
short[] shorts = radarRecord.getRawShortData();
|
short[] shorts = radarRecord.getRawShortData();
|
||||||
if (shorts != null) {
|
if (shorts != null) {
|
||||||
ShortArrayWrapper wrapper = new ShortArrayWrapper(shorts, nx, ny);
|
ShortBufferWrapper wrapper = new ShortBufferWrapper(shorts, nx, ny);
|
||||||
wrapper.setFillValue(0);
|
return FillValueFilter.apply((DataSource) wrapper, 0);
|
||||||
return wrapper;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
|
@ -2,21 +2,21 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Satellite Common
|
Bundle-Name: Satellite Common
|
||||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.satellite
|
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.satellite
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||||
javax.persistence;bundle-version="1.0.0",
|
javax.persistence;bundle-version="1.0.0",
|
||||||
org.geotools;bundle-version="2.6.4",
|
|
||||||
org.apache.commons.lang;bundle-version="2.3.0",
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
javax.measure;bundle-version="1.0.0",
|
javax.measure;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
||||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||||
org.hibernate;bundle-version="1.0.0"
|
org.hibernate;bundle-version="1.0.0",
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Export-Package: com.raytheon.uf.common.dataplugin.satellite,
|
Export-Package: com.raytheon.uf.common.dataplugin.satellite,
|
||||||
com.raytheon.uf.common.dataplugin.satellite.units,
|
com.raytheon.uf.common.dataplugin.satellite.units,
|
||||||
com.raytheon.uf.common.dataplugin.satellite.units.counts,
|
com.raytheon.uf.common.dataplugin.satellite.units.counts,
|
||||||
|
|
|
@ -39,7 +39,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
|
||||||
import com.raytheon.uf.common.dataplugin.satellite.units.SatelliteUnits;
|
import com.raytheon.uf.common.dataplugin.satellite.units.SatelliteUnits;
|
||||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data factory for getting satellite data from the metadata database. There
|
* A data factory for getting satellite data from the metadata database. There
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Geospatial Plug-in
|
Bundle-Name: Geospatial Plug-in
|
||||||
Bundle-SymbolicName: com.raytheon.uf.common.geospatial
|
Bundle-SymbolicName: com.raytheon.uf.common.geospatial
|
||||||
Bundle-Version: 1.12.1174.qualifier
|
Bundle-Version: 1.14.0.qualifier
|
||||||
Bundle-Vendor: RAYTHEON
|
Bundle-Vendor: RAYTHEON
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
Eclipse-BuddyPolicy: registered
|
Eclipse-BuddyPolicy: registered
|
||||||
|
@ -10,16 +10,17 @@ Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, org.geotools
|
||||||
Require-Bundle: org.geotools;bundle-version="2.5.2";visibility:=reexport,
|
Require-Bundle: org.geotools;bundle-version="2.5.2";visibility:=reexport,
|
||||||
org.apache.commons.collections;bundle-version="3.2.0",
|
org.apache.commons.collections;bundle-version="3.2.0",
|
||||||
org.apache.commons.lang;bundle-version="2.3.0",
|
org.apache.commons.lang;bundle-version="2.3.0",
|
||||||
javax.measure;bundle-version="1.0.0",
|
javax.measure,
|
||||||
org.apache.commons.beanutils;bundle-version="1.8.3",
|
org.apache.commons.beanutils;bundle-version="1.8.3",
|
||||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization,
|
||||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
com.raytheon.uf.common.serialization.comm,
|
||||||
com.raytheon.uf.common.dataquery;bundle-version="1.0.0",
|
com.raytheon.uf.common.dataquery,
|
||||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
com.raytheon.uf.common.status,
|
||||||
com.raytheon.uf.common.util;bundle-version="1.12.1174"
|
com.raytheon.uf.common.util,
|
||||||
|
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
|
||||||
Export-Package: com.raytheon.uf.common.geospatial,
|
Export-Package: com.raytheon.uf.common.geospatial,
|
||||||
|
com.raytheon.uf.common.geospatial.data,
|
||||||
com.raytheon.uf.common.geospatial.interpolation,
|
com.raytheon.uf.common.geospatial.interpolation,
|
||||||
com.raytheon.uf.common.geospatial.interpolation.data,
|
|
||||||
com.raytheon.uf.common.geospatial.projection,
|
com.raytheon.uf.common.geospatial.projection,
|
||||||
com.raytheon.uf.common.geospatial.request,
|
com.raytheon.uf.common.geospatial.request,
|
||||||
com.raytheon.uf.common.geospatial.spi,
|
com.raytheon.uf.common.geospatial.spi,
|
||||||
|
|
|
@ -0,0 +1,158 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.common.geospatial.data;
|
||||||
|
|
||||||
|
import java.nio.Buffer;
|
||||||
|
|
||||||
|
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
|
import org.geotools.coverage.grid.GridGeometry2D;
|
||||||
|
import org.opengis.coverage.grid.GridGeometry;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
||||||
|
import com.raytheon.uf.common.numeric.buffer.BufferWrapper;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.DataFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
import com.raytheon.uf.common.numeric.source.FilteredDataSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A data source with a grid geometry. Grids that "wrap" around the world allow
|
||||||
|
* indexing outside the normal x range to wrap around the world.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------- -------- ----------- --------------------------
|
||||||
|
* Mar 06, 2014 2791 bsteffen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author bsteffen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class GeographicDataSource implements DataSource {
|
||||||
|
|
||||||
|
protected final DataSource wrappedSource;
|
||||||
|
|
||||||
|
protected final GridGeometry2D gridGeometry;
|
||||||
|
|
||||||
|
protected final int nx;
|
||||||
|
|
||||||
|
protected final int wrapX;
|
||||||
|
|
||||||
|
public GeographicDataSource(DataSource wrappedSource, GridGeometry geometry) {
|
||||||
|
this.wrappedSource = wrappedSource;
|
||||||
|
this.gridGeometry = GridGeometry2D.wrap(geometry);
|
||||||
|
this.nx = this.gridGeometry.getGridRange2D().width;
|
||||||
|
this.wrapX = GridGeometryWrapChecker
|
||||||
|
.checkForWrapping(this.gridGeometry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GeographicDataSource(Buffer buffer, GeneralGridGeometry geometry) {
|
||||||
|
this.gridGeometry = GridGeometry2D.wrap(geometry);
|
||||||
|
this.nx = this.gridGeometry.getGridRange2D().width;
|
||||||
|
this.wrapX = GridGeometryWrapChecker
|
||||||
|
.checkForWrapping(this.gridGeometry);
|
||||||
|
int ny = this.gridGeometry.getGridRange2D().height;
|
||||||
|
this.wrappedSource = BufferWrapper.wrap(buffer, nx, ny);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public GeographicDataSource(Class<? extends Number> primitiveType,
|
||||||
|
GeneralGridGeometry geometry) {
|
||||||
|
this.gridGeometry = GridGeometry2D.wrap(geometry);
|
||||||
|
this.nx = this.gridGeometry.getGridRange2D().width;
|
||||||
|
this.wrapX = GridGeometryWrapChecker
|
||||||
|
.checkForWrapping(this.gridGeometry);
|
||||||
|
int ny = this.gridGeometry.getGridRange2D().height;
|
||||||
|
this.wrappedSource = BufferWrapper.create(primitiveType, nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GeographicDataSource(DataSource wrappedSource,
|
||||||
|
GridGeometry2D gridGeometry, int nx, int wrapX) {
|
||||||
|
this.wrappedSource = wrappedSource;
|
||||||
|
this.gridGeometry = gridGeometry;
|
||||||
|
this.nx = nx;
|
||||||
|
this.wrapX = wrapX;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int fixX(int x) {
|
||||||
|
if (wrapX > 0 && (x < 0 || x > nx - 1)) {
|
||||||
|
while (x > nx) {
|
||||||
|
x -= wrapX;
|
||||||
|
}
|
||||||
|
while (x < 0) {
|
||||||
|
x += wrapX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDataValue(int x, int y) {
|
||||||
|
return wrappedSource.getDataValue(fixX(x), y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataSource getWrappedSource() {
|
||||||
|
return wrappedSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GridGeometry2D getGridGeometry() {
|
||||||
|
return gridGeometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new GeographicDataSource that is a copy of this source but with
|
||||||
|
* additional filters. Since a FilteredDataSource is not geographic this is
|
||||||
|
* the prefered method of adding filters while preserving geographic
|
||||||
|
* attributes.
|
||||||
|
*
|
||||||
|
* @param filters
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public GeographicDataSource applyFilters(DataFilter... filters) {
|
||||||
|
DataSource newWrappedSource = FilteredDataSource.addFilters(
|
||||||
|
wrappedSource, filters);
|
||||||
|
return new GeographicDataSource(newWrappedSource, gridGeometry, nx,
|
||||||
|
wrapX);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new GeographicDataSource only if the provided source is not
|
||||||
|
* already a GeographicDataSource.
|
||||||
|
*
|
||||||
|
* @param source
|
||||||
|
* a DataSource
|
||||||
|
* @param geometry
|
||||||
|
* The geometry of the source
|
||||||
|
* @return Either a new GeographicDataSource or source cast to a
|
||||||
|
* GeographicDataSource.
|
||||||
|
*/
|
||||||
|
public static GeographicDataSource wrap(DataSource source,
|
||||||
|
GridGeometry geometry) {
|
||||||
|
if (source instanceof GeographicDataSource) {
|
||||||
|
return (GeographicDataSource) source;
|
||||||
|
} else {
|
||||||
|
return new GeographicDataSource(source, geometry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.common.geospatial.data;
|
||||||
|
|
||||||
|
import javax.measure.converter.UnitConverter;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.dest.FilteredDataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.filter.DataFilter;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
import com.raytheon.uf.common.numeric.source.FilteredDataSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* A filter that converts to a unit with the specified unit converter.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------- -------- ----------- --------------------------
|
||||||
|
* Mar 07, 2014 2791 bsteffen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author bsteffen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class UnitConvertingDataFilter implements DataFilter {
|
||||||
|
|
||||||
|
protected UnitConverter unitConverter;
|
||||||
|
|
||||||
|
public UnitConvertingDataFilter(UnitConverter converter) {
|
||||||
|
this.unitConverter = converter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double filter(double value) {
|
||||||
|
return unitConverter.convert(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataSource apply(DataSource source, UnitConverter converter) {
|
||||||
|
return FilteredDataSource.addFilters(source,
|
||||||
|
new UnitConvertingDataFilter(converter));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DataDestination apply(DataDestination destination,
|
||||||
|
UnitConverter converter) {
|
||||||
|
return FilteredDataDestination.addFilters(destination,
|
||||||
|
new UnitConvertingDataFilter(converter));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -19,7 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation;
|
package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bicubic convolusion.
|
* bicubic convolusion.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation;
|
package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bilinear interpolation
|
* Bilinear interpolation
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.opengis.referencing.FactoryException;
|
||||||
import org.opengis.referencing.cs.CoordinateSystem;
|
import org.opengis.referencing.cs.CoordinateSystem;
|
||||||
import org.opengis.referencing.operation.TransformException;
|
import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to create downscaled versions of geospatial data. Downscales to an
|
* Class used to create downscaled versions of geospatial data. Downscales to an
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.opengis.referencing.datum.PixelInCell;
|
||||||
import org.opengis.referencing.operation.MathTransform;
|
import org.opengis.referencing.operation.MathTransform;
|
||||||
import org.opengis.referencing.operation.TransformException;
|
import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataDestination;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for mapping data from one grid geometry to another. Uses interfaces for
|
* Class for mapping data from one grid geometry to another. Uses interfaces for
|
||||||
|
|
|
@ -22,7 +22,7 @@ package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
import org.opengis.referencing.FactoryException;
|
import org.opengis.referencing.FactoryException;
|
||||||
import org.opengis.referencing.operation.TransformException;
|
import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation;
|
package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for sampling data values from a source using an interpolation. It can be
|
* Used for sampling data values from a source using an interpolation. It can be
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation;
|
package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides logic for deriving a value at a single point from a 2D numeric
|
* Provides logic for deriving a value at a single point from a 2D numeric
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.opengis.referencing.operation.MathTransform;
|
||||||
import org.opengis.referencing.operation.TransformException;
|
import org.opengis.referencing.operation.TransformException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to a regular GridSampler but inputs to sample method are Lat/Lon
|
* Similar to a regular GridSampler but inputs to sample method are Lat/Lon
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation;
|
package com.raytheon.uf.common.geospatial.interpolation;
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.interpolation.data.DataSource;
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nearest Neighbor interpolation
|
* Nearest Neighbor interpolation
|
||||||
|
|
|
@ -1,142 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import java.awt.Rectangle;
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.geospatial.util.GridGeometryWrapChecker;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Abstract class for any data implementation that can act as both a source and
|
|
||||||
* destination.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
|
||||||
* Nov 19, 2013 2393 bclement added createNew method
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author bsteffen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public abstract class AbstractDataWrapper implements DataSource,
|
|
||||||
DataDestination {
|
|
||||||
|
|
||||||
protected final int nx;
|
|
||||||
|
|
||||||
protected final int ny;
|
|
||||||
|
|
||||||
protected int wrapX = -1;
|
|
||||||
|
|
||||||
protected double minValid = Double.NEGATIVE_INFINITY;
|
|
||||||
|
|
||||||
protected double maxValid = Double.POSITIVE_INFINITY;
|
|
||||||
|
|
||||||
protected double fillValue = Double.NaN;
|
|
||||||
|
|
||||||
public AbstractDataWrapper(GeneralGridGeometry geometry) {
|
|
||||||
this.nx = geometry.getGridRange().getSpan(0);
|
|
||||||
this.ny = geometry.getGridRange().getSpan(1);
|
|
||||||
this.wrapX = GridGeometryWrapChecker.checkForWrapping(geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AbstractDataWrapper(int nx, int ny) {
|
|
||||||
this.nx = nx;
|
|
||||||
this.ny = ny;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValidRange(double minValid, double maxValid) {
|
|
||||||
this.minValid = minValid;
|
|
||||||
this.maxValid = maxValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFillValue(double fillValue) {
|
|
||||||
this.fillValue = fillValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getDataValue(int x, int y) {
|
|
||||||
if (y < 0 || y > ny - 1) {
|
|
||||||
// outside y range
|
|
||||||
return Double.NaN;
|
|
||||||
} else if (x < 0 || x > nx - 1) {
|
|
||||||
// outside x range
|
|
||||||
if (wrapX > 0) {
|
|
||||||
// attempt to wrap if this is a wrapping grid.
|
|
||||||
x = (x + wrapX) % wrapX;
|
|
||||||
if (x < 0 || x > nx - 1) {
|
|
||||||
return Double.NaN;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Double.NaN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
double val = getDataValueInternal(x, y);
|
|
||||||
if (val == fillValue || val < minValid || val > maxValid) {
|
|
||||||
// skip outside valid range or fill value
|
|
||||||
val = Double.NaN;
|
|
||||||
}
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDataValue(double dataValue, int x, int y) {
|
|
||||||
if (Double.isNaN(dataValue)) {
|
|
||||||
dataValue = fillValue;
|
|
||||||
}
|
|
||||||
setDataValueInternal(dataValue, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract double getDataValueInternal(int x, int y);
|
|
||||||
|
|
||||||
protected abstract void setDataValueInternal(double dataValue, int x, int y);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new data wrapper of type c with the provided size
|
|
||||||
*
|
|
||||||
* @param c
|
|
||||||
* desired implementation class
|
|
||||||
* @param size
|
|
||||||
* @return
|
|
||||||
* @throws IllegalArgumentException
|
|
||||||
*/
|
|
||||||
public static <T extends AbstractDataWrapper> T createNew(
|
|
||||||
Class<? extends T> c, Rectangle size)
|
|
||||||
throws IllegalArgumentException {
|
|
||||||
try {
|
|
||||||
Constructor<? extends T> constructor = c.getConstructor(int.class,
|
|
||||||
int.class);
|
|
||||||
return constructor.newInstance(size.width, size.height);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalArgumentException(
|
|
||||||
"Unable to instatiate instance of class: " + c, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,117 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link AbstractDataWrapper} implementation for byte array data.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jul 13, 2012 jkorman Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author jkorman
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ByteArrayWrapper extends DataWrapper1D {
|
|
||||||
|
|
||||||
// The wrapped byte array data.
|
|
||||||
protected final byte[] array;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrap a byte array using a specified geometry.
|
|
||||||
* @param array Byte array data to be wrapped.
|
|
||||||
* @param geometry A {@link GeneralGridGeometry} that will be used to discover
|
|
||||||
* the shape of the input data.
|
|
||||||
*/
|
|
||||||
public ByteArrayWrapper(byte[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrap a byte array using given x and y axis dimensions.
|
|
||||||
* @param array Byte array data to be wrapped.
|
|
||||||
* @param nx Number of elements on the x axis.
|
|
||||||
* @param ny Number of elements on the y axis.
|
|
||||||
*/
|
|
||||||
public ByteArrayWrapper(byte[] array, int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an instance with a byte array using given x and y axis dimensions.
|
|
||||||
* @param nx Number of elements on the x axis.
|
|
||||||
* @param ny Number of elements on the y axis.
|
|
||||||
*/
|
|
||||||
public ByteArrayWrapper(int nx, int ny) {
|
|
||||||
this(new byte[nx * ny], nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an instance with a byte array using a specified geometry.
|
|
||||||
* @param geometry A {@link GeneralGridGeometry} that will be used to discover
|
|
||||||
* the shape of the input data.
|
|
||||||
*/
|
|
||||||
public ByteArrayWrapper(GeneralGridGeometry geometry) {
|
|
||||||
// assume this is going to be a destination and avoid passing
|
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a reference to the internal wrapped data.
|
|
||||||
* @return The internal byte array data.
|
|
||||||
*/
|
|
||||||
public byte[] getArray() {
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the value of the internal data at a specified position.
|
|
||||||
* @param index Position within the internal data to get.
|
|
||||||
* @return The value of the internal data.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of the internal data at a specified position.
|
|
||||||
* @param dataValue A value to set at the given index.
|
|
||||||
* @param index Position within the internal data to set.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setDataValueInternal(double dataValue, int index) {
|
|
||||||
array[index] = (byte) dataValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* converts a 2D x,y index pair into an index value.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
|
||||||
* Nov 19, 2013 2393 bclement added abstract method for primitive array
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author bsteffen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public abstract class DataWrapper1D extends AbstractDataWrapper {
|
|
||||||
|
|
||||||
public DataWrapper1D(GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataWrapper1D(int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int x, int y) {
|
|
||||||
return getDataValueInternal(x + y * nx);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDataValueInternal(double dataValue, int x, int y) {
|
|
||||||
setDataValueInternal(dataValue, x + nx * y);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract double getDataValueInternal(int index);
|
|
||||||
|
|
||||||
protected abstract void setDataValueInternal(double dataValue, int index);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the backing 1D primitive array
|
|
||||||
*
|
|
||||||
* @return null if array isn't available
|
|
||||||
*/
|
|
||||||
public abstract Object getArray();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 1-dimensional float array data
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author bsteffen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public class FloatArrayWrapper extends DataWrapper1D {
|
|
||||||
|
|
||||||
protected final float[] array;
|
|
||||||
|
|
||||||
public FloatArrayWrapper(float[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatArrayWrapper(float[] array, int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatArrayWrapper(int nx, int ny) {
|
|
||||||
this(new float[nx * ny], nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatArrayWrapper(GeneralGridGeometry geometry) {
|
|
||||||
// assume this is going to be a destination and avoid passing
|
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public float[] getArray() {
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDataValueInternal(double dataValue, int index) {
|
|
||||||
array[index] = (float) dataValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps an int array as a {@link DataSource} and {@link DataDestination}
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Nov 5, 2012 njensen Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author njensen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class IntArrayWrapper extends DataWrapper1D {
|
|
||||||
|
|
||||||
protected final int[] array;
|
|
||||||
|
|
||||||
public IntArrayWrapper(int[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntArrayWrapper(int[] array, int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntArrayWrapper(int nx, int ny) {
|
|
||||||
this(new int[nx * ny], nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntArrayWrapper(GeneralGridGeometry geometry) {
|
|
||||||
// assume this is going to be a destination and avoid passing
|
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getArray() {
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setDataValueInternal(double dataValue, int index) {
|
|
||||||
array[index] = (int) dataValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps a short array as a {@link DataSource} and {@link DataDestination}
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jul 3, 2012 mschenke Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author mschenke
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ShortArrayWrapper extends DataWrapper1D {
|
|
||||||
|
|
||||||
protected final short[] array;
|
|
||||||
|
|
||||||
public ShortArrayWrapper(short[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShortArrayWrapper(short[] array, int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShortArrayWrapper(int nx, int ny) {
|
|
||||||
this(new short[nx * ny], nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShortArrayWrapper(GeneralGridGeometry geometry) {
|
|
||||||
// assume this is going to be a destination and avoid passing
|
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
public short[] getArray() {
|
|
||||||
return array;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDataValueInternal(double dataValue, int index) {
|
|
||||||
array[index] = (short) dataValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,71 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import javax.measure.converter.UnitConverter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A data destination that converts to a unit with the specified unit converter;
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Nov 12, 2012 njensen Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author njensen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UnitConvertingDataDestination implements DataDestination {
|
|
||||||
|
|
||||||
protected UnitConverter unitConverter;
|
|
||||||
|
|
||||||
protected DataDestination wrappedDestination;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param converter
|
|
||||||
* the unit converter to apply when setting the values in the
|
|
||||||
* destination
|
|
||||||
* @param destination
|
|
||||||
* the destination to set values on
|
|
||||||
*/
|
|
||||||
public UnitConvertingDataDestination(UnitConverter converter,
|
|
||||||
DataDestination destination) {
|
|
||||||
this.unitConverter = converter;
|
|
||||||
this.wrappedDestination = destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setDataValue(double dataValue, int x, int y) {
|
|
||||||
wrappedDestination.setDataValue(unitConverter.convert(dataValue), x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataDestination getWrappedDestination() {
|
|
||||||
return wrappedDestination;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link AbstractDataWrapper} implementation for unsigned byte array data.
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Aug 3, 2012 mschenke Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author mschenke
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UnsignedByteArrayWrapper extends ByteArrayWrapper {
|
|
||||||
|
|
||||||
public UnsignedByteArrayWrapper(byte[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(array, geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsignedByteArrayWrapper(byte[] array, int nx, int ny) {
|
|
||||||
super(array, nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsignedByteArrayWrapper(int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
|
||||||
* getDataValueInternal(int)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index] & 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Unsigned ByteBuffer data wrapper
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
|
||||||
* Nov 19, 2013 2393 bclement changed to extend ByteBufferWrapper
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author bsteffen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public class UnsignedByteBufferWrapper extends ByteBufferWrapper {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param buffer
|
|
||||||
* @param geometry
|
|
||||||
*/
|
|
||||||
public UnsignedByteBufferWrapper(ByteBuffer buffer,
|
|
||||||
GeneralGridGeometry geometry) {
|
|
||||||
super(buffer, geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param buffer
|
|
||||||
* @param nx
|
|
||||||
* @param ny
|
|
||||||
*/
|
|
||||||
public UnsignedByteBufferWrapper(ByteBuffer buffer, int nx, int ny) {
|
|
||||||
super(buffer, nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param geometry
|
|
||||||
*/
|
|
||||||
public UnsignedByteBufferWrapper(GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nx
|
|
||||||
* @param ny
|
|
||||||
*/
|
|
||||||
public UnsignedByteBufferWrapper(int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return buffer.get(index) & 0xFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps a short array as an unsigned {@link DataSource} and
|
|
||||||
* {@link DataDestination}
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jul 3, 2012 mschenke Initial creation
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author mschenke
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class UnsignedShortArrayWrapper extends ShortArrayWrapper {
|
|
||||||
|
|
||||||
public UnsignedShortArrayWrapper(short[] array, GeneralGridGeometry geometry) {
|
|
||||||
super(array, geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsignedShortArrayWrapper(short[] array, int nx, int ny) {
|
|
||||||
super(array, nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsignedShortArrayWrapper(int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsignedShortArrayWrapper(GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return array[index] & 0xFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/**
|
|
||||||
* 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.
|
|
||||||
**/
|
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
|
||||||
|
|
||||||
import java.nio.ShortBuffer;
|
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Unsigned ShortBuffer data wrapper
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
*
|
|
||||||
* SOFTWARE HISTORY
|
|
||||||
*
|
|
||||||
* Date Ticket# Engineer Description
|
|
||||||
* ------------ ---------- ----------- --------------------------
|
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
|
||||||
* Nov 19, 2013 2393 bclement changed to extend ShortBufferWrapper
|
|
||||||
*
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* @author bsteffen
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public class UnsignedShortBufferWrapper extends ShortBufferWrapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param geometry
|
|
||||||
*/
|
|
||||||
public UnsignedShortBufferWrapper(GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nx
|
|
||||||
* @param ny
|
|
||||||
*/
|
|
||||||
public UnsignedShortBufferWrapper(int nx, int ny) {
|
|
||||||
super(nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param buffer
|
|
||||||
* @param geometry
|
|
||||||
*/
|
|
||||||
public UnsignedShortBufferWrapper(ShortBuffer buffer,
|
|
||||||
GeneralGridGeometry geometry) {
|
|
||||||
super(buffer, geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param buffer
|
|
||||||
* @param nx
|
|
||||||
* @param ny
|
|
||||||
*/
|
|
||||||
public UnsignedShortBufferWrapper(ShortBuffer buffer, int nx, int ny) {
|
|
||||||
super(buffer, nx, ny);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected double getDataValueInternal(int index) {
|
|
||||||
return buffer.get(index) & 0xFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
7
edexOsgi/com.raytheon.uf.common.numeric/.classpath
Normal file
7
edexOsgi/com.raytheon.uf.common.numeric/.classpath
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
28
edexOsgi/com.raytheon.uf.common.numeric/.project
Normal file
28
edexOsgi/com.raytheon.uf.common.numeric/.project
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>com.raytheon.uf.common.numeric</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -0,0 +1,7 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -0,0 +1,4 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
pluginProject.equinox=false
|
||||||
|
pluginProject.extensions=false
|
||||||
|
resolve.requirebundle=false
|
13
edexOsgi/com.raytheon.uf.common.numeric/META-INF/MANIFEST.MF
Normal file
13
edexOsgi/com.raytheon.uf.common.numeric/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: Numeric
|
||||||
|
Bundle-SymbolicName: com.raytheon.uf.common.numeric
|
||||||
|
Bundle-Version: 1.14.0.qualifier
|
||||||
|
Bundle-Vendor: RAYTHEON
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||||
|
Export-Package: com.raytheon.uf.common.numeric,
|
||||||
|
com.raytheon.uf.common.numeric.array,
|
||||||
|
com.raytheon.uf.common.numeric.buffer,
|
||||||
|
com.raytheon.uf.common.numeric.dest,
|
||||||
|
com.raytheon.uf.common.numeric.filter,
|
||||||
|
com.raytheon.uf.common.numeric.source
|
4
edexOsgi/com.raytheon.uf.common.numeric/build.properties
Normal file
4
edexOsgi/com.raytheon.uf.common.numeric/build.properties
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
source.. = src/
|
||||||
|
output.. = bin/
|
||||||
|
bin.includes = META-INF/,\
|
||||||
|
.
|
|
@ -17,10 +17,14 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
import com.raytheon.uf.common.numeric.source.OffsetDataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide utility method for copying data from a {@link DataSource} to a
|
* Provide utility method for working with a {@link DataSource} or
|
||||||
* {@link DataDestination}.
|
* {@link DataDestination}.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -39,6 +43,22 @@ package com.raytheon.uf.common.geospatial.interpolation.data;
|
||||||
|
|
||||||
public class DataUtilities {
|
public class DataUtilities {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy all data within the specified range from a source to a destination.
|
||||||
|
* For copying of different ranges {@link OffsetDataSource} can be used to
|
||||||
|
* shift the source indexes.
|
||||||
|
*
|
||||||
|
* @param source
|
||||||
|
* Any data source
|
||||||
|
* @param destination
|
||||||
|
* any data destination
|
||||||
|
* @param nx
|
||||||
|
* the width of the data to copy
|
||||||
|
* @param ny
|
||||||
|
* the hieght of the data to copy.
|
||||||
|
*
|
||||||
|
* @return the same destination that was provided.
|
||||||
|
*/
|
||||||
public static final <D extends DataDestination> D copy(DataSource source,
|
public static final <D extends DataDestination> D copy(DataSource source,
|
||||||
D destination, int nx, int ny) {
|
D destination, int nx, int ny) {
|
||||||
for (int i = 0; i < nx; i += 1) {
|
for (int i = 0; i < nx; i += 1) {
|
||||||
|
@ -49,6 +69,17 @@ public class DataUtilities {
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the extrama of a source.
|
||||||
|
*
|
||||||
|
* @param source
|
||||||
|
* Any data source
|
||||||
|
* @param nx
|
||||||
|
* the width of the data to copy
|
||||||
|
* @param ny
|
||||||
|
* the hieght of the data to copy.
|
||||||
|
* @return The min/max values for the source.
|
||||||
|
*/
|
||||||
public static final MinMax getMinMax(DataSource source, int nx, int ny) {
|
public static final MinMax getMinMax(DataSource source, int nx, int ny) {
|
||||||
double minValue = Double.POSITIVE_INFINITY;
|
double minValue = Double.POSITIVE_INFINITY;
|
||||||
double maxValue = Double.NEGATIVE_INFINITY;
|
double maxValue = Double.NEGATIVE_INFINITY;
|
||||||
|
@ -69,6 +100,9 @@ public class DataUtilities {
|
||||||
return new MinMax(minValue, maxValue);
|
return new MinMax(minValue, maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class for holding Min/Max data values.
|
||||||
|
*/
|
||||||
public static class MinMax {
|
public static class MinMax {
|
||||||
|
|
||||||
private final double min;
|
private final double min;
|
|
@ -17,9 +17,10 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.array;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -38,17 +39,17 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class FloatArray2DWrapper extends AbstractDataWrapper {
|
public class FloatArray2DWrapper implements DataSource, DataDestination {
|
||||||
|
|
||||||
|
protected final int nx;
|
||||||
|
|
||||||
|
protected final int ny;
|
||||||
|
|
||||||
protected final float[][] array;
|
protected final float[][] array;
|
||||||
|
|
||||||
public FloatArray2DWrapper(float[][] array, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.array = array;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatArray2DWrapper(float[][] array, int nx, int ny) {
|
public FloatArray2DWrapper(float[][] array, int nx, int ny) {
|
||||||
super(nx, ny);
|
this.nx = nx;
|
||||||
|
this.ny = ny;
|
||||||
this.array = array;
|
this.array = array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,9 +57,13 @@ public class FloatArray2DWrapper extends AbstractDataWrapper {
|
||||||
this(new float[ny][nx], nx, ny);
|
this(new float[ny][nx], nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FloatArray2DWrapper(GeneralGridGeometry geometry) {
|
protected boolean validateRange(int x, int y) {
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
if (y < 0 || y > ny - 1) {
|
||||||
.getSpan(1));
|
return false;
|
||||||
|
} else if (x < 0 || x > nx - 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float[][] getArray() {
|
public float[][] getArray() {
|
||||||
|
@ -66,13 +71,18 @@ public class FloatArray2DWrapper extends AbstractDataWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDataValueInternal(double dataValue, int x, int y) {
|
public void setDataValue(double dataValue, int x, int y) {
|
||||||
array[y][x] = (float) dataValue;
|
if (validateRange(x, y)) {
|
||||||
|
array[y][x] = (float) dataValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected double getDataValueInternal(int x, int y) {
|
public double getDataValue(int x, int y) {
|
||||||
return array[y][x];
|
if (validateRange(x, y)) {
|
||||||
|
return array[y][x];
|
||||||
|
}
|
||||||
|
return Double.NaN;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,222 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.nio.Buffer;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.DoubleBuffer;
|
||||||
|
import java.nio.FloatBuffer;
|
||||||
|
import java.nio.IntBuffer;
|
||||||
|
import java.nio.LongBuffer;
|
||||||
|
import java.nio.ShortBuffer;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Abstract class for buffer backed data implementation that can act as both a
|
||||||
|
* source and destination.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------- -------- ----------- --------------------------
|
||||||
|
* Mar 07, 2014 2791 bsteffen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author bsteffen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public abstract class BufferWrapper implements DataSource,
|
||||||
|
DataDestination {
|
||||||
|
|
||||||
|
protected final int nx;
|
||||||
|
|
||||||
|
protected final int ny;
|
||||||
|
|
||||||
|
protected BufferWrapper(int nx, int ny) {
|
||||||
|
this.nx = nx;
|
||||||
|
this.ny = ny;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the width of the data,
|
||||||
|
*/
|
||||||
|
public int getNx() {
|
||||||
|
return nx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the height of the data.
|
||||||
|
*/
|
||||||
|
public int getNy() {
|
||||||
|
return ny;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean validateRange(int x, int y) {
|
||||||
|
if (y < 0 || y > ny - 1) {
|
||||||
|
return false;
|
||||||
|
} else if (x < 0 || x > nx - 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDataValue(int x, int y) {
|
||||||
|
if (validateRange(x, y)) {
|
||||||
|
return getDataValueInternal(x + y * nx);
|
||||||
|
}
|
||||||
|
return Double.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDataValue(double dataValue, int x, int y) {
|
||||||
|
if (validateRange(x, y)) {
|
||||||
|
setDataValueInternal(dataValue, x + y * nx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the buffer that providing data for this wrapper.
|
||||||
|
*/
|
||||||
|
public abstract Buffer getBuffer();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return an array version of this data or null if no array is available.
|
||||||
|
* No array will be available if the data is not backed by an
|
||||||
|
* array(For example direct memory or ByteBufer.as*)
|
||||||
|
*/
|
||||||
|
public abstract Object getArray();
|
||||||
|
|
||||||
|
protected abstract double getDataValueInternal(int index);
|
||||||
|
|
||||||
|
protected abstract void setDataValueInternal(double dataValue, int index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The primitve class that is the type of data held in the buffer
|
||||||
|
* for this wrapper.
|
||||||
|
*/
|
||||||
|
public abstract Class<? extends Number> getPrimitiveType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new buffer of a known primitive type.
|
||||||
|
*
|
||||||
|
* @param primitiveType
|
||||||
|
* The primitive type, must be one of float.class, double.class,
|
||||||
|
* byte.class, short.class, int.class, or long.class.
|
||||||
|
* @param nx
|
||||||
|
* the width of the data.
|
||||||
|
* @param ny
|
||||||
|
* the height of the data.
|
||||||
|
* @return a new BufferWrapper of the correct type.
|
||||||
|
*/
|
||||||
|
public static BufferWrapper create(
|
||||||
|
Class<? extends Number> primitiveType, int nx, int ny) {
|
||||||
|
if (float.class.equals(primitiveType)) {
|
||||||
|
return new FloatBufferWrapper(nx, ny);
|
||||||
|
} else if (double.class.equals(primitiveType)) {
|
||||||
|
return new DoubleBufferWrapper(nx, ny);
|
||||||
|
} else if (byte.class.equals(primitiveType)) {
|
||||||
|
return new ByteBufferWrapper(nx, ny);
|
||||||
|
} else if (short.class.equals(primitiveType)) {
|
||||||
|
return new ShortBufferWrapper(nx, ny);
|
||||||
|
} else if (int.class.equals(primitiveType)) {
|
||||||
|
return new IntBufferWrapper(nx, ny);
|
||||||
|
} else if (long.class.equals(primitiveType)) {
|
||||||
|
return new LongBufferWrapper(nx, ny);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Cannot make a buffer wrapper for "
|
||||||
|
+ primitiveType.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrap an existing numeric Buffer in BufferWrapper for convenient 2D
|
||||||
|
* indexing.
|
||||||
|
*
|
||||||
|
* @param buffer
|
||||||
|
* any Buffer except CharBuffer, Characters aren't numbers.
|
||||||
|
* @param nx
|
||||||
|
* the width of the data.
|
||||||
|
* @param ny
|
||||||
|
* the height of the data.
|
||||||
|
* @return a new BufferWrapper of the correct type.
|
||||||
|
*/
|
||||||
|
public static BufferWrapper wrap(Buffer buffer, int nx,
|
||||||
|
int ny) {
|
||||||
|
if (buffer instanceof FloatBuffer) {
|
||||||
|
return new FloatBufferWrapper((FloatBuffer) buffer, nx, ny);
|
||||||
|
} else if (buffer instanceof DoubleBuffer) {
|
||||||
|
return new DoubleBufferWrapper((DoubleBuffer) buffer, nx, ny);
|
||||||
|
} else if (buffer instanceof ByteBuffer) {
|
||||||
|
return new ByteBufferWrapper((ByteBuffer) buffer, nx, ny);
|
||||||
|
} else if (buffer instanceof ShortBuffer) {
|
||||||
|
return new ShortBufferWrapper((ShortBuffer) buffer, nx, ny);
|
||||||
|
} else if (buffer instanceof IntBuffer) {
|
||||||
|
return new IntBufferWrapper((IntBuffer) buffer, nx, ny);
|
||||||
|
} else if (buffer instanceof LongBuffer) {
|
||||||
|
return new LongBufferWrapper((LongBuffer) buffer, nx, ny);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Cannot make a buffer wrapper for "
|
||||||
|
+ buffer.getClass().getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrap an existing primitve array in BufferWrapper for convenient 2D
|
||||||
|
* indexing.
|
||||||
|
*
|
||||||
|
* @param array
|
||||||
|
* a primitve array, must be of type must be one of float[],
|
||||||
|
* double[], byte[], short[], int[], or long[].
|
||||||
|
* @param nx
|
||||||
|
* the width of the data.
|
||||||
|
* @param ny
|
||||||
|
* the height of the data.
|
||||||
|
* @return a new BufferWrapper of the correct type.
|
||||||
|
*/
|
||||||
|
public static BufferWrapper wrapArray(Object array, int nx, int ny) {
|
||||||
|
if (array instanceof float[]) {
|
||||||
|
return new FloatBufferWrapper((float[]) array, nx, ny);
|
||||||
|
} else if (array instanceof double[]) {
|
||||||
|
return new DoubleBufferWrapper((double[]) array, nx, ny);
|
||||||
|
} else if (array instanceof byte[]) {
|
||||||
|
return new ByteBufferWrapper((byte[]) array, nx, ny);
|
||||||
|
} else if (array instanceof short[]) {
|
||||||
|
return new ShortBufferWrapper((short[]) array, nx, ny);
|
||||||
|
} else if (array instanceof int[]) {
|
||||||
|
return new IntBufferWrapper((int[]) array, nx, ny);
|
||||||
|
} else if (array instanceof long[]) {
|
||||||
|
return new LongBufferWrapper((long[]) array, nx, ny);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Cannot make a buffer wrapper for "
|
||||||
|
+ array.getClass().getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,12 +17,11 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* ByteBuffer data wrapper
|
* ByteBuffer data wrapper
|
||||||
|
@ -33,41 +32,40 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
* Nov 19, 2013 2393 bclement added getArray
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class ByteBufferWrapper extends DataWrapper1D {
|
public class ByteBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
protected final ByteBuffer buffer;
|
protected final ByteBuffer buffer;
|
||||||
|
|
||||||
public ByteBufferWrapper(ByteBuffer buffer, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.buffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ByteBufferWrapper(ByteBuffer buffer, int nx, int ny) {
|
public ByteBufferWrapper(ByteBuffer buffer, int nx, int ny) {
|
||||||
super(nx, ny);
|
super(nx, ny);
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ByteBufferWrapper(byte[] array, int nx, int ny) {
|
||||||
|
this(ByteBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
public ByteBufferWrapper(int nx, int ny) {
|
public ByteBufferWrapper(int nx, int ny) {
|
||||||
this(ByteBuffer.allocate(nx * ny), nx, ny);
|
this(ByteBuffer.allocate(nx * ny), nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteBufferWrapper(GeneralGridGeometry geometry) {
|
public ByteBufferWrapper(ByteBuffer buffer, Rectangle dimensions) {
|
||||||
// assume this is going to be a destination and avoid passing
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteBuffer getBuffer() {
|
public ByteBufferWrapper(byte[] array, Rectangle dimensions) {
|
||||||
return buffer;
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ByteBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,12 +78,11 @@ public class ByteBufferWrapper extends DataWrapper1D {
|
||||||
buffer.put(index, (byte) dataValue);
|
buffer.put(index, (byte) dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
public ByteBuffer getBuffer() {
|
||||||
*
|
return buffer;
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
}
|
||||||
* getPrimitiveArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getArray() {
|
public byte[] getArray() {
|
||||||
if (buffer.hasArray()) {
|
if (buffer.hasArray()) {
|
||||||
|
@ -94,4 +91,8 @@ public class ByteBufferWrapper extends DataWrapper1D {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Byte> getPrimitiveType() {
|
||||||
|
return byte.class;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -17,12 +17,11 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.DoubleBuffer;
|
import java.nio.DoubleBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* DoubleBuffer data wrapper
|
* DoubleBuffer data wrapper
|
||||||
|
@ -33,41 +32,40 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
* Nov 19, 2013 2393 bclement added getArray
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class DoubleBufferWrapper extends DataWrapper1D {
|
public class DoubleBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
protected final DoubleBuffer buffer;
|
protected final DoubleBuffer buffer;
|
||||||
|
|
||||||
public DoubleBufferWrapper(DoubleBuffer buffer, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.buffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DoubleBufferWrapper(DoubleBuffer buffer, int nx, int ny) {
|
public DoubleBufferWrapper(DoubleBuffer buffer, int nx, int ny) {
|
||||||
super(nx, ny);
|
super(nx, ny);
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DoubleBufferWrapper(double[] array, int nx, int ny) {
|
||||||
|
this(DoubleBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
public DoubleBufferWrapper(int nx, int ny) {
|
public DoubleBufferWrapper(int nx, int ny) {
|
||||||
this(DoubleBuffer.allocate(nx * ny), nx, ny);
|
this(DoubleBuffer.allocate(nx * ny), nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleBufferWrapper(GeneralGridGeometry geometry) {
|
public DoubleBufferWrapper(DoubleBuffer buffer, Rectangle dimensions) {
|
||||||
// assume this is going to be a destination and avoid passing
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DoubleBuffer getBuffer() {
|
public DoubleBufferWrapper(double[] array, Rectangle dimensions) {
|
||||||
return buffer;
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DoubleBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,12 +78,11 @@ public class DoubleBufferWrapper extends DataWrapper1D {
|
||||||
buffer.put(index, dataValue);
|
buffer.put(index, dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
public DoubleBuffer getBuffer() {
|
||||||
*
|
return buffer;
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
}
|
||||||
* getPrimitiveArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public double[] getArray() {
|
public double[] getArray() {
|
||||||
if (buffer.hasArray()) {
|
if (buffer.hasArray()) {
|
||||||
|
@ -94,4 +91,8 @@ public class DoubleBufferWrapper extends DataWrapper1D {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Double> getPrimitiveType() {
|
||||||
|
return double.class;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -17,12 +17,11 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* FloatBuffer data wrapper
|
* FloatBuffer data wrapper
|
||||||
|
@ -33,41 +32,40 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
* Nov 19, 2013 2393 bclement added getArray
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class FloatBufferWrapper extends DataWrapper1D {
|
public class FloatBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
protected final FloatBuffer buffer;
|
protected final FloatBuffer buffer;
|
||||||
|
|
||||||
public FloatBufferWrapper(FloatBuffer buffer, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.buffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FloatBufferWrapper(FloatBuffer buffer, int nx, int ny) {
|
public FloatBufferWrapper(FloatBuffer buffer, int nx, int ny) {
|
||||||
super(nx, ny);
|
super(nx, ny);
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FloatBufferWrapper(float[] array, int nx, int ny) {
|
||||||
|
this(FloatBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
public FloatBufferWrapper(int nx, int ny) {
|
public FloatBufferWrapper(int nx, int ny) {
|
||||||
this(FloatBuffer.allocate(nx * ny), nx, ny);
|
this(FloatBuffer.allocate(nx * ny), nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FloatBufferWrapper(GeneralGridGeometry geometry) {
|
public FloatBufferWrapper(FloatBuffer buffer, Rectangle dimensions) {
|
||||||
// assume this is going to be a destination and avoid passing
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FloatBuffer getBuffer() {
|
public FloatBufferWrapper(float[] array, Rectangle dimensions) {
|
||||||
return buffer;
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FloatBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,12 +78,11 @@ public class FloatBufferWrapper extends DataWrapper1D {
|
||||||
buffer.put(index, (float) dataValue);
|
buffer.put(index, (float) dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
public FloatBuffer getBuffer() {
|
||||||
*
|
return buffer;
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
}
|
||||||
* getPrimitiveArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public float[] getArray() {
|
public float[] getArray() {
|
||||||
if (buffer.hasArray()) {
|
if (buffer.hasArray()) {
|
||||||
|
@ -94,4 +91,8 @@ public class FloatBufferWrapper extends DataWrapper1D {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Float> getPrimitiveType() {
|
||||||
|
return float.class;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -17,12 +17,11 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.IntBuffer;
|
import java.nio.IntBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* IntBuffer data wrapper
|
* IntBuffer data wrapper
|
||||||
|
@ -33,41 +32,40 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
* Nov 19, 2013 2393 bclement added getArray
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class IntBufferWrapper extends DataWrapper1D {
|
public class IntBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
protected final IntBuffer buffer;
|
protected final IntBuffer buffer;
|
||||||
|
|
||||||
public IntBufferWrapper(IntBuffer buffer, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.buffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntBufferWrapper(IntBuffer buffer, int nx, int ny) {
|
public IntBufferWrapper(IntBuffer buffer, int nx, int ny) {
|
||||||
super(nx, ny);
|
super(nx, ny);
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IntBufferWrapper(int[] array, int nx, int ny) {
|
||||||
|
this(IntBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
public IntBufferWrapper(int nx, int ny) {
|
public IntBufferWrapper(int nx, int ny) {
|
||||||
this(IntBuffer.allocate(nx * ny), nx, ny);
|
this(IntBuffer.allocate(nx * ny), nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntBufferWrapper(GeneralGridGeometry geometry) {
|
public IntBufferWrapper(IntBuffer buffer, Rectangle dimensions) {
|
||||||
// assume this is going to be a destination and avoid passing
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntBuffer getBuffer() {
|
public IntBufferWrapper(int[] array, Rectangle dimensions) {
|
||||||
return buffer;
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -80,12 +78,11 @@ public class IntBufferWrapper extends DataWrapper1D {
|
||||||
buffer.put(index, (int) dataValue);
|
buffer.put(index, (int) dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
public IntBuffer getBuffer() {
|
||||||
*
|
return buffer;
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
}
|
||||||
* getPrimitiveArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getArray() {
|
public int[] getArray() {
|
||||||
if (buffer.hasArray()) {
|
if (buffer.hasArray()) {
|
||||||
|
@ -94,4 +91,8 @@ public class IntBufferWrapper extends DataWrapper1D {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Integer> getPrimitiveType() {
|
||||||
|
return int.class;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.nio.LongBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* LongBuffer data wrapper
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author bsteffen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
public class LongBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
|
protected final LongBuffer buffer;
|
||||||
|
|
||||||
|
public LongBufferWrapper(LongBuffer buffer, int nx, int ny) {
|
||||||
|
super(nx, ny);
|
||||||
|
this.buffer = buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LongBufferWrapper(long[] array, int nx, int ny) {
|
||||||
|
this(LongBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LongBufferWrapper(int nx, int ny) {
|
||||||
|
this(LongBuffer.allocate(nx * ny), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LongBufferWrapper(LongBuffer buffer, Rectangle dimensions) {
|
||||||
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LongBufferWrapper(long[] array, Rectangle dimensions) {
|
||||||
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LongBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected double getDataValueInternal(int index) {
|
||||||
|
return buffer.get(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDataValueInternal(double dataValue, int index) {
|
||||||
|
buffer.put(index, (long) dataValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LongBuffer getBuffer() {
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long[] getArray() {
|
||||||
|
if (buffer.hasArray()) {
|
||||||
|
return buffer.array();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Long> getPrimitiveType() {
|
||||||
|
return long.class;
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,12 +17,11 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.buffer;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.nio.ShortBuffer;
|
import java.nio.ShortBuffer;
|
||||||
|
|
||||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* ShortBuffer data wrapper
|
* ShortBuffer data wrapper
|
||||||
|
@ -33,41 +32,40 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jun 20, 2012 bsteffen Initial creation
|
* Mar 07, 2014 2791 bsteffen Reimplemnt extending BufferWrapper.
|
||||||
* Nov 19, 2013 2393 bclement added getArray
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class ShortBufferWrapper extends DataWrapper1D {
|
public class ShortBufferWrapper extends BufferWrapper {
|
||||||
|
|
||||||
protected final ShortBuffer buffer;
|
protected final ShortBuffer buffer;
|
||||||
|
|
||||||
public ShortBufferWrapper(ShortBuffer buffer, GeneralGridGeometry geometry) {
|
|
||||||
super(geometry);
|
|
||||||
this.buffer = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShortBufferWrapper(ShortBuffer buffer, int nx, int ny) {
|
public ShortBufferWrapper(ShortBuffer buffer, int nx, int ny) {
|
||||||
super(nx, ny);
|
super(nx, ny);
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ShortBufferWrapper(short[] array, int nx, int ny) {
|
||||||
|
this(ShortBuffer.wrap(array), nx, ny);
|
||||||
|
}
|
||||||
|
|
||||||
public ShortBufferWrapper(int nx, int ny) {
|
public ShortBufferWrapper(int nx, int ny) {
|
||||||
this(ShortBuffer.allocate(nx * ny), nx, ny);
|
this(ShortBuffer.allocate(nx * ny), nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShortBufferWrapper(GeneralGridGeometry geometry) {
|
public ShortBufferWrapper(ShortBuffer buffer, Rectangle dimensions) {
|
||||||
// assume this is going to be a destination and avoid passing
|
this(buffer, dimensions.width, dimensions.height);
|
||||||
// geometry to super to save time on checking for wrapping.
|
|
||||||
this(geometry.getGridRange().getSpan(0), geometry.getGridRange()
|
|
||||||
.getSpan(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShortBuffer getBuffer() {
|
public ShortBufferWrapper(short[] array, Rectangle dimensions) {
|
||||||
return buffer;
|
this(array, dimensions.width, dimensions.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShortBufferWrapper(Rectangle dimensions) {
|
||||||
|
this(dimensions.width, dimensions.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -76,16 +74,15 @@ public class ShortBufferWrapper extends DataWrapper1D {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDataValueInternal(double dataValue, int index) {
|
protected void setDataValueInternal(double dataValue, int index) {
|
||||||
buffer.put(index, (short) dataValue);
|
buffer.put(index, (short) dataValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
public ShortBuffer getBuffer() {
|
||||||
*
|
return buffer;
|
||||||
* @see com.raytheon.uf.common.geospatial.interpolation.data.DataWrapper1D#
|
}
|
||||||
* getPrimitiveArray()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public short[] getArray() {
|
public short[] getArray() {
|
||||||
if (buffer.hasArray()) {
|
if (buffer.hasArray()) {
|
||||||
|
@ -94,4 +91,8 @@ public class ShortBufferWrapper extends DataWrapper1D {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Short> getPrimitiveType() {
|
||||||
|
return short.class;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -17,7 +17,7 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.dest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstraction for writing numeric data from a 2D grid of numeric data.
|
* An abstraction for writing numeric data from a 2D grid of numeric data.
|
||||||
|
@ -26,9 +26,10 @@ package com.raytheon.uf.common.geospatial.interpolation.data;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Jun 18, 2012 bsteffen Initial creation
|
* Jun 18, 2012 bsteffen Initial creation
|
||||||
|
* Mar 07, 2014 2791 bsteffen Move to numeric plugin.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
|
@ -0,0 +1,88 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.common.numeric.dest;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.numeric.filter.DataFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Destination which filters the input values before applying then to another
|
||||||
|
* destination.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------- -------- ----------- --------------------------
|
||||||
|
* Mar 06, 2014 2791 bsteffen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author bsteffen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class FilteredDataDestination implements DataDestination {
|
||||||
|
|
||||||
|
protected final DataDestination wrappedDestination;
|
||||||
|
|
||||||
|
protected final DataFilter[] filters;
|
||||||
|
|
||||||
|
protected FilteredDataDestination(DataDestination wrappedDestination,
|
||||||
|
DataFilter... filters) {
|
||||||
|
this.wrappedDestination = wrappedDestination;
|
||||||
|
this.filters = filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setDataValue(double dataValue, int x, int y) {
|
||||||
|
for (DataFilter filter : filters) {
|
||||||
|
dataValue = filter.filter(dataValue);
|
||||||
|
}
|
||||||
|
wrappedDestination.setDataValue(dataValue, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataDestination getWrappedDestination() {
|
||||||
|
return wrappedDestination;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataFilter[] getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FilteredDataDestination addFilters(
|
||||||
|
DataDestination wrappedDestination, DataFilter... filters) {
|
||||||
|
if (FilteredDataDestination.class.equals(wrappedDestination.getClass())) {
|
||||||
|
FilteredDataDestination oldDest = (FilteredDataDestination) wrappedDestination;
|
||||||
|
DataFilter[] oldFilters = oldDest.getFilters();
|
||||||
|
DataFilter[] newFilters = Arrays.copyOf(oldFilters, filters.length
|
||||||
|
+ oldFilters.length);
|
||||||
|
System.arraycopy(oldFilters, 0, newFilters, filters.length,
|
||||||
|
oldFilters.length);
|
||||||
|
return new FilteredDataDestination(oldDest.getWrappedDestination(),
|
||||||
|
newFilters);
|
||||||
|
} else {
|
||||||
|
return new FilteredDataDestination(wrappedDestination, filters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -17,13 +17,16 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.common.geospatial.interpolation.data;
|
package com.raytheon.uf.common.numeric.filter;
|
||||||
|
|
||||||
import javax.measure.converter.UnitConverter;
|
import com.raytheon.uf.common.numeric.dest.DataDestination;
|
||||||
|
import com.raytheon.uf.common.numeric.source.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* An abstraction for any algorithm that takes a number and converts it to
|
||||||
* Source which wraps another source and converts data on demand.
|
* another number. Some of the uses of filters are data validation, unit
|
||||||
|
* conversion or data mapping. Filters are useful for manipulating data in a
|
||||||
|
* {@link DataSource} or {@link DataDestination}.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -31,37 +34,14 @@ import javax.measure.converter.UnitConverter;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------- -------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Feb 25, 2014 2791 bsteffen Initial creation
|
* Mar 06, 2014 2791 bsteffen Initial creation
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class UnitConvertingDataSource implements DataSource {
|
public interface DataFilter {
|
||||||
|
|
||||||
protected UnitConverter unitConverter;
|
|
||||||
|
|
||||||
protected DataSource wrappedSource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param converter
|
|
||||||
* the unit converter to apply when setting the values in the
|
|
||||||
* destination
|
|
||||||
* @param source
|
|
||||||
* the source to get values from
|
|
||||||
*/
|
|
||||||
public UnitConvertingDataSource(UnitConverter converter, DataSource source) {
|
|
||||||
this.unitConverter = converter;
|
|
||||||
this.wrappedSource = source;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getDataValue(int x, int y) {
|
|
||||||
double val = unitConverter.convert(wrappedSource.getDataValue(x, y));
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public double filter(double value);
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue