git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/SeaDataNetConnector@120148 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a123015d16
commit
874dee3b71
|
@ -112,17 +112,37 @@ public class SeaDataNetConnector extends StandardLocalExternalAlgorithm {
|
||||||
DivaFilePostResponse response=neo.uploadFile(fileForDiva);
|
DivaFilePostResponse response=neo.uploadFile(fileForDiva);
|
||||||
AnalysisLogger.getLogger().debug("Server Response: "+response.getSessionid());
|
AnalysisLogger.getLogger().debug("Server Response: "+response.getSessionid());
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
//ANALYSIS
|
//ANALYSIS
|
||||||
Double correlationVal = Double.parseDouble(config.getParam("CorrelationLength"));
|
Double correlationVal = Double.parseDouble(config.getParam("CorrelationLength"));
|
||||||
Double signalNoiseVal = Double.parseDouble(config.getParam("SignalNoise"));
|
Double signalNoiseVal = Double.parseDouble(config.getParam("SignalNoise"));
|
||||||
|
|
||||||
|
|
||||||
Double longMinVal = Double.parseDouble(config.getParam("LongitudeMinValue"));
|
Double longMinVal = Double.parseDouble(config.getParam("LongitudeMinValue"));
|
||||||
|
if(longMinVal<-180)
|
||||||
|
throw new Exception("Longitudine minumum value is less than -180.");
|
||||||
|
|
||||||
Double longMaxVal = Double.parseDouble(config.getParam("LongitudeMaxValue"));
|
Double longMaxVal = Double.parseDouble(config.getParam("LongitudeMaxValue"));
|
||||||
|
if(longMaxVal>180)
|
||||||
|
throw new Exception("Longitudine maximum value is more than 180.");
|
||||||
|
|
||||||
Double longResolutionVal = Double.parseDouble(config.getParam("LongitudeResolution"));
|
Double longResolutionVal = Double.parseDouble(config.getParam("LongitudeResolution"));
|
||||||
|
|
||||||
Double latMinVal = Double.parseDouble(config.getParam("LatitudeMinValue"));
|
Double latMinVal = Double.parseDouble(config.getParam("LatitudeMinValue"));
|
||||||
|
if(latMinVal<-90)
|
||||||
|
throw new Exception("Latitude minumum value is less than -90.");
|
||||||
|
|
||||||
Double latMaxVal = Double.parseDouble(config.getParam("LatitudeMaxValue"));
|
Double latMaxVal = Double.parseDouble(config.getParam("LatitudeMaxValue"));
|
||||||
|
if(latMaxVal>90)
|
||||||
|
throw new Exception("Latitude maximum value is more than 90.");
|
||||||
|
|
||||||
Double latResolutionVal = Double.parseDouble(config.getParam("LatitudeResolution"));
|
Double latResolutionVal = Double.parseDouble(config.getParam("LatitudeResolution"));
|
||||||
|
|
||||||
Double depthLevelVal = Double.parseDouble(config.getParam("DepthLevel"));
|
Double depthLevelVal = Double.parseDouble(config.getParam("DepthLevel"));
|
||||||
|
if((depthLevelVal<-10)||(depthLevelVal>10))
|
||||||
|
throw new Exception("Depth Level is out of range [-10,10]");
|
||||||
|
|
||||||
|
|
||||||
DivaAnalysisGetResponse respAnalysis = neo.getAnalysis(response.getSessionid(),
|
DivaAnalysisGetResponse respAnalysis = neo.getAnalysis(response.getSessionid(),
|
||||||
correlationVal, signalNoiseVal, longMinVal, longMaxVal, longResolutionVal,
|
correlationVal, signalNoiseVal, longMinVal, longMaxVal, longResolutionVal,
|
||||||
|
@ -133,9 +153,18 @@ public class SeaDataNetConnector extends StandardLocalExternalAlgorithm {
|
||||||
statResultMap.put("Number of observations used", ""+respAnalysis.getStat_obs_count_used());
|
statResultMap.put("Number of observations used", ""+respAnalysis.getStat_obs_count_used());
|
||||||
statResultMap.put("Posterior probability of the model", ""+respAnalysis.getStat_posteriori_stn());
|
statResultMap.put("Posterior probability of the model", ""+respAnalysis.getStat_posteriori_stn());
|
||||||
|
|
||||||
|
|
||||||
//DOWNLOAD FILE
|
//DOWNLOAD FILE
|
||||||
neo.downloadFileDiva(neo.WEB_HTTP+neo.DOWN_FILE_NC+respAnalysis.getIdentifier(),
|
neo.downloadFileDiva(neo.WEB_HTTP+neo.DOWN_FILE_NC+respAnalysis.getIdentifier(),
|
||||||
neofile.getAbsolutePath());
|
neofile.getAbsolutePath());
|
||||||
|
}
|
||||||
|
catch(Exception e){
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
neofile.delete();
|
||||||
|
AnalysisLogger.getLogger().debug("file deleted");;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -159,6 +188,7 @@ public class SeaDataNetConnector extends StandardLocalExternalAlgorithm {
|
||||||
inputs.add(p3);
|
inputs.add(p3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PrimitiveType p4 = new PrimitiveType(Double.class.getName(),
|
PrimitiveType p4 = new PrimitiveType(Double.class.getName(),
|
||||||
null, PrimitiveTypes.NUMBER, "LongitudeMinValue",
|
null, PrimitiveTypes.NUMBER, "LongitudeMinValue",
|
||||||
"Minimum value of Longitude Range","-180");
|
"Minimum value of Longitude Range","-180");
|
||||||
|
@ -206,6 +236,9 @@ public class SeaDataNetConnector extends StandardLocalExternalAlgorithm {
|
||||||
inputs.add(p12);
|
inputs.add(p12);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DatabaseType.addDefaultDBPars(inputs);
|
DatabaseType.addDefaultDBPars(inputs);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,12 +48,12 @@ public class TestSeaDataNetConnector {
|
||||||
config.setParam("Latitude", "centerlat");
|
config.setParam("Latitude", "centerlat");
|
||||||
config.setParam("Quantity", "landdist");
|
config.setParam("Quantity", "landdist");
|
||||||
|
|
||||||
config.setParam("LongitudeMinValue", "-180");
|
config.setParam("LongitudeMinValue", "-200");
|
||||||
config.setParam("LongitudeMaxValue", "180");
|
config.setParam("LongitudeMaxValue", "180");
|
||||||
config.setParam("LongitudeResolution", "3");
|
config.setParam("LongitudeResolution", "3");
|
||||||
|
|
||||||
config.setParam("LatitudeMinValue", "-70");
|
config.setParam("LatitudeMinValue", "-90");
|
||||||
config.setParam("LatitudeMaxValue", "70");
|
config.setParam("LatitudeMaxValue", "90");
|
||||||
config.setParam("LatitudeResolution", "3");
|
config.setParam("LatitudeResolution", "3");
|
||||||
|
|
||||||
config.setParam("CorrelationLength", "10");
|
config.setParam("CorrelationLength", "10");
|
||||||
|
|
Loading…
Reference in New Issue