[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Support #ZZS-676605]: [udunits] Need to represent Celsius and Fahrenheit with C & F
- Subject: [Support #ZZS-676605]: [udunits] Need to represent Celsius and Fahrenheit with C & F
- Date: Sat, 10 Nov 2012 10:26:03 -0700
Jim,
> I want to use UDUnits2 with a Chemical Engineering simulator called Aspen
> Plus. Aspen Plus doesn't require coulombs or farads, but it represents
> Fahrenheit and Celsius with F and C. I thought adding these definitions
> would just be a matter of editing the udunits2-common.xml file like so:
>
> ...
> <symbol>℉</symbol> <!-- DEGREE FAHRENHEIT -->
> <name> <singular>fahrenheit</singular> </name>
> ...
>
> To
>
> ...
> <symbol>℉</symbol> <!-- DEGREE FAHRENHEIT -->
> <name> <singular>fahrenheit</singular> </name>
> <name> <singular>F</singular> </name>
> ...
>
> And maybe I would have to delete coulombs and farads out of the
> udunits2-derived.xml file. However, any attempt to do any of those things,
> the deletion of farads or coulombs, or the addition of new names "F" or "C"
> and udunits2 appears to fail to parse the XML file.
> I don't think I'm messing up the XML, because I can add additional, more
> unique, names to Fahrenheit, like "earwax" or "degrees_Jim." But "F" and "C"
> seem to be illegal. I haven't dug into the UDUnits code yet, does anyone
> know how to get this to work?
I STRONGLY advise against doing this. Your datasets will loose interoperability
and the workarounds are trivial (use instead "deg_C", "celsius", "\xB0C", or
any of the other identifiers, for example).
I hate to say it but, in my personal opinion, the authors of Aspen Plus are
exposing a lack of knowledge, professionalism, and/or rigor on their part by
not adhering to internationally agreed-upon standards.
If you insist on changing the standard definition of, for example, the symbol
"C", then you will have to modify all occurrences of that symbol in the
database:
cd $prefix/share/udunits
grep -w C udunits2-*.xml
udunits2-accepted.xml: <def>2.58e-4 C/kg</def>
udunits2-common.xml: <def>1.602176487e-19 C</def>
udunits2-common.xml: <def>9.64957e4 C</def>
udunits2-common.xml: <def>9.65219e4 C</def>
udunits2-common.xml: <def>9.648531e4 C</def>
udunits2-common.xml: <def>3.335640e-10 C</def>
udunits2-derived.xml: <symbol>C</symbol>
udunits2-derived.xml: <def>C/V</def>
udunits2-derived.xml: <symbol>°C</symbol> <!--
DEGREE SIGN -->
The last entry should be left alone; the 3rd-to-last entry should be deleted;
and all other entries should have the "C" replaced with "coulomb".
> Thanks,
> Jim
>
> _______________________________________________
> udunits mailing list
> address@hidden
> For list information, to unsubscribe, or change your membership options,
> visit: http://www.unidata.ucar.edu/mailing_lists/
Regards,
Steve Emmerson
Ticket Details
===================
Ticket ID: ZZS-676605
Department: Support
Priority: Normal
Status: Closed