diff options
-rw-r--r-- | LICENSE.md | 21 | ||||
-rw-r--r-- | README.md | 72 | ||||
-rwxr-xr-x | bin/grib2json | 5 | ||||
-rwxr-xr-x | bin/grib2json.cmd | 4 | ||||
-rw-r--r-- | lib/c3p0-0.9.1.1.jar | bin | 0 -> 608376 bytes | |||
-rw-r--r-- | lib/commons-codec-1.2.jar | bin | 0 -> 30085 bytes | |||
-rw-r--r-- | lib/commons-httpclient-3.1.jar | bin | 0 -> 305001 bytes | |||
-rw-r--r-- | lib/ehcache-core-2.6.2.jar | bin | 0 -> 1338129 bytes | |||
-rw-r--r-- | lib/grib-4.3.19.jar | bin | 0 -> 2259157 bytes | |||
-rw-r--r-- | lib/grib2json-0.8.0-SNAPSHOT.jar | bin | 0 -> 20246 bytes | |||
-rw-r--r-- | lib/javax.json-1.0.3.jar | bin | 0 -> 80416 bytes | |||
-rw-r--r-- | lib/jcip-annotations-1.0.jar | bin | 0 -> 2254 bytes | |||
-rw-r--r-- | lib/jcl-over-slf4j-1.7.5.jar | bin | 0 -> 16517 bytes | |||
-rw-r--r-- | lib/jdom2-2.0.4.jar | bin | 0 -> 298360 bytes | |||
-rw-r--r-- | lib/je-4.0.92.jar | bin | 0 -> 2132019 bytes | |||
-rw-r--r-- | lib/jewelcli-0.8.8.jar | bin | 0 -> 554401 bytes | |||
-rw-r--r-- | lib/jna-3.0.9.jar | bin | 0 -> 795871 bytes | |||
-rw-r--r-- | lib/joda-time-2.3.jar | bin | 0 -> 581571 bytes | |||
-rw-r--r-- | lib/jsoup-1.7.2.jar | bin | 0 -> 293671 bytes | |||
-rw-r--r-- | lib/logback-classic-1.0.9.jar | bin | 0 -> 252684 bytes | |||
-rw-r--r-- | lib/logback-core-1.0.9.jar | bin | 0 -> 366462 bytes | |||
-rw-r--r-- | lib/netcdf-4.3.19.jar | bin | 0 -> 4590073 bytes | |||
-rw-r--r-- | lib/protobuf-java-2.5.0.jar | bin | 0 -> 533455 bytes | |||
-rw-r--r-- | lib/quartz-2.1.1.jar | bin | 0 -> 554349 bytes | |||
-rw-r--r-- | lib/slf4j-api-1.7.5.jar | bin | 0 -> 26084 bytes | |||
-rw-r--r-- | lib/udunits-4.3.19.jar | bin | 0 -> 126895 bytes |
26 files changed, 102 insertions, 0 deletions
diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..52f404e --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Cameron Beccario + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..afed7db --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +grib2json +========= + +A command line utility that decodes [GRIB2](http://en.wikipedia.org/wiki/GRIB) files as JSON. + +This utility uses the netCDF-Java GRIB decoder, part of the [THREDDS](https://github.com/Unidata/thredds) project +by University Corporation for Atmospheric Research/Unidata. + +Installation +------------ + +``` +git clone <this project> +mvn package +``` + +This creates a .tar.gz in the target directory. Unzip and untar the package in a location of choice. + +Usage +----- + +The `grib2json` launch script is located in the `bin` directory and requires the `JAVA_HOME` environment +variable to be defined. + +``` +> grib2json --help +Usage: grib2json [options] FILE + [--compact -c] : enable compact Json formatting + [--data -d] : print GRIB record data + [--filter.category --fc value] : select records with this numeric category + [--filter.parameter --fp value] : select records with this numeric parameter + [--filter.surface --fs value] : select records with this numeric surface type + [--filter.value --fv value] : select records with this numeric surface value + [--help -h] : display this help + [--names -n] : print names of numeric codes + [--output -o value] : write output to the specified file (default is stdout) + [--verbose -v] : enable logging to stdout +``` + +For example, the following command outputs to stdout the records for parameter 2 (U-component_of_wind), with +surface type 103 (Specified height level above ground), and surface value 10.0 meters from the GRIB2 file +_gfs.t18z.pgrbf00.2p5deg.grib2_. Notice the optional inclusion of human-readable _xyzName_ keys and the data array: + +``` +> grib2json --names --data --fp 2 --fs 103 --fv 10.0 gfs.t18z.pgrbf00.2p5deg.grib2 + +[ + { + "header":{ + "discipline":0, + "disciplineName":"Meteorological products", + "gribEdition":2, + "gribLength":27759, + "center":7, + "centerName":"US National Weather Service - NCEP(WMC)", + "parameterNumber":2, + "parameterNumberName":"U-component_of_wind", + "parameterUnit":"m.s-1", + "surface1Type":103, + "surface1TypeName":"Specified height level above ground", + "surface1Value":10.0, + ... + }, + "data":[ + -2.12, + -2.27, + -2.41, + ... + ] + } +] +``` diff --git a/bin/grib2json b/bin/grib2json new file mode 100755 index 0000000..c458057 --- /dev/null +++ b/bin/grib2json @@ -0,0 +1,5 @@ +#!/bin/sh +#set -x +LIB_DIR=$(dirname "$0")/../lib +LAUNCH_JAR=$LIB_DIR/grib2json-*.jar +$JAVA_HOME/bin/java -Xmx512M -jar $LAUNCH_JAR $@ diff --git a/bin/grib2json.cmd b/bin/grib2json.cmd new file mode 100755 index 0000000..788abb5 --- /dev/null +++ b/bin/grib2json.cmd @@ -0,0 +1,4 @@ +@echo off +set LIB_DIR="%~dp0..\lib" +for /f "delims=X" %%i in ('dir /b %LIB_DIR%\grib2json-*.jar') do set LAUNCH_JAR=%LIB_DIR%\%%i +"%JAVA_HOME%\bin\java.exe" -Xmx512M -jar %LAUNCH_JAR% %* diff --git a/lib/c3p0-0.9.1.1.jar b/lib/c3p0-0.9.1.1.jar Binary files differnew file mode 100644 index 0000000..8d283e4 --- /dev/null +++ b/lib/c3p0-0.9.1.1.jar diff --git a/lib/commons-codec-1.2.jar b/lib/commons-codec-1.2.jar Binary files differnew file mode 100644 index 0000000..67cb720 --- /dev/null +++ b/lib/commons-codec-1.2.jar diff --git a/lib/commons-httpclient-3.1.jar b/lib/commons-httpclient-3.1.jar Binary files differnew file mode 100644 index 0000000..7c59774 --- /dev/null +++ b/lib/commons-httpclient-3.1.jar diff --git a/lib/ehcache-core-2.6.2.jar b/lib/ehcache-core-2.6.2.jar Binary files differnew file mode 100644 index 0000000..9801aa7 --- /dev/null +++ b/lib/ehcache-core-2.6.2.jar diff --git a/lib/grib-4.3.19.jar b/lib/grib-4.3.19.jar Binary files differnew file mode 100644 index 0000000..6197b12 --- /dev/null +++ b/lib/grib-4.3.19.jar diff --git a/lib/grib2json-0.8.0-SNAPSHOT.jar b/lib/grib2json-0.8.0-SNAPSHOT.jar Binary files differnew file mode 100644 index 0000000..af34dd8 --- /dev/null +++ b/lib/grib2json-0.8.0-SNAPSHOT.jar diff --git a/lib/javax.json-1.0.3.jar b/lib/javax.json-1.0.3.jar Binary files differnew file mode 100644 index 0000000..0894587 --- /dev/null +++ b/lib/javax.json-1.0.3.jar diff --git a/lib/jcip-annotations-1.0.jar b/lib/jcip-annotations-1.0.jar Binary files differnew file mode 100644 index 0000000..06e9066 --- /dev/null +++ b/lib/jcip-annotations-1.0.jar diff --git a/lib/jcl-over-slf4j-1.7.5.jar b/lib/jcl-over-slf4j-1.7.5.jar Binary files differnew file mode 100644 index 0000000..90153b0 --- /dev/null +++ b/lib/jcl-over-slf4j-1.7.5.jar diff --git a/lib/jdom2-2.0.4.jar b/lib/jdom2-2.0.4.jar Binary files differnew file mode 100644 index 0000000..19cafb8 --- /dev/null +++ b/lib/jdom2-2.0.4.jar diff --git a/lib/je-4.0.92.jar b/lib/je-4.0.92.jar Binary files differnew file mode 100644 index 0000000..fa9225d --- /dev/null +++ b/lib/je-4.0.92.jar diff --git a/lib/jewelcli-0.8.8.jar b/lib/jewelcli-0.8.8.jar Binary files differnew file mode 100644 index 0000000..2c70e6c --- /dev/null +++ b/lib/jewelcli-0.8.8.jar diff --git a/lib/jna-3.0.9.jar b/lib/jna-3.0.9.jar Binary files differnew file mode 100644 index 0000000..33461ec --- /dev/null +++ b/lib/jna-3.0.9.jar diff --git a/lib/joda-time-2.3.jar b/lib/joda-time-2.3.jar Binary files differnew file mode 100644 index 0000000..9dce4f9 --- /dev/null +++ b/lib/joda-time-2.3.jar diff --git a/lib/jsoup-1.7.2.jar b/lib/jsoup-1.7.2.jar Binary files differnew file mode 100644 index 0000000..1d9879f --- /dev/null +++ b/lib/jsoup-1.7.2.jar diff --git a/lib/logback-classic-1.0.9.jar b/lib/logback-classic-1.0.9.jar Binary files differnew file mode 100644 index 0000000..cebd1a3 --- /dev/null +++ b/lib/logback-classic-1.0.9.jar diff --git a/lib/logback-core-1.0.9.jar b/lib/logback-core-1.0.9.jar Binary files differnew file mode 100644 index 0000000..f526524 --- /dev/null +++ b/lib/logback-core-1.0.9.jar diff --git a/lib/netcdf-4.3.19.jar b/lib/netcdf-4.3.19.jar Binary files differnew file mode 100644 index 0000000..b4c5ec5 --- /dev/null +++ b/lib/netcdf-4.3.19.jar diff --git a/lib/protobuf-java-2.5.0.jar b/lib/protobuf-java-2.5.0.jar Binary files differnew file mode 100644 index 0000000..4c4e686 --- /dev/null +++ b/lib/protobuf-java-2.5.0.jar diff --git a/lib/quartz-2.1.1.jar b/lib/quartz-2.1.1.jar Binary files differnew file mode 100644 index 0000000..27a45f6 --- /dev/null +++ b/lib/quartz-2.1.1.jar diff --git a/lib/slf4j-api-1.7.5.jar b/lib/slf4j-api-1.7.5.jar Binary files differnew file mode 100644 index 0000000..8f004d3 --- /dev/null +++ b/lib/slf4j-api-1.7.5.jar diff --git a/lib/udunits-4.3.19.jar b/lib/udunits-4.3.19.jar Binary files differnew file mode 100644 index 0000000..5ca6289 --- /dev/null +++ b/lib/udunits-4.3.19.jar |