...
Code Block | ||
---|---|---|
| ||
export LD_LIBRARY_PATH=$ECCODES_LIB_DIR:$LD_LIBRARY_PATH |
Test it
To check that Metview's binary and Python parts can communicate with each other, type this
Code Block |
---|
python3 -m metview selfcheck |
Here's a quick Python program to check that it's working. Copy this into a file called test-metview.py
Code Block | ||
---|---|---|
| ||
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!" |
...
If this works, then you have successfully set up Metview's Python interface!
Need more output?
Set the following environment variable before starting your Python interpreter, and you will see much more output from Metview:
Code Block |
---|
export METVIEW_PYTHON_START_CMD=1 |
Further reading
For a quick start, check out some of the examples in the Gallery. Most, but not all, of them They all have Python code, but all of them can be written in Python.and each contains a tarball containing its code and data.
Look at the Jupyter notebooks in the examples folder on github for more inspiration!
To see the different environments you can write Metview Python scripts in, see Developing and Running Metview Python Scripts.
...