From eee0d925ec826ee9f8abb5546cb2bd40436dc7ea Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Tue, 14 Aug 2012 13:44:21 -0500 Subject: [PATCH] Issue #1058 fix reprojection of wind vectors Former-commit-id: 09c412d7547d9a3243723e6bec6b8ff66d0ec992 [formerly c25c08c8e73af5519aefe27d7171c0ecb1737114 [formerly 315965383123120bffe1faa1d63fdfb7b633bc97]] Former-commit-id: c25c08c8e73af5519aefe27d7171c0ecb1737114 Former-commit-id: 283781ba03f1fd516935195c117669608e06ec48 --- .../grid/rsc/general/D2DGribGridResource.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/D2DGribGridResource.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/D2DGribGridResource.java index d65494e59b..28888ed1a6 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/D2DGribGridResource.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/rsc/general/D2DGribGridResource.java @@ -73,7 +73,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 9, 2011 bsteffen Initial creation - * 06/19/2012 14988 D. Friedman Reproject based on conformality + * 06/19/2012 14988 D. Friedman Reproject based on conformality * * * @@ -124,7 +124,7 @@ public class D2DGribGridResource extends GribGridResource @Override public GridGeometry2D getGridGeometry() { if (reprojectionInterpolation == null) { - return gribModel.getLocation().getGridGeometry(); + return super.getGridGeometry(); } else { return GridGeometry2D.wrap(reprojectionInterpolation .getTargetGeometry()); @@ -156,13 +156,13 @@ public class D2DGribGridResource extends GribGridResource Interpolation interp = new BilinearInterpolation(); if (data.isVector()) { DataSource source = new FloatBufferWrapper( - data.getUComponent(), getGridGeometry()); + data.getUComponent(), super.getGridGeometry()); FloatArrayWrapper dest = new FloatArrayWrapper( reprojectionInterpolation.getTargetGeometry()); float[] udata = reprojectionInterpolation.reprojectedGrid( interp, source, dest).getArray(); source = new FloatBufferWrapper(data.getVComponent(), - getGridGeometry()); + super.getGridGeometry()); dest = new FloatArrayWrapper( reprojectionInterpolation.getTargetGeometry()); float[] vdata = reprojectionInterpolation.reprojectedGrid( @@ -211,7 +211,7 @@ public class D2DGribGridResource extends GribGridResource } else { DataSource source = new FloatBufferWrapper( - data.getScalarData(), getGridGeometry()); + data.getScalarData(), super.getGridGeometry()); FloatArrayWrapper dest = new FloatArrayWrapper( reprojectionInterpolation.getTargetGeometry()); float[] fdata = reprojectionInterpolation.reprojectedGrid( @@ -278,9 +278,10 @@ public class D2DGribGridResource extends GribGridResource if (location != null && location.getSpacingUnit().equals("degree")) { double dx = location.getDx(); Integer nx = location.getNx(); - //if (dx * nx >= 360) { // Test changed for DR 14988 to the following - - if (! ConformalityUtil.testConformality(location.getGridGeometry(), + // if (dx * nx >= 360) { // Test changed for DR 14988 to the + // following + + if (!ConformalityUtil.testConformality(location.getGridGeometry(), descriptor.getGridGeometry())) { try { GridGeometry2D sourceGeometry = location.getGridGeometry();