Skip to main content

Python API to SURFEX (pysurfex)

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/

Installation of pregenerated packages from pypi (pip)

All releases will trigger an autmomatic pre-built package on pypi which can be installed by pip

pip3 install pysurfex

User installation:

pip3 install pysurfex --user

Run pysurfex from pre-built container

Releases 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 pgd

Installation on debian based Linux system

The following depencies are needed. Install the non-standard ones e.g. with pip or your system installation system.

General dependencies (from pypi)

numpy
pyproj
pyyaml
f90nml

To read NetCDF files:

NetCDF4
cfunits

To read grib files:

eccodes

from ECMWF https://software.ecmwf.int/wiki/display/ECC/Releases installed with ENABLE_PYTHON=ON

To read FA files:

falfilfa4py
epygram

To plot:

matplotlib

To get observations from frost.met.no API:

requests

For Quality control of observations

titanlib

For optimal interpolation and observation operators

gridpp

For testing:

pytest

Install pysurfex

An 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 poetry

Download the source code, then install pysurfex by executing the following inside the extracted folder:

poetry install

If not already in a conda/manba environment, this will install pysurfex in a poetry environment and this environment can be activated interactively by:

poetry shell

or

Run pysurfex client applications

poetry run [command]
# e.g.
poetry run python # will run python inside the pysurfex poetry environment

Examples

See https://metno.github.io/pysurfex/#examples

Metadata

Release files for pysurfex 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysurfex 0.1.5
File Size Uploaded Provenance Actions
pysurfex-0.1.5.tar.gz 127.4 kB Without provenance Details for pysurfex-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysurfex 0.1.5
File Interpreter ABI Platform Actions
pysurfex-0.1.5-py3-none-any.whl Python 3 none any Details for pysurfex-0.1.5-py3-none-any.whl

Total release size: 270.0 kB

Release files / pysurfex-0.1.5.tar.gz

Download URL pysurfex-0.1.5.tar.gz
Size 127.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2045871730fc524a0bbf062735be0d83381c1ed72f308d6d7c8e696748722908
BLAKE2b-256 checksum
How to use checksums
ffcd94f4b8e4f5f42d31db89da4dd751f81eb65b07eca12958404f0f4f9efff9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

Release files / pysurfex-0.1.5-py3-none-any.whl

Download URL pysurfex-0.1.5-py3-none-any.whl
Size 142.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c2e83fd0a77b579d05b363174f605f4115a808f782995085f2f950500ceb13f
BLAKE2b-256 checksum
How to use checksums
4eb1a7c99a1230334e74a6f9a88f5455c72e7c172a833b31928ef84efa87ec69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure

Security for pysurfex 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page