Robust Units Handeling
Current, RVIC is using an ad hoc input/output units scheme, checking for a few known combinations of unit strings (e.g. 'mm', 'kg m-2 s-1', etc). There are a few Python projects that have wrapped the UDUNITS library that support conversion of a range of units.
Two packages that come to mind:
One of these should be included in read_forcings.py and history.py to handle the units conversion that is currently done in a more sophisticated way.
CC: @bartnijssen, @mrstu related: #55
@mrstu, have you used either of these projects?
@jhamman Scitools iris provides a python wrapper for udunits that is now available as a stand alone module called (https://github.com/SciTools/cf_units).
cf-units is similar to cfunits-python python, but better maintained, lager community, and easier to install (no hard coded path, etc). We have conda binaries for Win, OSX and, Linux. (Sorry no python 3 yet!)
Check this out for some examples.
Thanks @ocefpaf -
cf_units looks like it will be the best options moving forward. Once there is Python 3 support, I'll give it a try here.
related: https://github.com/SciTools/cf_units/pull/22