Java NEXRAD Software Batch Processing
The Java NEXRAD Software may be used for batch processing by following
the instructions below. All options are controlled via a configuration XML file.
Java NEXRAD Exporter Instructions
XML Configuration File
Batch Processing Tips
Java NEXRAD Exporter Instructions:
Top of page
- Download the Java NEXRAD Exporter JAR file:
Current Stable release: jNexradExporter-1.7.5.jar
Current BETA release: jNexradExporter-1.9.7.jar (BETA)
*Note* If your browser downloads this file with a .zip extension, rename the extension to .jar after the download is complete.
- Write or modify the XML configuration file. This file is described in detail
below.
- From the command-line or script, start the Exporter with the following arguments:
java -mx100m -jar jNexradExporter-1.7.5.jar <in> <out> <format> <config>
where:
- <in> = Input URL, filename or directory. If directory, then all NEXRAD files in directory
are processed. A URL must be for a specific file, not a directory.
- <out> = Output file or directory for processed files. If a directory, then the output files
use the input filename. The directory must already exist or it will be treated as a file.
- <format> = Output format (use one of the following abbreviations).
shp=Shapefile, wkt=Well-Known Text, asc=Arc/Info ASCII Grid,
flt=Arc/Info Binary Grid, grd=GrADS Binary Grid, nc=NetCDF, tif=GeoTIFF,
csv=Comma-Separated Text File (Alphanumeric-Only), rnc=Raw NetCDF
- <config> = XML configuration file for export options. This may be a file or URL.
The '-mx100m' specifies a maximum memory usage of 100 Megabytes. This is usually only needed for
processing Level-II Velocity or Spectrum Width moments.
- The Exporter may also be run with a list of input files and destination directories:
java -mx100m -jar jNexradExporter-1.7.5.jar <listfile> <format>
where:
- <listfile> = Listfile with format of infile/dir/url,outfile/dir,config-xml-file/url.
Example Listfile
- <format> = Output format (use one of the following abbreviations).
shp=Shapefile, wkt=Well-Known Text, asc=Arc/Info ASCII Grid,
flt=Arc/Info Binary Grid, grd=GrADS Binary Grid, nc=NetCDF, tif=GeoTIFF,
csv=Comma-Separated Text File (Alphanumeric-Only), rnc=Raw NetCDF
- Example command line arguments:
1) Download latest N1R product from the National
Weather Service (NWS) and save as a Shapefile using the specified config file.
Beware: The NWS server is very slow and sometimes the connection will time-out.
<in> = http://weather.noaa.gov/pub/SL.us008001/DF.of/DC.radar/DS.p19r1/SI.kgsp/sn.last
<out> = D:\Nexrad_Viewer_Test\Batch\output
<format> = shp
<config> = D:\Nexrad_Viewer_Test\Batch\jneBatchConfig.xml
2) Process all files in C:\ViewerData\HAS999900001\ to NetCDF using
the specified config file.
<in> = C:\ViewerData\HAS999900001\
<out> = D:\Nexrad_Viewer_Test\Batch\output
<format> = nc
<config> = D:\Nexrad_Viewer_Test\Batch\jneBatchConfig.xml
3) Process all files in listfile to GeoTIFF using
the specified config files.
<listfile> = D:\Nexrad_Viewer_Test\Batch\listfile.txt
<format> = tif
Top of page
Java NEXRAD Exporter XML Configuration File
Download example configuration file:
jneBatchConfig.xml
Top of page
Batch Processing Tips
1. Output Redirection
'>' will redirect all output (standard out and standard error)
'1>' will redirect standard out
'2>' will redirect standard error
To redirect to nowhere (disable) the output, use 'NUL' on Windows and '/dev/null' on Linux and Mac.
Examples:
-
Ignore all output:
Windows: [ command arguments ] >NUL
Linux: [ command arguments ] >/dev/null
-
Ignore standard output and send error messages to screen:
Windows: [ command arguments ] 1>NUL
Linux: [ command arguments ] 1>/dev/null
-
Ignore standard output and send error messages to file:
Windows: [ command arguments ] 1>NUL 2>errors.log
Linux: [ command arguments ] 1>/dev/null 2>errors.log
2. Running in a 'Headless' Environment (no graphics device available)
If you get this error,
X connection to localhost:11.0 broken (explicit kill or server shutdown).
then there is no graphics connection available. This is common when running on remote servers without using X-Windows
or processing from a cronjob. To run java in a 'headless' environment, add this option:
java
-Djava.awt.headless=true -jar
jNexradExporter-1.7.5.jar <in> <out> <format> <config>
3. Setting a different temp directory
If you get a similar error to this:
java.io.FileNotFoundException: /tmp/tif894231.nc (Permission denied)
then you do not have permission to write to the system temp directory.
To set a custom temp directory, add this option:
java
-Djava.io.tmpdir=tmp -jar
jNexradExporter-1.7.5.jar <in> <out> <format> <config>
Note: the Java options listed above may also be combined:
java
-Djava.io.tmpdir=tmp -Djava.awt.headless=true -jar
jNexradExporter-1.7.5.jar ....
Top of page
Please contact Steve Ansari ( Steve.Ansari@noaa.gov )
if you have specific questions or comments about this software.