.. image:: 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
.. code-block:: bash
pip3 install pysurfex
User installation:
.. code-block:: bash
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.
.. code-block:: bash
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):
.. code-block:: bash
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)
---------------------------------
.. code-block:: bash
numpy
pyproj
pyyaml
toml
f90nml
To read NetCDF files:
.. code-block:: bash
NetCDF4
cfunits
To read grib files:
.. code-block:: bash
eccodes
from ECMWF https://software.ecmwf.int/wiki/display/ECC/Releases installed with ENABLE_PYTHON=ON
To plot:
.. code-block:: bash
matplotlib
To get observations from frost.met.no API:
.. code-block:: bash
requests
For Quality control of observations
.. code-block:: bash
titanlib
For optimal interpolation and observation operators
.. code-block:: bash
gridpp
For testing:
.. code-block:: bash
pytest
Install pysurfex
-------------------------------------------
Download the source code, then install ``pysurfex`` by executing the following inside the extracted
folder:
.. code-block:: bash
poetry install
This will install ``pysurfex`` in a poetry environment and this environment can be activated interactively by:
.. code-block:: bash
poetry shell
or
Run pysurfex client applications
-------------------------------------------
.. code-block:: bash
poetry run [command]
# e.g.
poetry run python # will run python inside the pysurfex poetry environment
Run pysurfex client applications
-------------------------------------------
.. code-block:: python
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
Raw data
{
"_id": null,
"home_page": "https://github.com/metno/pysurfex",
"name": "pysurfex",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Trygve Aspelien",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/47/3f/6b15bd086ad6050ca12ed10629031c24a9009ea1c658cf7b62432ef3de33/pysurfex-0.0.4.1.tar.gz",
"platform": null,
"description": "\n.. image:: https://coveralls.io/repos/github/metno/pysurfex/badge.svg?branch=master\n\n\nPython API to SURFEX (pysurfex)\n=======================================================\n\nAn API in python to the external surface model SURFEX.\n - Prepare input and namelists to a SURFEX binary\n - Create atmospheric forcing for offline SURFEX runs\n - Read SURFEX output\n - Quality control of observations with titanlib\n - Optimal interpolation with gridpp\n - Monitor the observations usage\n\nSee online documentation in https://metno.github.io/pysurfex/\n\nInstallation of pregenerated packages from pypi (pip)\n---------------------------------------------------------\n\nAll releases will trigger an autmomatic pre-built package on pypi which can be installed by pip\n\n.. code-block:: bash\n\n pip3 install pysurfex\n\nUser installation:\n\n.. code-block:: bash\n\n pip3 install pysurfex --user\n\n\nRun pysurfex from pre-built container\n-------------------------------------------\n\nReleases also trigger an update of the pysurfex container in the github container registry. Below is an example to run pgd without any arguments.\n\n.. code-block:: bash\n\n podman run -it ghcr.io/metno/pysurfex:latest poetry run pgd\n\n\nInstallation on debian based Linux system\n--------------------------------------------\n\nInstall the required pacakges (some might be obsolete if the pip packages contain the needed depedencies):\n\n.. code-block:: bash\n\n sudo apt-get update\n sudo apt-get install -y libudunits2-dev libproj-dev libeccodes0 libeccodes-dev libnetcdf-dev netcdf-bin ca-certificates\n\nThe following depencies are needed. Install the non-standard ones e.g. with pip or your system installation system.\n\nGeneral dependencies (from pypi)\n---------------------------------\n\n.. code-block:: bash\n\n numpy\n pyproj\n pyyaml\n toml\n f90nml\n\nTo read NetCDF files:\n\n.. code-block:: bash\n\n NetCDF4\n cfunits\n\nTo read grib files:\n\n.. code-block:: bash\n\n eccodes\n\nfrom ECMWF https://software.ecmwf.int/wiki/display/ECC/Releases installed with ENABLE_PYTHON=ON\n\nTo plot:\n\n.. code-block:: bash\n\n matplotlib\n\nTo get observations from frost.met.no API:\n\n.. code-block:: bash\n\n requests\n\nFor Quality control of observations\n\n.. code-block:: bash\n\n titanlib\n\nFor optimal interpolation and observation operators\n\n.. code-block:: bash\n\n gridpp\n\nFor testing:\n\n.. code-block:: bash\n\n pytest\n\n\nInstall pysurfex\n-------------------------------------------\n\nDownload the source code, then install ``pysurfex`` by executing the following inside the extracted\nfolder:\n\n.. code-block:: bash\n\n poetry install\n\n\nThis will install ``pysurfex`` in a poetry environment and this environment can be activated interactively by:\n\n.. code-block:: bash\n\n poetry shell\n\nor\n\nRun pysurfex client applications\n-------------------------------------------\n\n.. code-block:: bash\n\n poetry run [command]\n # e.g.\n poetry run python # will run python inside the pysurfex poetry environment\n\n\nRun pysurfex client applications\n-------------------------------------------\n.. code-block:: python\n\n import sys\n from pysurfex.cli import parse_args_surfex_binary, run_surfex_binary\n\n argv = sys.argv[1:]\n kwargs = parse_args_surfex_binary(argv, \"pgd\")\n run_surfex_binary(\"pgd\", **kwargs)\n\n\nExamples\n-----------------------\n\nSee https://metno.github.io/pysurfex/#examples\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python API to SURFEX",
"version": "0.0.4.1",
"project_urls": {
"Documentation": "https://metno.github.io/pysurfex/",
"Homepage": "https://github.com/metno/pysurfex",
"Repository": "https://github.com/metno/pysurfex"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "66d9a641d74c9af8b266213d9fd5eb2b7b89c0adb745c56514501476d59ac502",
"md5": "755682f966e870ffe956e74ff9161ae0",
"sha256": "7a1ee7d1bce51fa4493d8e42700c257dbc2c59bc2ce747423ea615109e8877f8"
},
"downloads": -1,
"filename": "pysurfex-0.0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "755682f966e870ffe956e74ff9161ae0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 159461,
"upload_time": "2023-05-31T17:26:45",
"upload_time_iso_8601": "2023-05-31T17:26:45.500016Z",
"url": "https://files.pythonhosted.org/packages/66/d9/a641d74c9af8b266213d9fd5eb2b7b89c0adb745c56514501476d59ac502/pysurfex-0.0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "473f6b15bd086ad6050ca12ed10629031c24a9009ea1c658cf7b62432ef3de33",
"md5": "5903f17049402d4224c62d30a13592bc",
"sha256": "514c4cc81fa2037cd3f12bea4b423289aa92147cdc455e0ade0b3e9920630a1f"
},
"downloads": -1,
"filename": "pysurfex-0.0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "5903f17049402d4224c62d30a13592bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 145939,
"upload_time": "2023-05-31T17:26:48",
"upload_time_iso_8601": "2023-05-31T17:26:48.510003Z",
"url": "https://files.pythonhosted.org/packages/47/3f/6b15bd086ad6050ca12ed10629031c24a9009ea1c658cf7b62432ef3de33/pysurfex-0.0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-31 17:26:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "metno",
"github_project": "pysurfex",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pysurfex"
}