diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparison.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparison.java new file mode 100644 index 0000000..78f2fc0 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparison.java @@ -0,0 +1,47 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; +import org.gcube.dataanalysis.geo.insertion.RasterTable; +import org.gcube.dataanalysis.geo.retrieval.GeoIntersector; + +public class TestMapsComparison { + + static String cfg = "./cfg/"; + public static void main(String[] args) throws Exception{ +// String layertitle = "Ice velocity u from [12-15-02 01:00] to [12-15-09 01:00] (2D) {Native grid ORCA025.L75 monthly average: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod}"; +// String layertitle2 = "Ice velocity v from [12-15-02 01:00] to [12-15-09 01:00] (2D) {Native grid ORCA025.L75 monthly average: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod}"; +// String layertitle = "Number of Observations in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Apparent Oxygen Utilization - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/apparent_oxygen_utilization_annual_1deg_ENVIRONMENT_BIOTA_.nc}"; +// String layertitle2 = "Seasonal or Monthly Climatology minus Annual Climatology in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Apparent Oxygen Utilization - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/apparent_oxygen_utilization_annual_1deg_ENVIRONMENT_BIOTA_.nc}"; +// String layertitle2 = "Number of Mean Values within Radius of Influence in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Apparent Oxygen Utilization - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/apparent_oxygen_utilization_annual_1deg_ENVIRONMENT_BIOTA_.nc}"; +// String layertitle = "Ice velocity u from [12-15-02 01:00] to [12-15-09 01:00] (2D) {Native grid ORCA025.L75 monthly average: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod}"; +// String layertitle2 = "Ice velocity v from [12-15-02 01:00] to [12-15-09 01:00] (2D) {Native grid ORCA025.L75 monthly average: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod}"; + + //String layertitle = "wind stress from [05-01-07 14:00] to [04-01-12 14:00] (2D) {Monthly ASCAT global wind field: Data extracted from dataset http://tds0.ifremer.fr/thredds/dodsC/CERSAT-GLO-CLIM_WIND_L4-OBS_FULL_TIME_SERIE}"; + //String layertitle2 = "wind speed from [05-01-07 14:00] to [04-01-12 14:00] (2D) {Monthly ASCAT global wind field: Data extracted from dataset http://tds0.ifremer.fr/thredds/dodsC/CERSAT-GLO-CLIM_WIND_L4-OBS_FULL_TIME_SERIE}"; + + String layertitle = "Objectively Analyzed Climatology from [02-16-01 01:00] to [11-16-01 01:00] (3D) {World Ocean Atlas 09: Sea Water Salinity - seasonal: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/salinity_seasonal_1deg_ENVIRONMENT_OCEANS_.nc}"; + String layertitle2 = "Objectively Analyzed Climatology from [01-16-01 01:00] to [12-16-01 01:00] (3D) {World Ocean Atlas 09: Apparent Oxygen Utilization - monthly: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/apparent_oxygen_utilization_monthly_1deg_ENVIRONMENT_BIOTA_.nc}"; + + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle2); + config.setParam("ValuesComparisonThreshold","0.01"); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + mc.getOutput(); + } +} diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonAquaMapsvsFAO.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonAquaMapsvsFAO.java new file mode 100644 index 0000000..cba156e --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonAquaMapsvsFAO.java @@ -0,0 +1,38 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; +import org.gcube.dataanalysis.geo.insertion.RasterTable; +import org.gcube.dataanalysis.geo.retrieval.GeoIntersector; + +public class TestMapsComparisonAquaMapsvsFAO { + + static String cfg = "./cfg/"; + public static void main(String[] args) throws Exception{ + String layertitle = "FAO aquatic species distribution map of Eleutheronema tetradactylum"; + String layertitle2 = "Eleutheronema tetradactylum"; + + //{MEAN=0.81, VARIANCE=0.02, NUMBER_OF_ERRORS=6691, NUMBER_OF_COMPARISONS=260281, ACCURACY=97.43, MAXIMUM_ERROR=1.0, MAXIMUM_ERROR_POINT=3103:478:2, TREND=EXPANSION, Resolution=0.5} + + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle2); + config.setParam("ValuesComparisonThreshold","0.5"); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + mc.getOutput(); + } +} diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonExampleTCOM.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonExampleTCOM.java new file mode 100644 index 0000000..8e11372 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonExampleTCOM.java @@ -0,0 +1,36 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; +import org.gcube.dataanalysis.geo.insertion.RasterTable; +import org.gcube.dataanalysis.geo.retrieval.GeoIntersector; + +public class TestMapsComparisonExampleTCOM { + + static String cfg = "./cfg/"; + public static void main(String[] args) throws Exception{ + String layertitle2 = "FAO aquatic species distribution map of Eleutheronema tetradactylum"; + String layertitle = "FAO aquatic species distribution map of Leptomelanosoma indicum"; + + //{MEAN=1.0, VARIANCE=0.0, NUMBER_OF_ERRORS=1823, NUMBER_OF_COMPARISONS=260281, ACCURACY=99.3, MAXIMUM_ERROR=1.0, MAXIMUM_ERROR_POINT=1008:390:1, TREND=EXPANSION, Resolution=0.5} + + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle2); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + } +} diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperature.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperature.java new file mode 100644 index 0000000..dbf1a4d --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperature.java @@ -0,0 +1,41 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; +import org.gcube.dataanalysis.geo.insertion.RasterTable; +import org.gcube.dataanalysis.geo.retrieval.GeoIntersector; + +public class TestMapsComparisonTemperature { + + static String cfg = "./cfg/"; + public static void main(String[] args) throws Exception{ +// String layertitle = "MyDistributionMap"; +// String layertitle = "Mass Concentration of Chlorophyll in Sea Water in [03-30-13 01:00] (3D) {Mercator Ocean BIOMER1V1R1: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-analysis-bio-001-008-a}"; + String layertitle = "Temperature in [12-15-09 01:00] (3D) {Native grid ORCA025.L75 monthly average: Data extracted from dataset http://atoll-mercator.vlandata.cls.fr:44080/thredds/dodsC/global-reanalysis-phys-001-004-b-ref-fr-mjm95-gridt}"; + String layertitle2 = "Statistical Mean in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Sea Water Temperature - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/temperature_annual_1deg_ENVIRONMENT_OCEANS_.nc}"; +// String layertitle2 = "Objectively Analyzed Climatology in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Sea Water Temperature - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/temperature_annual_1deg_ENVIRONMENT_OCEANS_.nc}"; +// String layertitle2 = "FAO AQUATIC SPECIES DISTRIBUTION MAP OF MEGALASPIS CORDYLA"; +// {MEAN=224.49, VARIANCE=10337.11, NUMBER_OF_ERRORS=47054, NUMBER_OF_COMPARISONS=65522, ACCURACY=28.19, MAXIMUM_ERROR=303.6, MAXIMUM_ERROR_POINT=5006:104, Resolution=0.9972222222222222} + + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle2); + config.setParam("ValuesComparisonThreshold",""+100); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + mc.getOutput(); + } +} diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperatureWOA.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperatureWOA.java new file mode 100644 index 0000000..8236196 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisonTemperatureWOA.java @@ -0,0 +1,35 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; + +public class TestMapsComparisonTemperatureWOA { + + static String cfg = "./cfg/"; + public static void main(String[] args) throws Exception{ + String layertitle = "Temperature in [07-01-01 13:00] (3D) {World Ocean Atlas 2005: Tcl version: 8.4.13, NAP version: 6.2.2}"; + String layertitle2 = "Statistical Mean in [07-01-01 01:00] (3D) {World Ocean Atlas 09: Sea Water Temperature - annual: dods://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/temperature_annual_1deg_ENVIRONMENT_OCEANS_.nc}"; + //{MEAN=0.0, VARIANCE=0.0, NUMBER_OF_ERRORS=0, NUMBER_OF_COMPARISONS=65522, ACCURACY=100.0, MAXIMUM_ERROR=0.0, MAXIMUM_ERROR_POINT=null, TREND=STATIONARY, Resolution=0.9972222222222222} + + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle2); + config.setParam("ValuesComparisonThreshold",""+100); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + mc.getOutput(); + } +} diff --git a/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisoninTime.java b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisoninTime.java new file mode 100644 index 0000000..44c7323 --- /dev/null +++ b/src/main/java/org/gcube/dataanalysis/geo/test/maps/TestMapsComparisoninTime.java @@ -0,0 +1,65 @@ +package org.gcube.dataanalysis.geo.test.maps; + +import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; +import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; +import org.gcube.dataanalysis.geo.algorithms.MapsComparator; + +public class TestMapsComparisoninTime { + + static String cfg = "./cfg/"; + + public static void main(String[] args) throws Exception{ + + int[] timeIdx = {0,12,24,36,48,60,72,84,96,108,120}; + + for (int i=1;i0) {MEAN=0.53, VARIANCE=0.28, NUMBER_OF_ERRORS=36075, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.09, MAXIMUM_ERROR=6.0, MAXIMUM_ERROR_POINT=7309:456, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370363639187 +**********(24->12) {MEAN=0.56, VARIANCE=0.3, NUMBER_OF_ERRORS=36053, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.1, MAXIMUM_ERROR=6.95, MAXIMUM_ERROR_POINT=1313:143, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370363722843 Japan +**********(36->24) {MEAN=0.62, VARIANCE=0.33, NUMBER_OF_ERRORS=35744, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.16, MAXIMUM_ERROR=6.87, MAXIMUM_ERROR_POINT=1314:465, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370363798387 +**********(48->36) {MEAN=0.49, VARIANCE=0.22, NUMBER_OF_ERRORS=35664, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.17, MAXIMUM_ERROR=7.54, MAXIMUM_ERROR_POINT=7307:456, TREND=CONTRACTION, Resolution=0.3525954946131244} ELAPSED: 1370363875063 North Carolina +**********(60->48) {MEAN=0.46, VARIANCE=0.23, NUMBER_OF_ERRORS=36133, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.08, MAXIMUM_ERROR=5.42, MAXIMUM_ERROR_POINT=7307:456, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370363953390 +**********(72->60) {MEAN=0.56, VARIANCE=0.31, NUMBER_OF_ERRORS=35970, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.11, MAXIMUM_ERROR=7.01, MAXIMUM_ERROR_POINT=7307:236, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370364033154 +**********(84->72) {MEAN=0.57, VARIANCE=0.31, NUMBER_OF_ERRORS=36148, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.08, MAXIMUM_ERROR=7.02, MAXIMUM_ERROR_POINT=7307:247, TREND=CONTRACTION, Resolution=0.3525954946131244} ELAPSED: 1370364110444 +**********(96->84) {MEAN=0.59, VARIANCE=0.32, NUMBER_OF_ERRORS=35873, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.13, MAXIMUM_ERROR=5.23, MAXIMUM_ERROR_POINT=7306:249, TREND=CONTRACTION, Resolution=0.3525954946131244} ELAPSED: 1370364190900 +**********(108->96) {MEAN=0.53, VARIANCE=0.27, NUMBER_OF_ERRORS=35789, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.15, MAXIMUM_ERROR=4.96, MAXIMUM_ERROR_POINT=7306:249, TREND=EXPANSION, Resolution=0.3525954946131244} ELAPSED: 1370364272133 +**********(120->108) {MEAN=0.62, VARIANCE=0.37, NUMBER_OF_ERRORS=36194, NUMBER_OF_COMPARISONS=522242, ACCURACY=93.07, MAXIMUM_ERROR=5.51, MAXIMUM_ERROR_POINT=1316:352, TREND=EXPANSION, Resolution=0.3525954946131244} pacific ocean + + */ + long t0=0; + AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile); + AlgorithmConfiguration config = new AlgorithmConfiguration(); + config.setConfigPath(cfg); + config.setPersistencePath("./"); + config.setParam("DatabaseUserName","gcube"); + config.setParam("DatabasePassword","d4science2"); + config.setParam("DatabaseURL","jdbc:postgresql://localhost/testdb"); + config.setParam("DatabaseDriver","org.postgresql.Driver"); + config.setParam("LayerTitle_1",layertitle); + config.setParam("LayerTitle_2",layertitle); + config.setParam("TimeIndex_1",""+t1); + config.setParam("TimeIndex_2",""+t2); + config.setParam("ValuesComparisonThreshold","0.01"); + config.setParam("Z","0"); + config.setGcubeScope(null); + + MapsComparator mc = new MapsComparator(); + mc.setConfiguration(config); + mc.init(); + mc.compute(); + mc.getOutput(); + System.out.println("*********("+t2+"->"+t1+") "+mc.outputParameters +" ELAPSED: "+(System.currentTimeMillis()-t0)); + + } +}