Merge "Issue #2791 Fix streamlines that were broken in conversion to data source." into development

Former-commit-id: f87ab02793 [formerly 472d4a213f] [formerly 584c8d2fc3] [formerly 584c8d2fc3 [formerly 609e574825]] [formerly f87ab02793 [formerly 472d4a213f] [formerly 584c8d2fc3] [formerly 584c8d2fc3 [formerly 609e574825]] [formerly e0af16feed [formerly 584c8d2fc3 [formerly 609e574825] [formerly e0af16feed [formerly 045e498e5d6a47bc35fc7d26b8d8b431dcd4b492]]]]]
Former-commit-id: e0af16feed
Former-commit-id: 4dbaf41623 [formerly cbd9ce9df3] [formerly 088b1ebcc0] [formerly 6fec0ba99b1ba5b034c8f8309c741ab4f572e38e [formerly 0b26cd285b56f196e8054113c3a18f6c2f904098] [formerly 088b1ebcc0 [formerly 42d745e515]]]
Former-commit-id: b04aead160bfac95ed431fbc55178a6a187928e1 [formerly b4807b261f95692bc1ddf8cb553d69e7f21499d6] [formerly 39bfdd51e8 [formerly 2e5f76bf21]]
Former-commit-id: 39bfdd51e8
Former-commit-id: d33e5c19a6
This commit is contained in:
Richard Peter 2014-04-01 09:38:23 -05:00 committed by Gerrit Code Review
commit 443976bd0a
2 changed files with 28 additions and 12 deletions

View file

@ -1151,6 +1151,11 @@ public class ContourSupport {
maxspc = 0.25f;
}
if (minX != 0 || minY != 0) {
uW = new OffsetDataSource(uW, minX, minY);
vW = new OffsetDataSource(vW, minX, minY);
}
StrmPakConfig config = new StrmPakConfig(arrowSize, minspc, maxspc,
-1000000f, -999998f);
StreamLineContainer container = StrmPak.strmpak(uW, vW,
@ -1169,9 +1174,10 @@ public class ContourSupport {
StreamLinePoint point = points.get(i);
try {
long tZ0 = System.currentTimeMillis();
rastPosToWorldGrid.transform(new double[] {
maxX - point.getX(), point.getY() + minY }, 0,
valsArr[i], 0, 1);
rastPosToWorldGrid.transform(
new double[] { point.getX() + minX,
point.getY() + minY }, 0, valsArr[i],
0, 1);
long tZ1 = System.currentTimeMillis();
tAccum += (tZ1 - tZ0);
} catch (TransformException e) {

View file

@ -25,8 +25,10 @@ import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.numeric.array.FloatArray2DWrapper;
import com.raytheon.uf.common.numeric.filter.DataFilter;
import com.raytheon.uf.common.numeric.source.AxisSwapDataSource;
import com.raytheon.uf.common.numeric.source.DataSource;
import com.raytheon.uf.common.numeric.source.FilteredDataSource;
import com.raytheon.viz.core.contours.util.StreamLineContainer.StreamLinePoint;
/**
@ -131,7 +133,8 @@ public final class StrmPak {
private final PointValueBuffer<Float> JPnt;
/**
* Generate streamlines using column major float data.
* Generate streamlines using column major float data. The u component is
* assumed to moving in the opposite direction of the x axis.
*
* @param uComp
* data values for the u component of the vector
@ -153,6 +156,13 @@ public final class StrmPak {
DataSource vSource = new FloatArray2DWrapper(vComp, ny, nx);
uSource = new AxisSwapDataSource(uSource);
vSource = new AxisSwapDataSource(vSource);
uSource = FilteredDataSource.addFilters(uSource, new DataFilter() {
@Override
public double filter(double value) {
return -value;
}
});
return strmpak(uSource, vSource, nx, ny, config);
}
@ -521,14 +531,14 @@ public final class StrmPak {
influx = V.getDataValue(i, j) * (1.0f - x)
+ V.getDataValue(ii, j) * x;
} else if (side0 == 2) {
influx = -(U.getDataValue(ii, j) * (1.0f - y) + U
.getDataValue(ii, jj) * y);
influx = U.getDataValue(ii, j) * (1.0f - y)
+ U.getDataValue(ii, jj) * y;
} else if (side0 == 3) {
influx = -(V.getDataValue(i, jj) * (1.0f - x) + V
.getDataValue(ii, jj) * x);
} else {
influx = U.getDataValue(i, j) * (1.0f - y)
+ U.getDataValue(i, jj) * y;
influx = -(U.getDataValue(i, j) * (1.0f - y) + U
.getDataValue(i, jj) * y);
}
if (influx < 0.0f) {
dirflg = -1.0f;
@ -647,12 +657,12 @@ public final class StrmPak {
float[] Flux = { Float.NaN,
(-dirflg) * (float) V.getDataValue(i, j),
(-dirflg) * (float) V.getDataValue(ii, j),
dirflg * (float) U.getDataValue(ii, j),
dirflg * (float) U.getDataValue(ii, jj),
(-dirflg) * (float) U.getDataValue(ii, j),
(-dirflg) * (float) U.getDataValue(ii, jj),
dirflg * (float) V.getDataValue(ii, jj),
dirflg * (float) V.getDataValue(i, jj),
(-dirflg) * (float) U.getDataValue(i, jj),
(-dirflg) * (float) U.getDataValue(i, j) };
dirflg * (float) U.getDataValue(i, jj),
dirflg * (float) U.getDataValue(i, j) };
// Count total number of in, out, and zero contributions
// to net flux.