From 25f2a883956d46e40ac81a92448a880b323f6d1e Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Wed, 26 Feb 2014 15:55:19 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@92337 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gcube/dataanalysis/geo/algorithms/MapsComparator.java | 7 ++++--- .../dataanalysis/geo/algorithms/MapsComparatorNode.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparator.java b/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparator.java index a059835..4ca0a02 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparator.java +++ b/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparator.java @@ -25,6 +25,7 @@ import org.gcube.dataanalysis.geo.connectors.netcdf.NetCDFDataExplorer; import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector; import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor; import org.gcube.dataanalysis.geo.matrixmodel.RasterTable; +import org.gcube.dataanalysis.geo.matrixmodel.XYExtractor; import org.jfree.chart.JFreeChart; import org.jfree.data.function.NormalDistributionFunction2D; import org.jfree.data.general.DatasetUtilities; @@ -108,7 +109,7 @@ public class MapsComparator extends DataAnalysis { // scope = "/gcube"; // String scope = null; 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"); status = 10; @@ -118,7 +119,7 @@ public class MapsComparator extends DataAnalysis { AnalysisLogger.getLogger().debug("MapsComparator: Evaluation Indeed at Resolution: " + resolution); 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"); status = 30; 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); status = 40; 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"); status = 50; RasterTable raster2 = new RasterTable(BBxLL, BBxUR, BByLL, BByUR, z, resolution, resolution, slice2, config); diff --git a/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparatorNode.java b/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparatorNode.java index 562ad8d..98fce90 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparatorNode.java +++ b/src/main/java/org/gcube/dataanalysis/geo/algorithms/MapsComparatorNode.java @@ -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.infrastructure.GeoNetworkInspector; import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor; +import org.gcube.dataanalysis.geo.matrixmodel.XYExtractor; import org.opengis.metadata.Metadata; import ucar.nc2.dt.GridDatatype; @@ -262,12 +263,12 @@ public class MapsComparatorNode extends ActorNode{ int positivescount = 0; if (slicey1<=y2){ - MatrixExtractor intersector = new MatrixExtractor(config); + XYExtractor intersector = new XYExtractor(config); AnalysisLogger.getLogger().debug("MapsComparator: GeoIntersector initialized"); 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); - 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 ysize = slice1.length;