Sharing is caring

Python packages used or driven by the GEMS community

Lukas Kluft

The basics

  • Python functions and classes can be organised in modules

    import my_module
    
    my_module.my_function(42)
  • Packages allow for a hierarchical structuring of modules

  • The Python Package Index (PyPI) helps you find and install software1

    pip install <package_name>

The default stack

This talk will not cover the “usual suspects”

NumPy, SciPy, matplotlib, cartopy, netcdf4, xarray (+flox), ...

healpix (not healpy)

  • implements a lean set of routines for working with HEALPix

    healpix.nside2npix(9)
    healpix.ang2pix(nside=9, 52, 10, nest=True, lonlat=True)
  • requires only NumPy, and can be installed with pip:

    python -m pip install healpix

easygems

  • provides a (small) set of convenience functions to work with model output

    easygems.healpix.healpix_show(ds_daily.tas.sel(time="2024-09-10"))
  • started as a “bin” for functions used on easy.gems

  • can be installed with pip

    python -m pip install easygems

gribscan

  • scan GRIB files and create zarr-compatible indices

    gribscan-index *.grib2
    gribscan-build --magician ifs --prefix $PWD *.index
  • provides the command-line tools gribscan-index and gribscan-build

  • requires an ecCodes version that matches the output data

  • can be installed with pip (apart from ecCodes)

    python -m pip install gribscan