This is a collection of tips and examples on using Python in the earth sciences, with an emphasis on climate science. We focus solely on standard Python, Numerical Python, and the analysis and plotting routines in the Climate Data Analysis Tools (CDAT) suite. This collection of tips/examples is neither "official" nor comprehensive.
A note from June 2017: While a number of the tips on this site are still useful, this site hasn't really been updated much since the first decade of the 2000's. The community has also moved on: NumPy and not Numerical Python is the array package of choice and CDAT has become UV-CDAT. Python is also now at version 3. Some more recent Python-for-the-atmospheric sciences resources are available or listed at the PyAOS blog.
General Python references (some referenced herein) that have helped me include:
If you have any comments, questions, additions, and corrections for this page, please send me (Johnny Lin) email.
Advertisement: In 2012, I published the book A Hands-On Introduction to Using Python in the Atmospheric and Oceanic Sciences. If you're new to Python, you may find it useful!
Numericarrays? Can you concatenate along "extra" dimensions like you can in IDL?
wherein IDL and
oroperations on arrays?
imagescfunction and make plots with color bars that are scaled over the same range?
x|yrevkeyword work to reverse the axis?
MAhave a default missing value?