This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Aaron, > I cannot for the life of me figure out how to get the actual (double > precision?) *number* from a ut_unit struct. > > Where is this stored in ut_unit? Can it be accessed by some function I'm > missing? The "ut_unit" type is deliberately opaque: only the UDUNITS-2 library knows its structure. Consider this: what "value" would you expect from the celsius unit? How about a logarithmic unit? > Basically, I read a text file containing a bunch of numbers with different > units, and I want to store the double precision values to my own data > structure. So, you want to convert a bunch of (value, unit) pairs into (value', unit') pairs? Is that right? If so, then you should be able to do that by first obtaining a converter between the input and output units and then converting the value. > Kind Regards, > > -- > Aaron Webster Regards, Steve Emmerson Ticket Details =================== Ticket ID: MBR-454846 Department: Support UDUNITS Priority: Normal Status: Closed