This commit is contained in:
Gianpaolo Coro 2012-06-26 15:32:37 +00:00
parent 2e8fd2d1dd
commit fee25d9383
3 changed files with 63 additions and 2 deletions

View File

@ -114,6 +114,10 @@ public class BioClimateAnalysis {
}
private void produceGraphs(String[] csquareTableNames, String[] hspecTableNames, float threshold) throws Exception {
csquareTableNames = checkTableNames(csquareTableNames);
hspecTableNames = checkTableNames(hspecTableNames);
producedImages = new HashMap<String,Image> ();
int numberOfTrends = highProbabilityCells.length;
@ -186,6 +190,8 @@ public class BioClimateAnalysis {
private String[] checkTableNames(String [] tablesNames){
ArrayList<String> newtables = new ArrayList<String>();
if ((tablesNames==null) || (tablesNames.length==0))
return tablesNames;
for (String table:tablesNames){
int i=1;
String originalTable = table;

View File

@ -273,7 +273,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.LINEAR, 2012, 2050);
interp.interpolate("hcaf_d", "hcaf_d_2050", 5, INTERPOLATIONFUNCTIONS.LINEAR, 2012, 2050);
}

View File

@ -4,7 +4,7 @@ import org.gcube.dataanalysis.ecoengine.evaluation.bioclimate.BioClimateAnalysis
public class TestBioClimateAnalysis {
public static void main(String args[]) throws Exception{
String dburl = "jdbc:postgresql://node49.p.d4science.research-infrastructures.eu/aquamaps";
@ -12,6 +12,61 @@ public class TestBioClimateAnalysis {
String dbPassword = "bilico1980";
BioClimateAnalysis bioClimate=new BioClimateAnalysis("./cfg/","./",dburl, dbUser, dbPassword, true);
final String [] hcafTable = {
"hcaf_d",
"hcaf_d_2015_LINEAR_01338580273835",
"hcaf_d_2018_LINEAR_11338580276548",
"hcaf_d_2021_LINEAR_21338580279237",
"hcaf_d_2024_LINEAR_31338580282780",
"hcaf_d_2027_LINEAR_41338580283400",
"hcaf_d_2030_LINEAR_51338580284030",
"hcaf_d_2033_LINEAR_61338580284663",
"hcaf_d_2036_LINEAR_71338580285205",
"hcaf_d_2039_LINEAR_81338580285958",
"hcaf_d_2042_LINEAR_91338580286545",
"hcaf_d_2050"
};
final String [] hcafTableNames = {
"test",
"test",
"test",
"test",
"test",
"test",
"test",
"test",
"test",
"test",
"test",
"test"
};
final String [] hspecTables = {
"hspec2012_06_01_14_28_21_588",
"hspec2012_05_31_17_41_13_631"
};
final String [] hspecTableNames = {
"htest",
"htest",
};
// bioClimate.hcafEvolutionAnalysis(hcafTable, hcafTableNames);
// bioClimate.globalEvolutionAnalysis(hcafTable, hspecTables, hcafTableNames, hspecTableNames, "probability", "csquare", 0.01f);
bioClimate.globalEvolutionAnalysis(null, hspecTables, null, hspecTableNames, "probability", "csquare", 0.01f);
}
public static void main1(String args[]) throws Exception{
String dburl = "jdbc:postgresql://node49.p.d4science.research-infrastructures.eu/aquamaps";
String dbUser = "gcube";
String dbPassword = "bilico1980";
BioClimateAnalysis bioClimate=new BioClimateAnalysis("./cfg/","./",dburl, dbUser, dbPassword, true);