Weather and Climate Toolkit Exporter Instructions
The Weather and Climate Toolkit (WCT) may be used for batch processing or command line loading by following the instructions below. All options are controlled with an XML configuration file.
Download the Weather and Climate Toolkit from the Software Tab on the Weather and Climate Toolkit Page
Windows
Unzip the WCT Distribution
wct-4.8.1-win32.zip
|
|-- wct -- dist (Main distribution libraries)
|---- lib (Supporting libraries)
|---- wct-export.bat (Batch Data Export script)
|---- wct-viewer.bat (Viewer User Interface script)
|---- wct.exe (Viewer User Interface executable)
|---- wctBatchConfig.xml (Example config file)
MAC | Unix | Linux
Unzip the WCT Distribution
wct-4.8.1.zip
|
|-- wct -- dist (Main distribution libraries)
|---- lib (Supporting libraries)
|---- wct-export (Batch Data Export script)
|---- wct-viewer (Viewer User Interface script)
|---- wctBatchConfig.xml (Example config file)
Write or modify the XML configuration file: This file is described in detail XML | KMZ accordion below.
Run 'wct-export' from command line (DOS, Terminal or Unix Shell):
From the command-line or script, run 'wct-export' with the following arguments:
wct-export <in> <out> <format> <config>
where:
<in> = Input URL, filename or directory. If directory, then all supported files in the 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, nc=NetCDF, tif=8-bit grayscale GeoTIFF, tif32=32-bit real value GeoTIFF, csv=Comma-Separated Text File (Alphanumeric-Only), rnc=Raw NetCDF, json=GeoJSON
<config> = XML configuration file for export options. This may be a file or URL.
List file options
The Exporter may also be run with a list of input files and destination directories:
wct-export <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, nc=NetCDF, tif=GeoTIFF, csv=Comma-Separated Text File (Alphanumeric-Only), rnc=Raw NetCDF, json=GeoJSON
Example command line arguments
a) Download the latest N1R product from the National Weather Service (NWS) and save as a Shapefile using the specified config file.
<in> = http://weather.noaa.gov/pub/SL.us008001/DF.of/DC.radar/DS.p19r1/SI.kgsp…
<out> = D:\Nexrad_Viewer_Test\Batch\output
<format> = shp
<config> = D:\Nexrad_Viewer_Test\Batch\wctBatchConfig.xml
b) 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\wctBatchConfig.xml
c) Process all files in listfile to GeoTIFF using the specified config files.
<listfile> = D:\Nexrad_Viewer_Test\Batch\listfile.txt
<format> = tif
XML Configuration File
Download example configuration file: wctBatchConfig.xml
There is documentation in this file explaining the various options and configurations.
KMZ Export Examples
As of version 3.7.0, the creation of KMZ files from the 'wct-export' script is supported.
The KMZ files created from 'wct-export' are a zipped bundle of files containing a rendered .png image file (not a data file), a KML file (XML format) describing the geolocation of the image, and finally associated legend and logo images. Because of this additional information, a KMZ export requires some additional configuration compared to a simple data export. The <kmlExportOptions> section in config file wctBatchConfig.xml has documentation for the additional configuration parameters. There is also additional documentation regarding the palette files for defining color maps, as well as sample scripts, below.
Palette/Color Map Configuration
The Toolkit uses a simple text file to define the color maps. The text file palette can be configured to represent continuous data, discrete categories of data, classified ranges of data and filtered value ranges (by setting unwanted values to fully transparent). Hint: Remember to uncomment the default palette location of 'NONE' in the default wctBatchConfig.xml file.
Use Case Scenarios
Command Line Tips
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
1. Ignore all output:
-
Windows: [command arguments]>NUL
-
Linux: {Command arguments]>dev/nul
2. Ignore standard output and send error messages to screen:
-
Windows: [ command arguments ] 1>NUL
-
Linux: [ command arguments ] 1>/dev/null
3. 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
Data Cache Directory
By default, the WCT will cache data files to the location defined by the java.io.tmpdir default java property. On Windows this is usually the same as the %TMP% environment variable. On Mac and Linux, this is usually '/tmp'
Here are two examples of how to change this default location:
-
Modify the wct-export script to set the java.io.tmpdir value. In the script, you would add the following command before the '-classpath' part of the java command that initiates the WCT. java -mx3500m -Djava.awt.headless=true-Djava.io.tmpdir=/new/path/-classpath "%WCT...
-
Use the _JAVA_OPTIONS environment variable to modify the default value of java.io.tmpdir. On Windows, do this in the environment variables manager. On Mac/Linux, this may be set in the .bash_profile by adding: export _JAVA_OPTIONS=-Djava.io.tmpdir=/new/tmp/dir
Map Creation
Choose a command-line GIS package to generate maps
- Example Open-Source packages include FWTools/Mapserver/GDAL, NCL and R