tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Math/udunits update



I have need for an updated version of the math/udunits package.  This raises an issue as there is now udunits2 with the following differences:

2 How This Package Differs from the Original UDUNITS Package

The UDUNIT-2 package differs from the UDUNITS-1 package in the following ways:

	• Support for non-ASCII characters: The UDUNITS-1 package only supports the ASCII character set. The UDUNITS-2 package supports the following character sets: ASCII, ISO 8859-1 (Latin-1), and the UTF-8 encoding of ISO 10646 (Unicode). This means that unit string specifications like "µ°F·Ω⁻¹" are now supported (your viewer must support UTF-8 to display this string correctly).
	• Support for logarithmic units: The unit string specification "0.1 lg(re 1 mW)" specifies a deciBel unit with a one milliwatt reference level. Such units are fully integrated into the package and all meaningful operations and conversions are supported.
	• Persistent value converters: It is now possible to obtain a converter data-object, which can be used to convert numeric values in one unit to numeric values in another, compatible unit. The values can be float, double, or one-dimensional arrays of floats or doubles.
	• Improved API: Due to the above changes, it was not possible to keep the application programming interface (API) of the UDUNITS-1 package. The new interface, however, is easily understood and easy to use. To support backward comptibility, the package does contain a version 1 C API, which uses the version 2 library.
	• XML unit database: The unit database is encoded using human-readable XML rather than a custom format. The XML parser included in the package supports an <import> element to allow easy and convenient customization.
	• No Fortran or Perl API: Interfaces for these languages have not yet been created. Contact support-udunits%unidata.ucar.edu@localhost if you are interested in helping to create these interfaces.
One thing that has not changed is that almost all unit string specifications understood by the UDUNITS-1 package are also understood by the UDUNITS-2 package. One exception is the symbol g, which in version 1 of the package was associated with standard free fall (a unit of accelleration) but which is associated with the unit gram in version 2 of the package.

A few options:

- Make a new udunits2 package and leave udunits as is at v1.

- Update udunits to v2 and either abandon udunits v1 or replace it with udunits1. 

Given the last statement about grams v. gravity I’m not sure which way to go.  Suggestions welcome.

Cheers,
Brook



Home | Main Index | Thread Index | Old Index