Gianpaolo Coro 2013-06-04 08:42:02 +00:00
parent 872d1260b2
commit 1c98739124
1 changed files with 13 additions and 6 deletions

View File

@ -20,9 +20,6 @@ import org.xml.sax.InputSource;
import ucar.ma2.Array; import ucar.ma2.Array;
import ucar.ma2.ArrayFloat; import ucar.ma2.ArrayFloat;
import ucar.ma2.Index;
import ucar.ma2.Index2D;
import ucar.ma2.Index3D;
import ucar.ma2.Range; import ucar.ma2.Range;
import ucar.ma2.StructureData; import ucar.ma2.StructureData;
import ucar.ma2.StructureMembers.Member; import ucar.ma2.StructureMembers.Member;
@ -120,8 +117,11 @@ public class ThreddsDataExplorer {
CoordinateAxis zAxis = gdt.getCoordinateSystem().getVerticalAxis(); CoordinateAxis zAxis = gdt.getCoordinateSystem().getVerticalAxis();
CoordinateAxis xAxis = gdt.getCoordinateSystem().getXHorizAxis(); CoordinateAxis xAxis = gdt.getCoordinateSystem().getXHorizAxis();
CoordinateAxis yAxis = gdt.getCoordinateSystem().getYHorizAxis(); CoordinateAxis yAxis = gdt.getCoordinateSystem().getYHorizAxis();
double resolutionZ = 0;
double resolutionZ = Math.abs((double) (zAxis.getMaxValue() - zAxis.getMinValue()) / (double) zAxis.getShape()[0]); try{
resolutionZ = Math.abs((double) (zAxis.getMaxValue() - zAxis.getMinValue()) / (double) zAxis.getShape()[0]);
AnalysisLogger.getLogger().debug("Zmin:"+ zAxis.getMinValue()+" Zmax:"+zAxis.getMaxValue());
}catch(Exception e){};
double resolutionX = Math.abs((double) (xAxis.getMaxValue() - xAxis.getMinValue()) / (double) xAxis.getShape()[0]); double resolutionX = Math.abs((double) (xAxis.getMaxValue() - xAxis.getMinValue()) / (double) xAxis.getShape()[0]);
double resolutionY = Math.abs((double) (yAxis.getMaxValue() - yAxis.getMinValue()) / (double) yAxis.getShape()[0]); double resolutionY = Math.abs((double) (yAxis.getMaxValue() - yAxis.getMinValue()) / (double) yAxis.getShape()[0]);
@ -142,6 +142,12 @@ public class ThreddsDataExplorer {
xD=shapeD[2]; xD=shapeD[2];
} }
else if (shapeD.length>1)
{
yD=shapeD[0];
xD=shapeD[1];
}
AnalysisLogger.getLogger().debug("Shape: Z:"+zD+" X:"+ xD+" Y:"+yD); AnalysisLogger.getLogger().debug("Shape: Z:"+zD+" X:"+ xD+" Y:"+yD);
AnalysisLogger.getLogger().debug("Layer Information Retrieval ELAPSED Time: " + (System.currentTimeMillis() - t01)); AnalysisLogger.getLogger().debug("Layer Information Retrieval ELAPSED Time: " + (System.currentTimeMillis() - t01));
@ -153,7 +159,7 @@ public class ThreddsDataExplorer {
data3 = (ArrayFloat.D3) data; data3 = (ArrayFloat.D3) data;
else else
data2 = (ArrayFloat.D2) data; data2 = (ArrayFloat.D2) data;
AnalysisLogger.getLogger().debug("Z dimension: "+zD+" Zmin:"+ zAxis.getMinValue()+" Zmax:"+zAxis.getMaxValue());
double xmin = xAxis.getMinValue(); double xmin = xAxis.getMinValue();
double xmax = xAxis.getMaxValue(); double xmax = xAxis.getMaxValue();
@ -205,6 +211,7 @@ public class ThreddsDataExplorer {
val = Double.valueOf(data3.get(zint, yint, xint)); val = Double.valueOf(data3.get(zint, yint, xint));
}else if (data2 != null) }else if (data2 != null)
val = Double.valueOf(data2.get(yint, xint)); val = Double.valueOf(data2.get(yint, xint));
values.add(val); values.add(val);
} }
break; break;