GRIB import, first steps

Change-Id: If2681103ecb5ddf6d5644f88d5f438aae2e2bd1e
This commit is contained in:
Axel Uhl
2017-01-19 16:05:39 +01:00
parent 845e24f8f0
commit 480689fd6f
14 changed files with 263 additions and 0 deletions
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sap.sailing.grib.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: com.sap.sailing.grib.test
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Fragment-Host: com.sap.sailing.grib
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit4;bundle-version="4.8.2"
@@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
@@ -0,0 +1,2 @@
/Drake.wind.grb.gbx9
/Drake.wind.grb.ncx2
@@ -0,0 +1,53 @@
package com.sap.sailing.grib.test;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import ucar.ma2.Array;
import ucar.nc2.VariableSimpleIF;
import ucar.nc2.dt.GridDatatype;
import ucar.nc2.dt.grid.GeoGrid;
import ucar.nc2.dt.grid.GridDataset;
import ucar.nc2.time.CalendarDate;
import ucar.nc2.time.CalendarDateRange;
import ucar.unidata.geoloc.LatLonRect;
public class SimpleGridFileReadingTest {
private GridDataset dataSet;
@Before
public void setUp() throws IOException {
dataSet = GridDataset.open("resources/Drake.wind.grb");
}
@Test
public void testBoundingBox() {
final LatLonRect boundingBox = dataSet.getBoundingBox();
System.out.println(boundingBox);
}
@Test
public void testWindContent() throws IOException {
final List<GridDatatype> grids = dataSet.getGrids();
for (GridDatatype grid : grids) {
assertTrue(grid instanceof GeoGrid);
}
GeoGrid grid0 = (GeoGrid) grids.get(0);
final Array volumeDataAtTime0 = grid0.readVolumeData(0);
final List<VariableSimpleIF> dataVariables = dataSet.getDataVariables();
System.out.println(dataVariables);
}
@Test
public void testDateRange() {
final CalendarDateRange dateRange = dataSet.getCalendarDateRange();
final CalendarDate start = dateRange.getStart();
final CalendarDate end = dateRange.getEnd();
assertTrue(end.isAfter(start));
}
}
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/netcdfAll-4.5.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sap.sailing.grib</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,105 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Grib
Bundle-SymbolicName: com.sap.sailing.grib
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: lib/netcdfAll-4.5.jar,
.
Export-Package: ucar.atd.dorade,
ucar.coord,
ucar.httpservices,
ucar.ma2,
ucar.multiarray,
ucar.nc2,
ucar.nc2.constants,
ucar.nc2.dataset,
ucar.nc2.dataset.conv,
ucar.nc2.dataset.transform,
ucar.nc2.dods,
ucar.nc2.dt,
ucar.nc2.dt.grid,
ucar.nc2.dt.grid.gis,
ucar.nc2.dt.image.image,
ucar.nc2.dt.point,
ucar.nc2.dt.point.decode,
ucar.nc2.dt.radial,
ucar.nc2.dt.trajectory,
ucar.nc2.ft,
ucar.nc2.ft.coordsys,
ucar.nc2.ft.fmrc,
ucar.nc2.ft.grid,
ucar.nc2.ft.grid.impl,
ucar.nc2.ft.point,
ucar.nc2.ft.point.bufr,
ucar.nc2.ft.point.collection,
ucar.nc2.ft.point.remote,
ucar.nc2.ft.point.standard,
ucar.nc2.ft.point.standard.plug,
ucar.nc2.ft.point.writer,
ucar.nc2.ft.radial,
ucar.nc2.ft.scan,
ucar.nc2.ft.swath,
ucar.nc2.ft2,
ucar.nc2.geotiff,
ucar.nc2.grib,
ucar.nc2.grib.collection,
ucar.nc2.grib.grib1,
ucar.nc2.grib.grib1.tables,
ucar.nc2.grib.grib2,
ucar.nc2.grib.grib2.table,
ucar.nc2.grib.writer,
ucar.nc2.iosp,
ucar.nc2.iosp.adde,
ucar.nc2.iosp.bufr,
ucar.nc2.iosp.bufr.tables,
ucar.nc2.iosp.bufr.writer,
ucar.nc2.iosp.cinrad,
ucar.nc2.iosp.dmsp,
ucar.nc2.iosp.dorade,
ucar.nc2.iosp.fysat,
ucar.nc2.iosp.fysat.util,
ucar.nc2.iosp.gempak,
ucar.nc2.iosp.gini,
ucar.nc2.iosp.grads,
ucar.nc2.iosp.grid,
ucar.nc2.iosp.hdf4,
ucar.nc2.iosp.hdf5,
ucar.nc2.iosp.mcidas,
ucar.nc2.iosp.misc,
ucar.nc2.iosp.netcdf3,
ucar.nc2.iosp.netcdf4,
ucar.nc2.iosp.nexrad2,
ucar.nc2.iosp.nids,
ucar.nc2.iosp.noaa,
ucar.nc2.iosp.nowrad,
ucar.nc2.iosp.shapefile,
ucar.nc2.iosp.sigmet,
ucar.nc2.iosp.uamiv,
ucar.nc2.iosp.uf,
ucar.nc2.iosp.vis5d,
ucar.nc2.jni.netcdf,
ucar.nc2.ncml,
ucar.nc2.ogc,
ucar.nc2.ogc.erddap.util,
ucar.nc2.ogc.gml,
ucar.nc2.ogc.om,
ucar.nc2.ogc.spatialsampling,
ucar.nc2.ogc.swe,
ucar.nc2.ogc.waterml,
ucar.nc2.rewrite,
ucar.nc2.stream,
ucar.nc2.thredds,
ucar.nc2.time,
ucar.nc2.units,
ucar.nc2.util,
ucar.nc2.util.cache,
ucar.nc2.util.log,
ucar.nc2.util.net,
ucar.nc2.util.rc,
ucar.nc2.util.reflect,
ucar.nc2.util.xml,
ucar.nc2.wmo,
ucar.nc2.write,
ucar.netcdf
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/netcdfAll-4.5.jar
Binary file not shown.