Skip to content
KMFleischer edited this page Sep 6, 2019 · 4 revisions

Welcome to the PyEarthScience Wiki page

The PyEarthScience repository created by DKRZ (German Climate Computing Centre) provides various Python modules, scripts and iPython notebooks, in particular for Earth System data processing and visualization used in climate science.

For this different Python modules are used, like PyNIO, xarray, PyNGL, matplotlib, and psyplot.

Content

  • Why another GitHub repository?
  • Installation
    • Create the environment and install modules
  • Example data
    • PyNGL example data sets
    • NCL web example data sets
    • Special data sets

Why another GitHub repository?

Those who have decided to write their programs for the visualization of scientific data in Python, will encounter problems and questions such as - which modules are there, which ones are needed, which are well documented and, above all, which are still maintained today.

With this repository we want to provide example scripts and show which modules can be used.

Installation

We recommend to use one of the conda packages, miniconda or anaconda, to create your own python environment and install the software on your computer.

    Anaconda    https://www.anaconda.com/
    Miniconda   https://docs.conda.io/en/latest/miniconda.html

Some of the recommended modules need to be installed using pip.

    Pip     https://pypi.org/project/pip/

Once you have installed the conda and pip software, activate the environment and install additional modules, like

  • PyNIO
  • PyNGL
  • xarray >=0.11.0
  • xesmf
  • cfgrib
  • pyshp >=2.0.0
  • matplotlib
  • cartopy

Create the environment and install modules

We recommend to use python 3.6. And since we want to use the PyNGL software in the first place we call the new environment 'pyngl_py3'.

  1. Create the new environment pyngl_py3

    conda create -n pyngl_py3 -c conda-forge pynio=1.5.1 pyngl=1.6.1 python=3.6
  2. Activate the pyngl_py3 environment

    conda activate pyngl_py3
  3. Install addtional modules with conda

    conda install -n pyngl_py3 xarray xesmf matplotlib cartopy
  4. Install additional modules with pip

    pip install cfgrib
    pip install pyshp

Example data

We try to use only data files from the PyNGL installation or from the NCL examples web page.

PyNGL example data sets

Let's stay with the name of the environment 'pyngl_py3' from above, the example data files from PyNGL can then be found in

<your-conda-installation-path>/envs/pyngl_py3/lib/python3.7/site-packages/ngl/ncarg/data/

NCL web example data sets

The NCL example data sets can be found at http://www.ncl.ucar.edu/Applications/Data/.

Special data sets

Sometimes we need data sets to demonstrate special cases. These data sets are added to the script directories where they are used.