From 8e7a03a02d2781a268b37e00550066b63367bb5b Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Thu, 29 Mar 2012 10:17:48 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@52234 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../bioclimate/ExperimentForArticle.java | 59 +++++++++++++ .../bioclimate/ExperimentHSPECForArticle.java | 82 +++++++++++++++++++ .../bioclimate/InterpolateTables.java | 2 +- .../aquamaps/AquamapsEnvelopeAlgorithm.java | 1 + .../dataanalysis/ecoengine/user/ModelerT.java | 2 +- 5 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentForArticle.java create mode 100644 src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentHSPECForArticle.java diff --git a/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentForArticle.java b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentForArticle.java new file mode 100644 index 0000000..f0ebf2f --- /dev/null +++ b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentForArticle.java @@ -0,0 +1,59 @@ +package org.gcube.dataanalysis.ecoengine.evaluation.bioclimate; + +import org.gcube.dataanalysis.ecoengine.user.GeneratorT; +import org.gcube.dataanalysis.ecoengine.user.ModelerT; + +public class ExperimentForArticle { + + public static void main(String[] args) throws Exception { + String configPath = "./cfg/"; + + final String[] csquareTables = { + "hcaf_d_2016_linear_01332632269756", + "hcaf_d_2020_linear_11332632270082", + "hcaf_d_2024_linear_21332632270343", + "hcaf_d_2028_linear_31332632270608", + "hcaf_d_2032_linear_41332632270847", + "hcaf_d_2036_linear_51332632271080", + "hcaf_d_2040_linear_61332632271334", + "hcaf_d_2044_linear_71332632271560", + "hcaf_d_2050" + }; + final String [] envelopeOutputTable = {"hspen_2016","hspen_2020","hspen_2024","hspen_2028","hspen_2032","hspen_2036","hspen_2040","hspen_2044","hspen_2050"}; + + final String [] finalDistributionTable = { "hspec_2016", "hspec_2020", "hspec_2024", "hspec_2028", "hspec_2032", "hspec_2036", "hspec_2040", "hspec_2044", "hspec_2050"}; + + /* + String [] csquareTable = {"hcaf_d","hcaf_d_2050"}; + String [] envelopeOutputTable = {"hspen_micro_0","hspen_micro_2050"}; + String [] finalDistributionTable = {"hspec_0","hspec_2050"}; + */ + + String preprocessedTable = "maxminlat_hspen"; + String envelopeTable = "hspen"; + String occurrenceCells = "occurrenceCells"; + + String commonkeycolumn = "csquarecode"; + String probabilitycolumn = "probability"; + + int numberOfResources = 4; + + String speciesCode = "Fis-10199"; + String userName = "gianpaolo.coro"; + String modelName = "HSPEN"; + String generatorName = "AQUAMAPS_SUITABLE"; + String qualityOperationName = "QUALITY_ANALYSIS"; + String discrepancyOperationName = "DISCREPANCY_ANALYSIS"; + String finalDistributionKeyColumn = "csquarecode"; + + for (int i =0;i "+ envelopeOutputTable[i]); + ModelerT.train(ModelerT.getTrainingConfigHSPEN(modelName, envelopeOutputTable[i], occurrenceCells,envelopeTable,csquareTables[i],configPath)); + // Generate +// GeneratorT.generate(GeneratorT.getGenerationConfig(numberOfResources, generatorName, envelopeOutputTable[i], preprocessedTable, speciesCode, userName, csquareTables[i], finalDistributionTable[i], configPath)); + } + System.out.println("COMPUTATION FINISHED!"); + } + +} diff --git a/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentHSPECForArticle.java b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentHSPECForArticle.java new file mode 100644 index 0000000..f91ab54 --- /dev/null +++ b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/ExperimentHSPECForArticle.java @@ -0,0 +1,82 @@ +package org.gcube.dataanalysis.ecoengine.evaluation.bioclimate; + +import org.gcube.dataanalysis.ecoengine.user.GeneratorT; +import org.gcube.dataanalysis.ecoengine.user.ModelerT; + +public class ExperimentHSPECForArticle { + + public static void main(String[] args) throws Exception { + String configPath = "./cfg/"; + + final String[] csquareTables = { + "hcaf_d", + "hcaf_d_2016_linear_01332632269756", + "hcaf_d_2020_linear_11332632270082", + "hcaf_d_2024_linear_21332632270343", + "hcaf_d_2028_linear_31332632270608", + "hcaf_d_2032_linear_41332632270847", + "hcaf_d_2036_linear_51332632271080", + "hcaf_d_2040_linear_61332632271334", + "hcaf_d_2044_linear_71332632271560", + "hcaf_d_2050" + }; + + final String [] envelopeOutputTable = { + "hspen", + "hspen_2016", + "hspen_2020", + "hspen_2024", + "hspen_2028", + "hspen_2032", + "hspen_2036", + "hspen_2040", + "hspen_2044", + "hspen_2050" + }; + + final String [] finalDistributionTable = { + "hspec_2012", + "hspec_2016", + "hspec_2020", + "hspec_2024", + "hspec_2028", + "hspec_2032", + "hspec_2036", + "hspec_2040", + "hspec_2044", + "hspec_2050" + }; + + /* + String [] csquareTable = {"hcaf_d","hcaf_d_2050"}; + String [] envelopeOutputTable = {"hspen_micro_0","hspen_micro_2050"}; + String [] finalDistributionTable = {"hspec_0","hspec_2050"}; + */ + + String preprocessedTable = "maxminlat_hspen"; + String envelopeTable = "hspen"; + String occurrenceCells = "occurrenceCells"; + + String commonkeycolumn = "csquarecode"; + String probabilitycolumn = "probability"; + + int numberOfResources = 4; + + String speciesCode = "Fis-10199"; + String userName = "gianpaolo.coro"; + String modelName = "HSPEN"; + String generatorName = "AQUAMAPS_SUITABLE"; + String qualityOperationName = "QUALITY_ANALYSIS"; + String discrepancyOperationName = "DISCREPANCY_ANALYSIS"; + String finalDistributionKeyColumn = "csquarecode"; + + for (int i =0;i "+finalDistributionTable[i]); + // Generate + GeneratorT.generate(GeneratorT.getGenerationConfig(numberOfResources, generatorName, envelopeOutputTable[i], preprocessedTable, speciesCode, userName, csquareTables[i], finalDistributionTable[i], configPath)); + } + System.out.println("COMPUTATION FINISHED!"); + } + +} diff --git a/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/InterpolateTables.java b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/InterpolateTables.java index 892abd5..c15a931 100644 --- a/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/InterpolateTables.java +++ b/src/org/gcube/dataanalysis/ecoengine/evaluation/bioclimate/InterpolateTables.java @@ -268,7 +268,7 @@ public class InterpolateTables { String databasePassword = "d4science2"; InterpolateTables interp = new InterpolateTables(configPath, persistencePath, databaseUrl, databaseUser, databasePassword); - interp.interpolate("hcaf_d", "hcaf_d_2050", 10, INTERPOLATIONFUNCTIONS.PARABOLIC, 2012, 2050); + interp.interpolate("hcaf_d", "hcaf_d_2050", 10, INTERPOLATIONFUNCTIONS.LINEAR, 2012, 2050); } diff --git a/src/org/gcube/dataanalysis/ecoengine/models/cores/aquamaps/AquamapsEnvelopeAlgorithm.java b/src/org/gcube/dataanalysis/ecoengine/models/cores/aquamaps/AquamapsEnvelopeAlgorithm.java index 74f7854..d960fc0 100644 --- a/src/org/gcube/dataanalysis/ecoengine/models/cores/aquamaps/AquamapsEnvelopeAlgorithm.java +++ b/src/org/gcube/dataanalysis/ecoengine/models/cores/aquamaps/AquamapsEnvelopeAlgorithm.java @@ -194,6 +194,7 @@ public class AquamapsEnvelopeAlgorithm { String IceQuery = String.format(dynamicSelectValues,IceField,species); String LanddistQuery = String.format(dynamicSelectValues,LanddistField,species); + System.out.println(TemperatureQuery); List tempvalues = DatabaseFactory.executeSQLQuery(TemperatureQuery, vreConnection); List salinityvalues = DatabaseFactory.executeSQLQuery(SalinityQuery, vreConnection); List primprodvalues = DatabaseFactory.executeSQLQuery(PrimProdQuery, vreConnection); diff --git a/src/org/gcube/dataanalysis/ecoengine/user/ModelerT.java b/src/org/gcube/dataanalysis/ecoengine/user/ModelerT.java index 163124c..d53fa6d 100644 --- a/src/org/gcube/dataanalysis/ecoengine/user/ModelerT.java +++ b/src/org/gcube/dataanalysis/ecoengine/user/ModelerT.java @@ -54,7 +54,7 @@ public class ModelerT implements Runnable { AlgorithmConfiguration config = new AlgorithmConfiguration(); config.setConfigPath(configPath); config.setPersistencePath("./"); - config.setNumberOfResources(2); + config.setNumberOfResources(4); config.setModel("HSPEN"); config.setParam("OuputEnvelopeTable", outputTable);