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

Support for permil, parts per thousand or parts per kilo unit? #111

Closed japhir closed 1 year ago

japhir commented 1 year ago

In my field a few different unitless values are used to describe e.g., oxygen and carbon isotope ratios measured on carbonates. We measure them in δ notation, see for example this wikipedia entry.

The values we report are in parts per thousand, or ‰, typically with uncertainties in the ppm. I saw (in the output of valid_udunits()) that %, ppm, and ppb are part of UDUNITS-2, but didn't see ‰ included. Is there any reason to omit this from inclusion? perhaps ppk could be a good abbreviation, with k for kilo so as not to be ambiguous with ppt = parts per trillion.

Then there's the more complicated (non-SI?) standardisation scheme with Vienna Pee Dee Belemnite (VPDB) and Vienna Standard Mean Ocean Water (VSMOW), and their internal relationships etc. but this may be outside of the scope of UDUNITS-2.

This might be related to the discussions on including unitless salinity https://github.com/Unidata/UDUNITS-2/issues/27

semmerson commented 1 year ago

The following unit will be after the unit "percent" in the file "udunits2-common.xml" in the next release:

        <unit>
            <comment>Constant</comment>
            <def>0.001</def>
            <aliases>
                <name><singular>permille</singular><noplural/></name>
                <name><singular>per_thousand</singular><noplural/></name>
                <symbol>&#xB0;</symbol>             
                <symbol>ppt</symbol>
            </aliases>
            <definition>number of parts per thousand</definition>
        </unit>

Feel free to add it to your, installed "udunits2-common.xml". Be advised, however, that it will not be universally available.

japhir commented 1 year ago

Thanks you for its inclusion! :)