Skip to main content

Python API to SURFEX

Project description

https://coveralls.io/repos/github/metno/pysurfex/badge.svg?branch=master

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 poetry run pgd

Installation on debian based Linux system

Install the required pacakges (some might be obsolete if the pip packages contain the needed depedencies):

sudo apt-get update
sudo apt-get install -y libudunits2-dev libproj-dev libeccodes0 libeccodes-dev libnetcdf-dev netcdf-bin ca-certificates

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
toml
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 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

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

poetry install

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

Run pysurfex client applications

import sys
from pysurfex.cli import parse_args_surfex_binary, run_surfex_binary

argv = sys.argv[1:]
kwargs = parse_args_surfex_binary(argv, "pgd")
run_surfex_binary("pgd", **kwargs)

Examples

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysurfex-0.0.4.1.tar.gz (145.9 kB view details)

Uploaded Source

Built Distribution

pysurfex-0.0.4.1-py3-none-any.whl (159.5 kB view details)

Uploaded Python 3

File details

Details for the file pysurfex-0.0.4.1.tar.gz.

File metadata

  • Download URL: pysurfex-0.0.4.1.tar.gz
  • Upload date:
  • Size: 145.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-1037-azure

File hashes

Hashes for pysurfex-0.0.4.1.tar.gz
Algorithm Hash digest
SHA256 514c4cc81fa2037cd3f12bea4b423289aa92147cdc455e0ade0b3e9920630a1f
MD5 5903f17049402d4224c62d30a13592bc
BLAKE2b-256 473f6b15bd086ad6050ca12ed10629031c24a9009ea1c658cf7b62432ef3de33

See more details on using hashes here.

File details

Details for the file pysurfex-0.0.4.1-py3-none-any.whl.

File metadata

  • Download URL: pysurfex-0.0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 159.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.8.10 Linux/5.15.0-1037-azure

File hashes

Hashes for pysurfex-0.0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1ee7d1bce51fa4493d8e42700c257dbc2c59bc2ce747423ea615109e8877f8
MD5 755682f966e870ffe956e74ff9161ae0
BLAKE2b-256 66d9a641d74c9af8b266213d9fd5eb2b7b89c0adb745c56514501476d59ac502

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page