Installing cfchecks under OSX 10.9

CF Checker will check netcdf files for cf compliance. I never thought this would interest me so much until I started to make my own netcdf files (see here for an ipython notebook example).

Once generated, the idea was to be able to check these files on my local machine. CF Checker was not a straightforward tool to install, mainly because a few key steps have to be done manually and there are some extra files to download. My method is as follows:

  • To get started, install udunits2 using homebrew.  For cfchecks to work you’ll need to link the resulting dylib to a shared object (so) file.
  • Next, download and install cfchecks using pip.  It won’t work yet.
  • To execute cfchecks, you’ll need the cdms2 module from cdat-lite.  The full UV-CDAT suite is the biggest PITA to install and even more unfortunately, the reduced cdat-lite is also broken.
  • pip install cdat-lite crashes out with an awful message about being unable to remove('/Users/spascoe/git/cdat_lite/Packages/AutoAPI/Lib/’,) because that would violate the sandbox. So,
  • get the tar ball (I used 6.0rc2) and install in the Canopy virtualenv using python install
  • Now follow the instructions as on this page, rather than here, say, that is
    • export LD_LIBRARY_PATH=/usr/local/lib
    • (crucially) export the following environment variables
      • UDUNITS : The path to udunits2.xml. This needs to be the full path to (including filename) ofudunits2.xml
      • CF_STANDARD_NAMES : The path or URL to the CF standard names table (i.e. XML file), a working version is available here.
      • CF_AREA_TYPES : The path or URL to the CF area types tables (i.e. XML file), a working version is available here