Version 4.6.2 of the netCDF Operators (NCO) has been released. NCO is an Open Source package that consists of a dozen standalone, command-line programs that take netCDF files as input, then operate (e.g., derive new data, average, print, hyperslab, manipulate metadata) and output the results to screen or files in text, binary, or netCDF formats.
The NCO project is coordinated by Professor Charlie Zender of the Department of Earth System Science, University of California, Irvine. More information about the project, along with binary and source downloads, are available on the SourceForge project page.
From the release message:
4.6.2 is mainly a stability release to polish existing features and to add minor new ones. The exception is the new JSON backend. NCO now prints CDL, "Traditional NCO", XML, and JSON. Babel-icious eh?
We built the JSON backend to help a project (DOE Terraref). Our first choice was to adopt an off-the-shelf netCDF->JSON tool. However, no existing solution worked for us. JSON is a loose syntax, and we made necessary design choices that suited our application, and left some choices for later. Are there syntactical variants you want us to add?
Some users of netCDF version 4.4.1 cannot build NCO from scratch
because a bug in the nc-config
command kills NCO's 'configure;make'
.
Unidata will ship a corrected nc-config
in netCDF 4.4.2.
The 4.4.2-development branch already contains the necessary fix.
New Features
-
JSON backend
Similar the CDL and XML backends,ncks
now supports JSON. To obtain JSON, use--jsn
or--json
instead of--cdl/--xml
.ncks --json -v one ~/nco/data/in.nc { "variables": { "one": { "type": "float", "attributes": { "long_name": "one" }, "data": 1.0 } } }
More sample output at: http://dust.ess.uci.edu/tmp/in.json and other *.json files. Other related options (-v, -g, -m, -M
) have their usual meanings. The--jsn_att_fmt
switch accesses formats of selectable verbosity. Thanks to Henry Butowsky for implementing the JSON backend, and to Pedro Vicente and Chris Barker for helpful discussions.
http://nco.sf.net/nco.html#json -
Multi-arguments refer to the format of command-line key-value pairs
that NCO uses to support four different features that can have too
many parameters to set via traditional command line arguments.
The four features are regridding (
rgr
), global-attribute-adding (gaa
), precision-preserving compression (ppc
), and ENVI image processing for the DOE Terraref project (trr
). Formerly, users were required to supply one value per command line option for these features, e.g.,
"--rgr lat_nbr=64 --rgr lon_nbr=128 --rgr lat_grd=cap ..."
The new multi-argument feature allows users to aggregate multiple key-value pairs per command line argument, e.g.,
"--rgr lat_nbr=64#lon_nbr=128#lat_grd=cap# ...
"
Now all key-value pairs related to a single feature (like regridding, compression) can be provided as one arument!
The string that delimits each pair is user-configurable and defaults to a single hash "#". Change it with, e.g.,--dlm=":"
. Ensure your delimiters are not special shell characters, and are escaped (with backslashes) if present in key or value strings. Thanks to Jerome Mao for implementing multi-arguments.
http://nco.sf.net/nco.html#mta -
ncap2
now searches all paths in theNCO_PATH
environment variable for any #include'd files that it cannot find in${CWD}
. - All builds tested on LLVM 8.0.0 and GCC 6.2.1 toolchains.
Additional details are available in the ChangeLog.