python routines to access the Mars Climate Database
Jupyter Notebook Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

MCD-PYTHON: python-based interface to the Mars Climate Database

Open source code and contact information available on github [no registration needed]

  • To get sources through git
git clone
  • To get sources through SVN
svn co mcd-python
  • To get a static ZIP file of the current version of the code, click here

How to install?

It is assumed you were able to compile successfully the mcd sources with gfortran.

The netCDF library should be installed on your system. Moreover, from our experience, it seems that it must have been build using the -fPIC (for gfortran; the name of the option changes with compilers) option which generates position independent code suitable for use in a shared library. An example script is given in the netcdf folder.

The installation below relies on f2py utility, which is part of the numpy package.

  1. Getting the environment variables right: add the mcd-python folder to PYTHONPATH in your environment file (e.g. .bashrc)

    export PYTHONPATH=$PYTHONPATH:adapt_to_your_own/mcd-python
  2. Modify the compile script to link your local netCDF libraries and mcd distribution (Fortran sources)

  3. Check that f2py is included in your python library suite.

  4. Run and check for the created .so file (its size should be about 1 Mo)

Quick test

Next step is to try and learn about the use of mcd Python library with the tutorial folder.

A more advanced example (direct use of fmcd compiled with f2py) is provided in the test_mcd folder.

Python 3

Solution suggested by Aaron Berliner

This can be done using the 2to3 package and the reindent

Run 2to3 -v -n -W -f all
Run 2to3 -v -n -W -f all
Run reindent
Run reindent

Then upgrade to the appropriate basemap in python3.