Python as a platform for ROMS analysis

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
hetland
Posts: 81
Joined: Thu Jul 03, 2003 3:39 pm
Location: TAMU,USA

Python as a platform for ROMS analysis

#1 Unread post by hetland »

MATLAB is presently the defacto standard in analysis of ROMS model output. This is in part because MATLAB is the standard analysis tool for observational oceanogrpahy (although not always), but mostly because of the hurculean efforts of Rich Signell (with much help from Chuck Denham and John Evans). Signell et al. created a usefull, flexible, and comprehensive set of tools -- even the ones that are a pain in the ass to write like seagrid, which sucks less than any other similar tool out there. However, MATLABS dominance was not predestined. Many other numerical ocean circulation sects use ferret, or some similarly goofy tool. In the early days of ROMS, Hernan Arrango created a suit of tools based on NCAR Graphics, but that never really caught on outside of Rutgers. This is because, I believe, people will choose a tool that can do everything a little bit, rather than a tool that can only do one thing, no matter how well it can do it. Flexibility is essential.

There are many things wrong with MATLAB, we all know what they are: memory leaks, slowness, strange postscript, license servers, etc. We all put up with these problems because it has been the least sucky thing out there. It is flexible, dynamic, and once you learn how to think within its framework (i.e., vectorizing) it is reasonably efficient to code and execute. We use matlab for the same reason we use any tool: there is nothing better available.

However, the MATLAB strnaglehold is not tight as you might think. There are no aspects of MATLAB that are necissary to model anylysis. In particular, there are no essential toolboxes -- the tools that we use for model analysis have been created by the user community, and are available for free. Most notably, these include the MexCDF toolbox and m_map.

Why use python?

Switching to another computer language involves learning a whole new set of programing techniques and writing a new suite of tools. In order make this initial investment in time worthwhile, there needs to be some clear (and large) benifit. I belive python is worth the effort to switch for the following reasons:
  • Python is an extremely powerful programing language. This means that you can use python for a wide variety of programing tasks, not just model analysis.

    Python is naturally object oriented. These means programs will also tend to be stronger and more flexible because of the nature of python programing. It is simple to convert a haphazard set of tools into a cohesive toolbox.

    There are many freely available packages that can perform tasks you might want to do. In particular, matplotlib has a plotting interface very similar to that of MATLAB, meaning that the lerning curve is considerably reduced.
For more information, including a longer list comparing MATLAB and Python written by Chirs Barker and some samples of code using python to plot and analyze ROMS simulations, go to Rob Hetland's python page

Post Reply