pyfesom2
workflow test
[](https://travis-ci.org/koldunovn/pyfesom2) [](https://pyfesom2.readthedocs.io/en/latest/?badge=latest) [](https://mybinder.org/v2/gh/FESOM/pyfesom2/HEAD)
FESOM2 tools
Free software: MIT license
Documentation: https://pyfesom2.readthedocs.io.
Installation
Currently the easiest way is to use conda. The short guide how to install it can be found for [Linux/Mac](https://github.com/koldunovn/python_for_geosciences/blob/master/README.md#getting-started-for-linuxmac) and [Windows](https://github.com/koldunovn/python_for_geosciences/blob/master/README.md#getting-started-for-windows). For now we are not testing for Windows, and there is no garantee that pyfesom2 will work on this OS.
The easiest way is to install latest stable version from conda-forge:
conda config –add channels conda-forge conda install pyfesom2
Development Installation
If you plan to change the code inside the package, you have to install it in “development” mode. For this you would also need a working conda. The short guide how to install it can be found for [Linux/Mac](https://github.com/koldunovn/python_for_geosciences/blob/master/README.md#getting-started-for-linuxmac) and [Windows](https://github.com/koldunovn/python_for_geosciences/blob/master/README.md#getting-started-for-windows). After you install conda (python 3.7 environment is recomendes), clone the source code:
git clone https://github.com/FESOM/pyfesom2.git
Create pyfesom2 environment by:
conda env create -f ./pyfesom2/ci/requirements-py37.yml
Activate the environment
conda activate pyfesom2
Install pyfesom2
cd pyfesom2 pip install -e .
Troubleshooting
There is a bug in cartopy, that lead to strange looking figures - giving you instead of land fill a river network: 
To fix it one should download GSHHS files by hand, from [here](https://swift.dkrz.de/v1/dkrz_c719fbc3-98ea-446c-8e01-356dac22ed90/cartopy/shapefiles.tar) and untar them into ~.local/share/cartopy/shapefiles/ directory. As a result your plotting scripts should produce something like this:

Usage of tools
Below are couple of examples of CLI tools usage. For now two tools are available: pfplot (plot variable on the map) and pfinterp (interpolate scalar values to regular grid). You can get complete list of options by executing:
pfplot -h
To plot temperature field one can do:
pfplot ./CORE_MESH/ ./CORE_out/ temp
where ./CORE_MESH is path to the mesh, ./CORE_out/ is path to the folder with results and temp is the name of the variable. By defauld pfplot will try to plot the mean values from the year 1948 at the surface (0 depth) on a global 360/180 map. Make sure you have write permissions to the folder with the mesh, since pfplot will save interpolation information, so next time it is not calculated but just loaded from the file.
To plot the different year:
pfplot ./CORE_MESH/ ./CORE_out/ temp -y 2000
Plot different depth:
pfplot ./CORE_MESH/ ./CORE_out/ temp -y 2000 -d 100
Plot mean over several years:
pfplot ./CORE_MESH/ ./CORE_out/ temp -y 1948,1949,1950
Plot mean over several years by specifying the range:
pfplot ./CORE_MESH/ ./CORE_out/ temp -y 1948:1955
Plot with North Polar Stereo projection (you have to specify different bounding box with -b)
pfplot ./CORE_MESH/ ./CORE_out/ temp -y 2000 -b -180 180 60 90 -m np
Features
TODO
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.2.0 (2020-08-05)
Breaking changes
depricate plot_transect and hofm_plot functions. Replaced with more general plot_xyz function.
replace transect_uv with get_transect_uv.
remove Basemap dependency and all code related to Basemap.
New Features
plot_vector - plotting vector on a map.
plot_xyz - ploting, for example, transect or hovmoeller diagrams.
get_transect - returns the data for transect, that then should be used with plot_xyz to plot.
tplot - plotting on original FESOM mesh, without interpolation.
compute_face_coords - compute coordinates (centers) of elements (triangles).
cut_region - cut region from the mesh.
xmoc_data - compute moc for selected region
get_mask - create mask of the region (e.g. Atlantic or Pacific Ocean).
Bug fixes
fix get_cmap to cpmply with new matplotlib versions.
fix RTD builds on master (by Suvarchal Kumar Cheedela).
fix issue with time module change after python 3.7 (by Paul Gierz)
Documentation
Notebook example for vector plotting.
Notebook example for plotting on original mesh with``tplot``.
Notebook example for very fast plotting with geoviews .
Notebook example for xMOC plotting.
Internal Changes
general cleaning up of the code
split plot function to make it more readable.
refactor tonodes function, allow xarray in tonodes3d
add tests for transects.
0.1.1 (2019-02-12)
Fixes for PyPI
0.1.0 (2019-02-12)
First release on PyPI.
Metadata
Release files for pyfesom2 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyfesom2-0.4.1.tar.gz | 9.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyfesom2-0.4.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 11.0 MB
Release files / pyfesom2-0.4.1.tar.gz
| Download URL | pyfesom2-0.4.1.tar.gz |
|---|---|
| Size | 9.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6235921ac0659cd2324c7f84fce7318b6936ee304b97297966b7c56262a59b53
|
|
BLAKE2b-256 checksum How to use checksums |
c5faf56788274f7c35b78ec80a7f0da5751b1e11f9d93c9448003df499423c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 2, 2025.
Transparency logRelease files / pyfesom2-0.4.1-py2.py3-none-any.whl
| Download URL | pyfesom2-0.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7aef996163ea151eac99efa0ccadaf1fd6c1f2b6a444b65235dc34d3ab9da0bd
|
|
BLAKE2b-256 checksum How to use checksums |
c9d5613b2d9bff4282affee27d0007b6f2fc0ba4d668b53def0260743d51c9c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 2, 2025.
Transparency log