Differences between revisions 5 and 13 (spanning 8 versions)
Revision 5 as of 2010-06-22 15:57:10
Size: 4309
Comment:
Revision 13 as of 2010-06-22 16:19:28
Size: 4041
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
== KlimaCampus Lectures ==
Line 15: Line 14:
 * [[http://wiki.zmaw.de/lehre/OpenSource2010|Open Source Scripting for Geo-Scientific Data Processing and Analysis]] by LarsKaleschke

== ZMAW Setting ==
== ZMAW Settings ==
Line 25: Line 22:
[[/ZMAW|More ZMAW specific settings]]
Line 26: Line 24:
== Documentation and further reading == == Courses ==

 * [[http://wiki.zmaw.de/lehre/OpenSource2010|Open Source Scripting for Geo-Scientific Data Processing and Analysis]] by LarsKaleschke '''KlimaCampus Lecture'''
 
= Documentation and further reading =
Line 35: Line 37:
== Modules for Scientific Computing and Visualization == = Modules for Scientific Computing and Visualization =
Line 37: Line 39:
=== SciPy/NumPy === == SciPy/NumPy ==
Line 51: Line 53:
=== GDAL === == GDAL ==
Line 53: Line 56:
 * [[http://wiki.zmaw.de/ifm/gdal|ZMAW GDAL]]
Line 54: Line 58:
To enable GDAL use
{{{
module load gdal
}}}

{{{
from osgeo import gdal
}}}


=== PyNGL PyNio ===
== PyNGL PyNio ==
Line 69: Line 63:
To enable PyNGL (on ZMAW Linux ia32/x64 and solaris10) you have to type
{{{
module load PyNGL/1.2.0
}}}

Please note, that Nio should be on the top of the list, e.g.

{{{
import Nio
from osgeo import gdal
import pylab as pl
}}}


=== Python Interface to GrADS ===
== Python Interface to GrADS ==
Line 85: Line 65:
=== RPy === == RPy ==
Line 88: Line 68:
=== F2PY: Fortran to Python interface generator === == F2PY: Fortran to Python interface generator ==
Line 94: Line 74:
Create a file {{{hello.f}}}:
{{{
C File hello.f
      subroutine foo (a)
      integer a
      print*, "Hello from Fortran!"
      print*, "a=",a
      end
}}}

Run
{{{f2py -c -m hello hello.f}}}

Now in IPython try:
{{{
In [1]: import hello
In [2]: hello.foo(4)
 Hello from Fortran!
 a= 4
}}}

Example taken from

 * [[http://cens.ioc.ee/projects/f2py2e/|F2PY: Fortran to Python interface generator]]

== Topical Modules ==
= Topical Modules =
Line 126: Line 81:
== Python and Climate == = Python and Climate =
Line 128: Line 83:
 * [[http://geosci.uchicago.edu/~rtp1/ClimateBook/ClimateBook.html|Principles of Planetary Climate (RAYMOND T. PIERREHUMBERT)]]
Line 131: Line 85:
 * [[http://code.google.com/p/pyccsm/|pyccsm A Python version of the CCSM coupler]]
Line 132: Line 87:
== Download (try this at home) == = Download (try this at home) =
Line 143: Line 98:

= 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
 * [[http://geosci.uchicago.edu/~rtp1/ClimateBook/ClimateBook.html|Principles of Planetary Climate (RAYMOND T. PIERREHUMBERT)]] includes a large collection of Python examples

Python at KlimaCampus

This page shall be a central help for ZMAW/KlimaCampus users of Python. Contact LarsKaleschke for permission to edit this page. Please help to fill this page with useful information about Python for climate research and data analysis.

ZMAW Settings

Python2.6.2 requires

module load R/2.7.0
module load Python/2.6.2

More ZMAW specific settings

Courses

Documentation and further reading

Modules for Scientific Computing and Visualization

SciPy/NumPy

pylab

Import the Basemap module

from mpl_toolkits.basemap import Basemap

GDAL

PyNGL PyNio

Python Interface to GrADS

RPy

F2PY: Fortran to Python interface generator

Calling Fortran code from python is easy!

Fortran to Python

Topical Modules

More topical software can be found at http://scipy.org/Topical_Software

Python and Climate

Download (try this at home)

A basic system for scientific computing consists of Python, ipython, numpy/scipy, pylab, and an editor of your choice

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

IfmWiki: FrontPage/Python (last edited 2010-10-25 08:44:17 by LarsKaleschke)