pyICON
Prepared for the MPI-M LunchBytes online seminar on April 17 by Nils Brueggemann.
Introduction to pyICON
pyICON is a python post-processing and visualization toolbox for ICON with a focus on ocean data. The three main features of pyICON are:
- a number of functions to facilitate the every-day script-based plotting of ICON data
- an interactive (ncview-like) plotting GUI for Jupyter notebook
- a monitoring suite for ICON ocean simulations which combines dedicated diagnostic plots of an ICON simulation on a website
pyICON is hosted at (Note that all other links below are likely to change in the future. Therefore use the following link to look for more pyICON information, in case the other links do not work anymore.):
https://gitlab.dkrz.de/m300602/pyicon/
The pyICON documentation can be found here:
https://modvis.dkrz.de/mh0033/m300602/pyicon_doc/html/index.html
Example Notebooks can be found here:
https://gitlab.dkrz.de/m300602/pyicon/-/tree/master/notebooks
An example for pyICON quickplots can be found here:
https://modvis.dkrz.de/mh0033/m300602/qp-jkr0042/tave_1780-02-01-1790-01-01/qp_index.html
Installing pyICON on Mistral
Log into Mistral and go to a directory where you want to install pyicon (this can be in your home directory or on work). Download pyicon by::
git clone https://gitlab.dkrz.de/m300602/pyicon.git
The easiest way to use pyicon on Mistral is to use a pre-installed environment. Therefore execute the following command (do not forget to change ``/path/to/pyicon/`` to the path where you downloaded pyicon)::
source /path/to/pyicon/tools/conda_act_mistral_pyicon_env.sh
Note: The script ``conda_act_mistral_pyicon_env.sh`` is expanding the python path to contain the pyicon module. It also expands the normal path variable that enables the use of conda. Finally, a suitable python3 environment is activated by conda.
pyICON Quickstart
The easiest way to start is probably by using some of the example scripts from the directory ``example_scripts``. Best is to start with ``examp_pyicon_start.py`` either by typing::
python example_scripts/examp_pyicon_start.py
or by using ipython::
cd example_scripts ipython --pylab %run examp_pyicon_start.py
If you prefer to use Jupyter notebooks, you can also start a Jupyter Python session and try one of the notebooks in ``notebook``. A beginner example is ``examp_pyicon_start.ipynb``. You can find the notebooks under:
https://gitlab.dkrz.de/m300602/pyicon/-/tree/develop/notebooks>
Introduction to python
Lot's of introductary information for python can be found on the internet. Here comes a small collection of tutorials focused on geoscience applications:
Simple and short introduction to python with pyICON related plotting: https://gitlab.dkrz.de/m300602/pyicon/-/blob/master/notebooks/python_introduction.ipynb
Python for Geosciences (Nikolay Koldunov): https://github.com/koldunovn/python_for_geosciences
Research Computing in Earth Sciences (Ryan Abernathey): https://rabernat.github.io/research_computing/