The nbtools module is to be seen as a Python toolbox devoted to Earth Scientists. It is divided into multiple sub-modules, which are summarised in the table below.

Module name Contents Functions and classes related to maps (finding points within a polygon, masked Lambert projection)
nbtools.colors Functions and classes related to colors (generation of fancy colormaps, classification mapping)
nbtools.ts Functions and classes related to time-series processing (monthly and daily climatologies, Lanczos filtering, multitaper spectral analysis) Functions related to the handling of NetCDF files

This module is likely to evolve. Don’t hesitate to regularly update to the last version (see the Downloading the source section).

If you have any questions, suggestions or if have found any bugs, feel free to contact me at

Getting the nbtools library

Module requierements

The nbtools library requieres the following packages:

Downloading the source

The nbtools library is available via the Sourcesup platform. It can be downladed by using Subversion as follows:

> mkdir nbtools
> cd nbtools
> svn checkout

The last version of the library is obtained as follows:

> cd nbtools
> svn update

Module installation

The module installation is achieved as follows:

> cd trunk
> python install --home=/install/directory

The home option indicates the location where the library will be installed. Note that the install directory must be in the PYTHONPATH. If it is not the case, you should edit your .bashrc file and add the following line:

export PYTHONPATH=$PYTHONPATH:/install/directory/lib/python  # for BASH/KSH
setenv PYTHONPATH ${PYTHONPATH}:/install/directory/lib/python # for CSH/TCSH

Generating the documentation

The nbtools documentation can be built offline by using the Sphinx library. This is achieved as follows:

> cd trunk/docs
> make html
> make latexpdf

Note that the environment variable SPHINXBUILD, containing the name of the Sphinx executable file, must be defined.

export SPHINXBUILD=sphinx-build-2.7  # for BASH/KSH
setenv SPHINXBUILD sphinx-build-2.7  # for CSH/TCSH

The HTML documentation is built in the trunk/docs/build/html directory (index.html file), while the LaTex documentation is built in the trunk/docs/build/latex directory (nbtools.pdf file).


An HTML version of this documentation is available here (see the Python/NCL tab).