1. Introduction

The point of these notes is to provide a crash course in using python to examine numerical Earth System Model (ESM) output. They are also an excuse to evaluate and compare various packages that you might find useful in your analysis of ESM output. These notes are not a recommendation about which packages you should or should not use. All packages have advantages and drawbacks and, in my humble opinion, each are ideal for the particular tasks for which they were designed. Kudos to all the respective developers! I personally tend to use all the packages encountered in theses notes - I find being versatile helpful in what I do. You might prefer to choose one package for the comfort of familiarity and become expert with that one package. My recommendation: use whatever works for you.

1.1. How to use these notes

These notes are written using Jupyter notebooks. You can view or use them in multiple ways; interactively or passively, downloaded or on the web.

1.1.1. Interactive jupyter notebooks (recommended)

To be able to run these notebooks you need python (which is the point of the notes!) and jupyter (which sits above python and works with 200+ languages). You will have to clone the repository or download and unpack a zip file.

To clone using git, you will obviously need git installed. Then

git clone https://github.com/adcroft/Analyzing-ESM-data-with-python.git

To download a zip file go to https://github.com/adcroft/Analyzing-ESM-data-with-python and click the green “Clone or download” button and then “Download ZIP”, or just click https://github.com/adcroft/Analyzing-ESM-data-with-python/archive/master.zip. Once downloaded, unzip the file contents.

Once cloned, or downloaded and unpacked, launch a jupyter notebook server with

jupyter notebook

which should open a browser window in a directory view. Navigate to the location of the downloaded/cloned notebooks and click a notebook to open it.

Within a notebook, use the “Run” button to step through each cell and execute. “CTRL-enter” will also run the currently selected cell, while “SHIFT-enter” will do the same but then move and select the next cell.

1.1.2. Non-interactive via the web (HTML, pdf, epub)

You can view these notebooks rendered on GitHub at https://github.com/adcroft/Analyzing-ESM-data-with-python . Click on one or each of the .ipynb files.

The notebooks have also been converted using nbsphinx and are hosted in various forms on readthedocs. To see these just follow one of these links:

1.2. Contributing

If you find these notes helpful, or error-ridden, feel free to fork the GitHub repository, make changes and let me know with a pull request. And feel free to give your self credit in the text!

1.3. Credits

  • The Jupyter project has transformed the way we work - for the better!
  • nbsphinx is a great tool that allows these notes to written in jupyter notebooks and rendered in many other formats.
  • The Princeton University undergraduate project M6ASP with many thanks to @estherelle and @karnabhonil.