Metview's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Metview's Python interface is currently available on internal ECMWF desktop machines and on the Member State server ecgate. It is not yet available for download.

Setup

To use it, you need three things:

  1. A Python 3 interpreter
  2. Metview 5 needs to be in your PATH
  3. Metview's Python module needs to be accessible from Python

So, to try it right now, do the following from a terminal:

module load python3/new
module swap metview/new
module load metview-python

Test it

Here's a quick Python program to check that it's working. Copy this into a file called test-metview.py

import metview as mv

# call Metview's built-in function to return a lower case string
print(mv.lowercase('Hello World!')) # should output "hello world!"

and run it like this:

python3 test-metview.py

If this works, then you have successfully set up Metview's Python interface!

Further reading

For a quick start, check out the Python Gallery.

To see the different environments you can write Metview Python scripts in, see Developing and Running Metview Python Scripts.

To understand what Metview's functions take as input and output in a Python environment, see Using Metview's Python Interface.

  • No labels