Hi Mark,
> Hello! I know that many people have been working on filters and
> manipulators for 'generic' netCDF files. I'd be interested if anybody had
> a filter that would permit me to translate the units of specified netCDF
> variables; for example, from Pascals to millibars. Does anyone have or
> know of such a beast that's freely available? Thanks!
Sounds like you need to use the udunits library (part of UDAPE package from
unidata.ucar.edu). From the man page:
UDUNITS(3) (25 January 1991) UDUNITS(3)
DESCRIPTION
These routines convert between formatted and binary forms of
unit specifications and perform unit algebra on the binary
form.
.
.
.
utConvert returns the coefficients of the Galilean
transformation (i.e. y = a*x + b) necessary to convert the
from unit into the to unit. The units must be compatible
(i.e., their quotient must be dimensionless). On successful
return, slope and intercept will contain the values for the
slope and intercept coefficients, respectively. This
function returns 0 on success, UT_ENOINIT if the package
hasn't been initialized, UT_EINVALID if one of the unit-
structures is invalid, and UT_ECONVERT if the units are not
convertable.
| Len Makin, CSIRO, Division of Information Technology (Melbourne) |
| Supercomputing Support Group |
|723 Swanston St, Carlton| (TEL) +61 3 282 2622 (FAX) +61 3 282 2600 |
|VIC 3053, Australia | Internet:len@xxxxxxxxxxxxxxxx |