Every repository with this icon (
Every repository with this icon (
Installation of prequisites
Prerequisites for reading IPCC climate change data with ruby
- NetCDF (library)
- Narray (gem)
- RubyNetCDF (gem / install)
NetCDF is the base library used to parse and read in the data. The ruby package RubyNetCDF is a wrapper around this core functionality, outputting the data into a nice ruby Narray.
NetCDF
On OSX, install this by using macports (“sudo port install netcdf”). It’s available as a package in Debian based systems , and is available as an RPM from that nice Dag Wieers. On other systems, the source is available to compile.
Narray
This is a Ruby library for easily interacting with multi-dimentional arrays, a data structure commonly used to store scientific data. If you’ve got ruby gems installed, it’s as simple as: “sudo gem install narray”
RubyNetCDF
This is currently not available as a gem. You’ve got to download the source , compile and install it on your own system. I’ll discuss some points with the OSX install having used Macports to install the base library.
When you install the base netcdf via Macports, the headers and library files all get stuck in /opt/local/include and /opt/local/lib. You’ll need configure the compilation process with these directories in mind:
ruby extconf.rb—with-netcdf-include=/opt/local/include —with-netcdf-lib=/opt/local/lib
you’ll also need to point the configure file to your installation of Narray:
ruby extconf.rb—with-narray-include=/usr/local/lib/ruby/gems/1.8/gems/narray-0.5.x.x
then run “sudo make && make install”.
Then find the netcdf.rb file that’s been installed (mine was at /usr/local/lib/ruby/site_ruby/1.8/numru/netcdf.rb ) and make sure that the following requires are at the top of the file:
require ‘rubygems’ require ‘narray’ require ‘numru/netcdfraw’
If there is anything missing, add it.
Finished!
That’s pretty much it for the installation! Now to actually interrogate the files!




