Python tools for use with GEOS-Chem
- Minimum system requirements
- Installing required software
- Configuring your computational environment
- Downloading source code
- Downloading data directories
- Creating run directories
- Configuring runs
- Output files
- Python tools for analyzing GEOS-Chem output
- Coding and debugging
- Further reading
On this page, we provide information about free and open-source Python-language tools for visualizing or analyzing GEOS-Chem data.
The GEOS-Chem Support Team develops GCPy, which is a Python-based toolkit containing useful functions and routines for working with GEOS-Chem. GCPy is meant to update and replace the IDL-based GAMAP utility. While not a complete re-write of the GAMAP IDL pacakage, GCPy aims to build on the well-established scientific python technical stack, leveraging tools like cartopy and xarray to simplify the task of working with model output and performing atmospheric chemistry analyses. GCPy features several plotting and tabling functions, and also supports regridding GEOS-Chem NetCDF files between the grid formats used in GEOS-Chem Classic and GCHP.
Full GCPy documentation is available on ReadTheDocs.
The GEOS-Chem Support Team continues to add new features and functionality to GCPy. Details on contributing to GCPy can be found on the ReadTheDocs site.
Third-party Python tools
Several third-party Python packages have been developed for GEOS-Chem. If you are interested in using any of these, we recommend that you follow up with the developers directly. The GEOS-Chem Support Team is not responsible for maintaining these tools.
|Jiawei Zhuang||xESMF: A universal regridder. Leverages ESMF's regridding capabilities to easily regrid data between lon-lat and cubed-sphere grids. Other grids are supported as well.||Available on Github|
|Daniel Rothenberg||xbpch: Backend for reading bpch output into xarray/dask||Available on Github|
|Barron Henderson||Several software packages, including:||Available on Github|
|Andre Perkins||pyEnsemble: This code is useful for running ensembles of GEOS-Chem adjoint model simulations within an MPI environment.||Available on Github|
Core Python packages for Earth Science data
For the most part, you don't need to use a lot of Python packages to read and plot GEOS-Chem data. For example, the GCPy package mostly relies on the following packages, which can be downloaded with either PyPI and/or Conda.
- xarray: For reading netCDF, HDF5, GRIB, etc. data into a common data structure for later manipulation
- matplotlib: For general plotting operations
- cartopy: For plotting data on world maps
- numpy: For math operations
- xESMF: For regrididdng between cubed-sphere to lat-lon grids
- pandas: For spreadsheet-like data analysis
Python tutorials and resources
If you are new to Python, we strongly recommend that you take our GEOS-Chem Python Tutorial. It will walk you though the steps of creating sample plots from GEOS-Chem output:
You may also find these resources useful:
- Python.org: Main site for all things Python
- Google's Python course
- Python 3 tutorial
- GeeksForGeeks Python page
- PythonWiki.org: List of tutorials and resources
- Google's Python tutorial