Unidata / UDUNITS-2

API and utility for arithmetic manipulation of units of physical quantities
http://www.unidata.ucar.edu/software/udunits
Other
59 stars 36 forks source link

Units for velocity? #84

Open zdefne-usgs opened 5 years ago

zdefne-usgs commented 5 years ago

In the ISO metadata we provide a link to the measurement units for a variable following CF Metadata Conventions. For example:

<gmd:units xlink:href="https://raw.githubusercontent.com/Unidata/UDUNITS-2/master/lib/udunits2-common.xml#meter"/>

Units for velocity has not been defined in any of the _base, _common, _derived etc. units databases. How can we provide a similar link for velocity?

PS. There is some related discussion on how to handle units by on-the-fly merging of units databases (with no solution yet), but even then I don't think it will be the answer for this case. https://github.com/Unidata/threddsIso/issues/14

semmerson commented 5 years ago

Velocity is a vector quantity, so, if I'm understanding you correctly, the issue of a unit for velocity is actually an issue of the units for the individual components. For the usual case of distance/time the SI unit for a component would be m/s, which the UDUNITS2 package has.

zdefne-usgs commented 5 years ago

Thanks, but could you point me where? I have looked into all of the xml files but couldn't find it.

udunits2-prefixes.xml udunits2-base.xml udunits2-derived.xml udunits2-accepted.xml udunits2-common.xml
semmerson commented 5 years ago

That's because the SI speed unit is the derived unit "m/s". As far as I know, there is no simple name or symbol for this unit -- so "m/s" must be used.

zdefne-usgs commented 5 years ago

That's because the SI speed unit is the derived unit "m/s".

But it is not included in the udunits2-derived.xml.

So is it a special case if it is a derived unit, but with no special name? Sorry,still getting familiar with these applications. My question circles back to the issue Unidata/threddsIso#14, how do we then give link to the definition of such units in the ISO metadata file?

cesss commented 5 years ago

I'm just a newcomer to UDUNITS2 so take my reply with a grain of salt. I think m/s is not included in the derived database because it doesn't have an alias nor a special name for it. It's a ratio between meters and seconds, which are units, but m/s is not a unit in itself. You can manage m/s in UDUNITS2, and you can convert between km/h and m/s, for example, but it's not considered as a unit, from what I see.

adigitoleo commented 2 years ago

I have stumbled on this same issue while looking to adopt CF standards for a NetCDF writer. A more discoverable reference for the possible units and their configurations would I think help motivate wider adoption. Nevertheless, thanks for all the effort put in so far.