- An API in python to the external surface model SURFEX.
- Prepare input and namelists to a SURFEX binary
- Create atmospheric forcing for offline SURFEX runs
- Read SURFEX output
- Quality control of observations with titanlib
- Optimal interpolation with gridpp
- Monitor the observations usage
See online documentation in https://metno.github.io/pysurfex/
All releases will trigger an autmomatic pre-built package on pypi which can be installed by pip
pip3 install pysurfexUser installation:
pip3 install pysurfex --userReleases also trigger an update of the pysurfex container in the github container registry. Below is an example to run pgd without any arguments.
podman run -it ghcr.io/metno/pysurfex:latest pgdThe following depencies are needed. Install the non-standard ones e.g. with pip or your system installation system.
numpy
pyproj
pyyaml
f90nmlTo read NetCDF files:
NetCDF4
cfunitsTo read grib files:
eccodesfrom ECMWF https://software.ecmwf.int/wiki/display/ECC/Releases installed with ENABLE_PYTHON=ON
To read FA files:
falfilfa4py
epygramTo plot:
matplotlibTo get observations from frost.met.no API:
requestsFor Quality control of observations
titanlibFor optimal interpolation and observation operators
gridppFor testing:
pytestAn environment manager like miniconda or micromamba is recommended to ensure consistency between the packages. After installing this you need to set it up for the current session or permanently add it to your shell. Now it is easy to create a suitable environment for pysurfex. Below is a recipie for micromamba.
# Install micromamba (linux, https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
# specify a installation location for micromamba and add it to your path afterwards. Default it will install in $HOME/.local/bin
export PATH=$HOME/.local/bin:$PATH # Use your PATH
# initialize your shell (needed in all shells), e.g:
eval "$(micromamba shell hook --shell bash)"
micromamba create env pysurfex
micromamba activate pysurfex
micromamba install python==3.12 poetryDownload the source code, then install pysurfex by executing the following inside the extracted
folder:
poetry installIf not already in a conda/manba environment, this will install pysurfex in a poetry environment and this environment can be activated interactively by:
poetry shellor
poetry run [command]
# e.g.
poetry run python # will run python inside the pysurfex poetry environment