Gianpaolo Coro 2014-02-26 15:55:19 +00:00
parent eadc863c18
commit 25f2a88395
2 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,7 @@ import org.gcube.dataanalysis.geo.connectors.netcdf.NetCDFDataExplorer;
import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector; import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector;
import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor; import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor;
import org.gcube.dataanalysis.geo.matrixmodel.RasterTable; import org.gcube.dataanalysis.geo.matrixmodel.RasterTable;
import org.gcube.dataanalysis.geo.matrixmodel.XYExtractor;
import org.jfree.chart.JFreeChart; import org.jfree.chart.JFreeChart;
import org.jfree.data.function.NormalDistributionFunction2D; import org.jfree.data.function.NormalDistributionFunction2D;
import org.jfree.data.general.DatasetUtilities; import org.jfree.data.general.DatasetUtilities;
@ -108,7 +109,7 @@ public class MapsComparator extends DataAnalysis {
// scope = "/gcube"; // scope = "/gcube";
// String scope = null; // String scope = null;
AnalysisLogger.getLogger().debug("MapsComparator: Using Scope: " + scope + " Z: " + z + " Values Threshold: " + valuesthreshold + " Layer1: " + layerT1 + " vs " + layerT2); AnalysisLogger.getLogger().debug("MapsComparator: Using Scope: " + scope + " Z: " + z + " Values Threshold: " + valuesthreshold + " Layer1: " + layerT1 + " vs " + layerT2);
MatrixExtractor intersector = new MatrixExtractor(config); XYExtractor intersector = new XYExtractor (config);
AnalysisLogger.getLogger().debug("MapsComparator: MatrixExtractor initialized"); AnalysisLogger.getLogger().debug("MapsComparator: MatrixExtractor initialized");
status = 10; status = 10;
@ -118,7 +119,7 @@ public class MapsComparator extends DataAnalysis {
AnalysisLogger.getLogger().debug("MapsComparator: Evaluation Indeed at Resolution: " + resolution); AnalysisLogger.getLogger().debug("MapsComparator: Evaluation Indeed at Resolution: " + resolution);
AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 1****"); AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 1****");
double[][] slice1 = intersector.takeTimeInstantMatrix(layerT1, time1, BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution); double[][] slice1 = intersector.extractXYGrid(layerT1, time1, BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution);
AnalysisLogger.getLogger().debug("MapsComparator: Dumping map 1"); AnalysisLogger.getLogger().debug("MapsComparator: Dumping map 1");
status = 30; status = 30;
RasterTable raster1 = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution, slice1, config); RasterTable raster1 = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution, slice1, config);
@ -127,7 +128,7 @@ public class MapsComparator extends DataAnalysis {
AnalysisLogger.getLogger().debug("MapsComparator: Map 1 was dumped in table: " + rastertable1); AnalysisLogger.getLogger().debug("MapsComparator: Map 1 was dumped in table: " + rastertable1);
status = 40; status = 40;
AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 2****"); AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 2****");
double[][] slice2 = intersector.takeTimeInstantMatrix(layerT2, time2, BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution); double[][] slice2 = intersector.extractXYGrid(layerT2, time2, BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution);
AnalysisLogger.getLogger().debug("MapsComparator: Dumping map 2"); AnalysisLogger.getLogger().debug("MapsComparator: Dumping map 2");
status = 50; status = 50;
RasterTable raster2 = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution, slice2, config); RasterTable raster2 = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution, slice2, config);

View File

@ -26,6 +26,7 @@ import org.gcube.dataanalysis.executor.job.management.QueueJobManager;
import org.gcube.dataanalysis.geo.connectors.netcdf.NetCDFDataExplorer; import org.gcube.dataanalysis.geo.connectors.netcdf.NetCDFDataExplorer;
import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector; import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector;
import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor; import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor;
import org.gcube.dataanalysis.geo.matrixmodel.XYExtractor;
import org.opengis.metadata.Metadata; import org.opengis.metadata.Metadata;
import ucar.nc2.dt.GridDatatype; import ucar.nc2.dt.GridDatatype;
@ -262,12 +263,12 @@ public class MapsComparatorNode extends ActorNode{
int positivescount = 0; int positivescount = 0;
if (slicey1<=y2){ if (slicey1<=y2){
MatrixExtractor intersector = new MatrixExtractor(config); XYExtractor intersector = new XYExtractor(config);
AnalysisLogger.getLogger().debug("MapsComparator: GeoIntersector initialized"); AnalysisLogger.getLogger().debug("MapsComparator: GeoIntersector initialized");
AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 1 in the range: ("+x1+" , "+slicey1+"; "+x2+" , "+slicey2+") with res "+resolution); AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 1 in the range: ("+x1+" , "+slicey1+"; "+x2+" , "+slicey2+") with res "+resolution);
double[][] slice1 = intersector.takeTimeInstantMatrix(layerT1, time1, x1, x2, slicey1, slicey2, z, resolution, resolution); double[][] slice1 = intersector.extractXYGrid(layerT1, time1, x1, x2, slicey1, slicey2, z, resolution, resolution);
AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 2 in the range: ("+x1+" , "+slicey1+"; "+x2+" , "+slicey2+") with res "+resolution); AnalysisLogger.getLogger().debug("MapsComparator: ****Rasterizing map 2 in the range: ("+x1+" , "+slicey1+"; "+x2+" , "+slicey2+") with res "+resolution);
double[][] slice2 = intersector.takeTimeInstantMatrix(layerT2, time1, x1, x2, slicey1, slicey2, z, resolution, resolution); double[][] slice2 = intersector.extractXYGrid(layerT2, time1, x1, x2, slicey1, slicey2, z, resolution, resolution);
int xsize = slice1[0].length; int xsize = slice1[0].length;
int ysize = slice1.length; int ysize = slice1.length;