Tuesday, July 13, 2010

Presentation fonts

I usually use Helvetica for presentations, and then include LaTeX equations using LaTeXit. The best font to use with Helvetica seems to be Arev, which has the right weight to balance Helvetica. To use this, simply put

\usepackage{arev}

in the preamble.

Monday, July 5, 2010

Auto Draft

Random netcdf4-python notes

Some notes on using netcdf4-python


  • Use the shared netcdf4 libraries to compile. (ROMS needs static netcdf4 libraries -- so you need to build both).
  • The new version returns a np.ma.MaskedArray when there are missing values.
  • Using ncks (from the netCDF operators) to compress -- need to be careful about specifying netcdf4_classic format. Standard netcdf4 format does not play nice with MFDataset.
  • The new netCDF4 is DAP enabled, a feature that is passed through to netcdf4-python. All you need to do is specify a DAP-URL, and you can see your data over the internet!

Monday, August 24, 2009

Compiling the netcdf operators

A small adventure in compiling the netcdf operators (with netcdf4 support) uses these things

First, the *shared* netcdf4 libraries must be used. And despite the advice on the web, all of the include and library directories must be specified... see

./configure --help

for the variables that must be set. Then, I needed to modify

nco/src/nco/nco_netcdf.h

so that

#define HAVE_NETCDF4_H

was set at the beginning of the file. This variable should be set when using netcdf4, but it was not. Then configure and make like this:

./configure --enable-netcdf4 --disable-shared
make -j 8

I linked to a version of hdf and netcdf4 that did not use shared libraries, thus the --disable-shared option. I also had success linking to shared versions of these libraries.

The build fails on the math operators, like usually, but it makes ncks. I noticed that it was searching for an old version of libnco, so delete that first. You may also need to do a ldconfig to find the right libraries after the install.

Monday, January 12, 2009

OmniFocus vs. Things

The short answer is that [Things](http://culturedcode.com/things/) wins... Now for the long answer, after the break..

Monday, November 24, 2008

building VTK on (intel) Mac OS 10.5

Based on [directions found here](https://svn.enthought.com/enthought/wiki/IntelMacPython25), I created a working build of VTK with Python bindings.

First, download the source from CVS, [here](http://www.vtk.org/get-software.php). You will need to make sure you have a recent version of [CMake](http://www.cmake.org/) installed as well. Then, go into the VTK directory and type:

mkdir build; cd build
ccmake ..

Press c to do the initial configuration. Set:

BUILD_SHARED_LIBS=ON
VTK_WRAP_PYTHON=ON

Press c again. Press t to look at the advanced options. This is where my directions diverge slightly from the enthought directions. I used the system python, which ccmake seems to recognize right away, so I only changed:

PYTHON_LIBRARY=-framework Python

Press c, then press g to generate the files. Then

make
make install

The make can take *forever*, so be patient.

One final thing to get vtk working with python is to go into the Build/Wrapping/Python directory and do a python build and install:

cd Wrapping/Python
python setup.py build
sudo python setup.py install

Done. Now you should be able to import vtk in python.

Friday, October 17, 2008

Google earth animations of various tidal constituents.

For my intro to Oceanography class, I made animations of the barotropic tide sea surface height. You can find them [here](http://pong.tamu.edu/~rob/google_earth_tides). Trust me, they are _very_ slick.