00 - Why Python?

This is part of Python for Geosciences notes.


- It's easy to learn, easy to read and fast to develop

It is considered to be the language of choice for beginners, and proper code formatting is in the design of the language. This is especially useful when you remember, that we are the scientist not programmers. What we need is to have a language that can be learned quickly, but at the same time is powerful enough to satisfy our needs.

- It's free and opensource.

You will be able to use your scripts even if your institute does not have enough money to buy expensive software (MATLAB or IDL). You can make changes in the code, or at least have the possibility to look at the source code if you suspect that there is a bug.

- It's multiplatform

You can find it on many systems, so you are not tide to Windows, Mac or Linux. It sounds great, but not always the case, some modules will work only on limited number of operating systems (e.g. PyNGL, pyFerret).

- It's general purpose language

You can use it not only for data processing and visualization, but also for system administration, web development, database programming and so on. It is relatively easy to make your code run in the parallel mode. Last but not the least - if you ever decide to leave academia your chances on the market are much better with some python skills.


- There is a smaller legacy code base

FORTRAN and Matlab are used for decades, and have a lot of libraries for all kinds of scientific needs. Although now main functionality is covered by python modules, there are still many specific areas where no python solution is available. This problem can be partly solved by python's integration with other languages (MLabWrap, F2py).

- It's slow

... if you don't use vectorization or Cython when loops are inevitable. Critical parts still can be written in FORTRAN or C.

Python in Earth Sciences

Lin, J. W.-B. (2012). Why Python Is the Next Wave in Earth Sciences Computing. Bulletin of the American Meteorological Society, 93(12), 1823–1824. doi:10.1175/BAMS-D-12-00148.1

  • Though it has been around for two decades, it exploded into use in the atmospheric sciences just a few years ago after the development community converged upon the standard scientific packages (e.g., array handling) needed for atmospheric sciences work.

  • Much more robust and flexible workflow. Everything from data download to data analysys, visualization and finally writing a paper can be done in one environment.

  • Ability to access innovations from industries outside of the Earth sciences (cloud computing, big data, mobile computing).

  • Institutional support includes groups at Lawrence Livermore National Laboratory’s Program for Climate Model Diagnosis and Intercomparison, NCAR’s Computer Information Systems Laboratory, and the British Atmospheric Data Centre.

Further reading:

Comments !