Commit 65a06613 authored by rink's avatar rink
Browse files

snapshot

parent fe9814af
......@@ -25,10 +25,9 @@ public class XTrackScanLatLonSet extends GriddedLatLonSet {
scanSets = new GriddedLatLonSet[numOfScans];
int scanLen = linesPerScan*lengthX;
float[] scanLonArray = new float[linesPerScan*lengthX];
float[] scanLatArray = new float[linesPerScan*lengthX];
for (int k=0; k<numOfScans; k++) {
float[] scanLonArray = new float[linesPerScan*lengthX];
float[] scanLatArray = new float[linesPerScan*lengthX];
System.arraycopy(lons, k*scanLen, scanLonArray, 0, scanLen);
System.arraycopy(lats, k*scanLen, scanLatArray, 0, scanLen);
......@@ -88,6 +87,8 @@ public class XTrackScanLatLonSet extends GriddedLatLonSet {
float[][] lonlat = new float[2][1];
int[] guess_set = new int[2];
guess_set[0] = gx;
guess_set[1] = linesPerScan/2;
for (int i=0; i<length; i++) {
......@@ -119,7 +120,9 @@ public class XTrackScanLatLonSet extends GriddedLatLonSet {
lonlat[latI][0] = targetLat;
float[][] gxgy;
while (lastSetIdx >= 0 && lastSetIdx < numOfScans) {
int cnt = 0;
int dir = 0;
while ((lastSetIdx >= 0 && lastSetIdx < numOfScans) && cnt < numOfScans) {
GriddedLatLonSet scanSet = scanSets[lastSetIdx];
gxgy = scanSet.valueToGrid(lonlat, guess_set);
......@@ -131,15 +134,24 @@ public class XTrackScanLatLonSet extends GriddedLatLonSet {
lastSetIdx -= 1;
guess_set[0] = gx_set;
guess_set[1] = linesPerScan-1;
if (dir == 1) {
break;
}
dir = -1;
}
else if (gy_set == linesPerScan-1) {
lastSetIdx += 1;
guess_set[0] = gx_set;
guess_set[1] = 0;
if (dir == -1) {
break;
}
dir = 1;
}
else if (gx_set == 0 || gx_set == LengthX-1) {
break;
}
cnt++;
}
else {
grid[0][i] = gxgy[0][0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment