| Size: 6297 Comment:  | Size: 6442 Comment:  | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 132: | Line 132: | 
| or try [[http://www.sagemath.org/|Sage (Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab)]]. | 
Python at KlimaCampus
This page shall be a central help for ZMAW/KlimaCampus users of Python. Contact AlexLoew or LarsKaleschke for permission to edit this page. Please help to fill this page with useful information about Python for climate research and data analysis.
Contents
Why python rocks!
ZMAW Settings
SNOW, SQUALL:
module load python
Getting started ...
ZMAW internal ressources
- MPI-M, Land department python seminar series, 2012 by Alex Loew and Julia Pongratz 
- Open Source Scripting for Geo-Scientific Data Processing and Analysis by LarsKaleschke KlimaCampus Lecture 
- Sebastian Heimann's MPI-M lecture (scroll to the bottom of the webpage) 
External ressources / tutorials
Documentation and further information
- http://www.python.org/doc/ Standard documentation 
- Advanced matplotlib tutorial with library author John Hunter, 2012 PyData Workshop 
Modules for Scientific Computing and Visualization
A good summary webpage how to use geospatial data (e.g. netCDF, GRIB) with python is given here.
SciPy/NumPy
pylab
- Matplotlib/pylab Plotting functions with a high degree of Matlab compatibility 
- http://matplotlib.sourceforge.net/basemap/doc/html/ Matplotlib Basemap 
Import the Basemap module
from mpl_toolkits.basemap import Basemap
GDAL
- GDAL - Geospatial Data Abstraction Library for various satellite data formats 
PyNGL PyNio
- PyNGL/PyNIO Python interface to NCAR Command Language 
- Scientific visualization and data formats (netCDF, HDF, GRIB etc.)
Python Interface to GrADS
RPy
- RPy (R from Python) Statistical computing and graphics 
F2PY: Fortran to Python interface generator
Calling Fortran code from python is easy!
Topical Modules
- Seawater is a package for computing properties of seawater (UNESCO 1981 and UNESCO 1983). 
- Escript/Finley: Fast Finite Elements for Partial Differential Equations 
More topical software can be found at http://scipy.org/Topical_Software
Python and Climate
IPython Notebooks
A notebook is a combination of two things:
- An interactive session connected to an IPython kernel, controlled by a web application that can send input to the console and display many types of output (text, graphics, mathematics and more).
- A document that can save the inputs and outputs of the session as well as additional text that accompanies the code but is not meant for execution. In this way, notebook files serve as a complete computational record of a session including explanatory text and mathematics, code and resulting figures.
module load python/2.7-ve2 ipython notebook --pylab inline
Download (try this at home)
A basic system for scientific computing consists of Python, ipython, numpy/scipy, pylab, and an editor of your choice
- Editor (a nice editor for Windows user, if you don't like to install xemacs) 
The python(x,y) distribution contains all that above.
Literature
- Python Scripting for Computational Science, Hans Petter Langtangen, Springer (available in the ZMAW library)
- Matplotlib for Python Developers - Build remarkable publication quality plots the easy way, Sandro Tosi, Packt Publishing, Birmingham - Mumbai, 2009
- Principles of Planetary Climate (RAYMOND T. PIERREHUMBERT) includes a large collection of Python examples 
