This is the first release of cdo.rb, a Ruby module to call CDO.
Installation¶
cdo.rb is released as a ruby gem, Ruby's own package format. Install cdo.rb with
gem install cdo
Documentation¶
Please have a look at the automatic documentation from rubygem: http://rubydoc.info/gems/cdo/frames
Examples¶
CDO's operators are implemented as module methods:
Cdo.info(:in => "input.nc")
Input and output stream arguments are handled special with hash keys :in
and :out
. Same is true for the other options of CDO like "-f"
or "-P"
:
Cdo.topo(:out => "topography.grb")
Cdo.copy(:in => "topography.grb",:out => "topography.nc4",:options => "-f nc4")
Operator options can be set as standard method arguments:
Cdo.stdatm(0,10,20,50,100,200,500,1000,:out => "standard_atm.nc",:options => "-f nc")
More example can be found in the unit tests: source:trunk/cdo/contrib/ruby/test/test_cdo.rb.
New features:
- Variable input parameter for ECA operators: eca_cdd, eca_cwd, eca_rr1, eca_sdii
Fixed bugs:
- deflate compression with netCDF4 doesn't work (option: -z zip)
- sellonlatbox: correct lon bounds if necessary
- ifthen, ifthenelse: uses only the first time step of the first input file
- module Monarith (monadd, monsub, monmul, mondiv): wrong result for 3D variables
New features:
- Added support for level type ZAXIS_TOA, ZAXIS_SEA_BOTTOM, ZAXIS_ATMOSPHERE
Fixed bugs:
- deflate compression with netCDF4 doesn't work
New features:
- replace: added support to replace single levels
Changed operators:
- remapeta: Changed minimum pressure level for condensation from 1000Pa to 0Pa.
Use the environment variable REMAPETA_PTOP to set the minimum pressure level for condensation.
Above this level the humidity is set to the constant 1.E-6.
Fixed bugs:
- invertlat: bug fix for CURVILINEAR grids
- ymon<stat>: preserve time axis attributes (type and calendar)
- import_binary: added support for OPTION ZREV
- expr/exprf: wrong result for expression 'constant-field' and 'constant/field' (e.g. 1-field)
This bug was introduced in CDO version 1.5.1.
- eof, eoftime, eofspatial, eof3d - Empirical Orthogonal Functions:
There was a bug in the calculation of the Frobenius norm, which has only been triggered in some cases
when using a low precision. The normalization has been changed thus that the eigenvectors are not weighted
and their absolute is 1. The default settings for convergence have been changed to be more conservative:
CDO_SVD_MODE=jacobi
MAX_JACOBI_ITER=12
FNORM_PRECISION=1.e-12
New features:
- Added flexible XYZ dimension ordering for netCDF
- Added support for grid type GRID_FOURIER (fourier coefficients)
- Added interface function zaxisInqVct to read the VCT
New features:
- Added support for netCDF4 classic format; option -f nc4c
- import_binary: Added support for 1 and 2 byte integer
New operators:
- intlevel3d: vertical interpolation to/from 3d vertical coordinates
- ensrkhistspace: Ranked Histogram averaged over time
- ensrkhisttime: Ranked Histogram averaged over space
- ensroc: Ensemble Receiver Operating characteristics
- enscrps: Ensemble CRPS and decomposition
- ensbrs: Ensemble Brier score
Fixed bugs:
- Exprf: wrong result for missing values != (double) -9.e33
- detrend: added support for time bounds
- Filter: added support for time bounds
- eofspatial: integer overflow; wrong result for grid size > 46340
- eca_*: use the input calendar for the output streams
New features:
- Added support for FILETYPE_NC4C (netcdf4 classic)
Updates:
- netcdf-4.1.2
- hdf5-1.8.7
- grib_api-1.9.9
Other changes:
- Compile grib_api + jasper with PIC support when using
make libs4cdo
.
Download it here
Creating tables in the Redmine Wiki and other pages is quite easy, but the formatting used for this is not readily found on the Redmine help pages (neither here nor there). Thus we have added a table entry to our FAQ.
Besides, there used to be other code snippets for this and that. These and further example table are now collected on an example page.
New features:
- GRIB2 support via ECMWF GRIB_API
- Added support for netCDF level bounds
- Added option -O to overwrite existing output file (only for ens<STAT>, merge, mergetime)
New operators:
- selparam: Select parameters by identifier
- delparam: Delete parameters by identifier
- splitparam: Split parameter identifiers
- chparam: Change parameter identifier
Changed operators:
- expr: added functions abs(), int(), nint(), sqr()
- sinfo: changed output of table and code number to parameter identifier
- info: changed output of code number to parameter identifier
- diff: changed output of code number to parameter identifier
Fixed bugs:
- sellonlatbox: does not work as expected when selecting all longitutes
- sellonlatbox: initialization missing for unstructured grids
- ml2pl and ml2hl: wrong result if input file contains full and half level data
- trend and detrend: integer overflow; wrong result for ntimesteps > 46340
- spcut: only correct results with continuous wave numbers starting at 1
- remaplib: fixed data race in calculation of bin_addr (OpenMP)