Skip to content

Commit

Permalink
use longname option ordering
Browse files Browse the repository at this point in the history
assign center id for ESR
dump netcdf file to log when logging enabled
  • Loading branch information
cambecc committed Jan 24, 2014
1 parent 7b53726 commit 279270b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<dependency>
<groupId>com.lexicalscope.jewelcli</groupId>
<artifactId>jewelcli</artifactId>
<version>0.8.6</version>
<version>0.8.8</version>
</dependency>
<dependency>
<groupId>edu.ucar</groupId>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/nullschool/grib2json/Grib2Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.grib.grib2.*;
import ucar.nc2.NetcdfFile;
import ucar.unidata.io.RandomAccessFile;
Expand All @@ -26,6 +28,9 @@
*/
public final class Grib2Json {

private static final Logger log = LoggerFactory.getLogger(Grib2Json.class);


private final File file;
private final List<Options> optionGroups;

Expand Down Expand Up @@ -107,6 +112,7 @@ public void write() throws IOException {

// Otherwise, process it as NetCDF format.
NetcdfFile netcdfFile = NetcdfFile.open(file.getPath());
log.info("File contents:\n{}", netcdfFile);
for (Options options : optionGroups) {
write(netcdfFile, options);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/nullschool/grib2json/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @author Cameron Beccario
*/
@CommandLineInterface(application="grib2json")
@CommandLineInterface(application="grib2json", order=OptionOrder.LONGNAME)
public interface Options {

@Option(longName="help", shortName="h", description="display this help")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void writeIndicator() {
}

private void writeIdentification() {
write("center", 255, "Earth & Space Research");
write("center", -3, "Earth & Space Research");
write("refTime", date.withZone(DateTimeZone.UTC).toString());
write("significanceOfRT", 0, "Analysis");
}
Expand Down

0 comments on commit 279270b

Please sign in to comment.