better management of netcdf data
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@126652 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
bdb0cb2186
commit
3bd6490699
57
pom.xml
57
pom.xml
|
@ -9,11 +9,28 @@
|
|||
</parent>
|
||||
<groupId>org.gcube.dataanalysis</groupId>
|
||||
<artifactId>ecological-engine-geospatial-extensions</artifactId>
|
||||
<version>1.3.7-SNAPSHOT</version>
|
||||
<name>ecological-engine-geospatial-extension</name>
|
||||
<version>1.3.8-SNAPSHOT</version>
|
||||
<name>ecological-engine-geospatial-extension library</name>
|
||||
<description>ecological-engine-geospatial-extension</description>
|
||||
<scm>
|
||||
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension</url>
|
||||
</scm>
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Gianpaolo Coro</name>
|
||||
<email>gianpaolo.coro@isti.cnr.it</email>
|
||||
<organization>CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"</organization>
|
||||
<roles>
|
||||
<role>architect</role>
|
||||
<role>developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<properties>
|
||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||
<distroDirectory>distro</distroDirectory>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -125,8 +142,11 @@
|
|||
</repositories>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
|
@ -135,37 +155,14 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.12</version>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-profile</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>target</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${distroDirectory}</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>profile.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
|
|
|
@ -87,7 +87,9 @@ public class NetCDFDataExplorer {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
AnalysisLogger.getLogger().debug("NetCDF Explorer Error:" + e.getLocalizedMessage());
|
||||
AnalysisLogger.getLogger().debug(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +209,7 @@ public class NetCDFDataExplorer {
|
|||
xmin = -180;
|
||||
is0_360 = true;
|
||||
}
|
||||
|
||||
AnalysisLogger.getLogger().debug("Assigning "+tsize+" grid elements to the NetCDF values");
|
||||
for (int i = 0; i < tsize; i++) {
|
||||
int zint = 0;
|
||||
int xint = 0;
|
||||
|
@ -239,7 +241,7 @@ public class NetCDFDataExplorer {
|
|||
x = xmax;
|
||||
|
||||
|
||||
|
||||
try{
|
||||
int[] idxbb = gcs.findXYindexFromLatLon(75,10, null);
|
||||
int[] idxo = gcs.findXYindexFromLatLon(0,0, null);
|
||||
LatLonPoint inverseOrigin = gcs.getLatLon(idxo[0],idxo[1]);
|
||||
|
@ -247,14 +249,20 @@ public class NetCDFDataExplorer {
|
|||
//correction to origin offset
|
||||
x = x - inverseOrigin.getLongitude();
|
||||
y = y - inverseOrigin.getLatitude();
|
||||
|
||||
if (i==0)
|
||||
AnalysisLogger.getLogger().debug("bb: " + idxbb[0] +","+idxbb[1]+" origin: "+idxo[0]+","+idxo[1]+" middle "+xD/2+","+yD/2+" shift "+(idxo[0]-(xD/2))+" inverse shift on origin "+inverseOrigin);
|
||||
}catch(Exception e){
|
||||
AnalysisLogger.getLogger().debug("Error getting x,y corrections "+e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
int[] idx = gcs.findXYindexFromLatLon(y,x, null);
|
||||
|
||||
xint = idx[0];
|
||||
yint = idx[1];
|
||||
|
||||
|
||||
|
||||
if (yint < 0) {
|
||||
yint = 0;
|
||||
}
|
||||
|
@ -295,7 +303,21 @@ public class NetCDFDataExplorer {
|
|||
val = Double.valueOf(data2Double.get(yint, xint));
|
||||
else if (data2Long != null)
|
||||
val = Double.valueOf(data2Long.get(yint, xint));
|
||||
|
||||
|
||||
AnalysisLogger.getLogger().debug("Choice "+ (data3Float!=null)+","+
|
||||
(data3Int!=null)+","+
|
||||
(data3Double!=null)+","+
|
||||
(data3Long!=null)+","+
|
||||
(data2Float!=null)+","+
|
||||
(data2Int!=null)+","+
|
||||
(data2Double!=null)+","+
|
||||
(data2Long!=null));
|
||||
|
||||
// AnalysisLogger.getLogger().debug("Assigning "+val+" to "+x+","+y+" ["+xint+","+yint+"]");
|
||||
// AnalysisLogger.getLogger().debug("checking "+data2Float.get(yint, xint)+" vs ");
|
||||
// try{AnalysisLogger.getLogger().debug("checking2 "+data2Float.get(xint,yint));}catch(Exception e){}
|
||||
|
||||
|
||||
values.add(val);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -208,6 +208,7 @@ public class MatrixExtractor {
|
|||
|
||||
if (log) {
|
||||
AnalysisLogger.getLogger().debug("MatrixExtractor->Building the points grid according to YRes:" + yResolution + " and XRes:" + xResolution);
|
||||
AnalysisLogger.getLogger().debug("MatrixExtractor->Assigning "+tuples.size()+" values to the grid");
|
||||
}
|
||||
|
||||
// long t0=System.currentTimeMillis();
|
||||
|
|
Loading…
Reference in New Issue