This is part of Python for Geosciences notes.
================
Core scientific packages¶
When people say that they do their scientific computations in Python it's only half true. Python is a construction set, similar to MITgcm or other models. Without packages it's only a core, that although very powerful, does not seems to be able to do much by itself.
There is a set of packages, that almost every scientist would need:
We are going to talk about all exept Sympy
IPython and pylab¶
In order to be productive you need comfortable environment, and this is what IPython provide. It was started as enhanced python interactive shell, but with time become architecture for interactive computing.
read moreThere are comments.
02 Python basics
This is part of Python for Geosciences notes.
================
Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C. The language provides constructs intended to enable clear programs on both a small and large scale.
-- From Wikipedia, the free encyclopedia
Variables¶
Python uses duck typing
Int¶
03 NumPy arrays
This is part of Python for Geosciences notes.
================
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
04 Work with different data formats
This is part of Python for Geosciences notes.
================
Binary data¶
Open binary¶
05 Graphs and maps (Matplotlib and Basemap)
This is part of Python for Geosciences notes.
=============
Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.
Let's prepare some data:
07 Other modules for geoscientists
This is part of Python for Geosciences notes.
=============
Some of the things will not work on ZMAW computers (Iris, Cartopy).
Iris¶
Iris seeks to provide a powerful, easy to use, and community-driven Python library for analysing and visualising meteorological and oceanographic data sets. Kind of Ferret replacement. Developed in the Met Office by group of 7 full time developers. There are more than 300 active python users in Met Office.
With Iris you can:
Links
Here is small collection of links that I find useful.
Websites:¶
Lectures on Scientific Computing with Python. - very good introduction to the topic writen as a collection of IPython Notebooks.
A gallery of interesting IPython Notebooks - constant source of inspiration :)
OceanPython.org - OceanPython.org is a website to learn Python Programming Language for ocean- and marine-science applications and to share Python code. OceanPython.org is maintained by students, staff and post-docs at the Department of Oceanography of Dalhousie University (Canada)