1. Installation
1.1. Installation guide for METplotpy
METplotpy is written entirely in Python and uses YAML configuration files and relies on the METcalcpy package. The version numbers (when provided) indicate the minimum version number for that package. Some plots may require additional packages that are not listed below.
1.1.1. Python Requirements
The requirements below come directly from the requirements.txt file at the top level of the repository.
imageio>=2.37.0
imutils>=0.5.4
kaleido>=0.2.1
matplotlib>=3.10.0
metpy>=1.6.3
netcdf4>=1.7.2
numpy>=2.2.2
opencv-python>=4.10.0
pandas>=2.2.3
pint>=0.24.4
plotly>=6.0.0
pytest>=8.3.4
pyyaml>=6.0.2
scikit-image>=0.25.1
scipy>=1.15.1
xarray>=2025.1.2
eofs>=2.0.0
cartopy>=0.24.0
scikit-learn>=1.6.1
cmocean>=4.0.3
1.1.2. Retrieve METplotpy Code
The METplotpy source code can be retrieved using the web browser. Begin by entering https://github.com/dtcenter/METplotpy in the web browser’s navigation bar. On the right-hand side of the web page for the METplotpy repository, click on the Releases link. This leads to a page where all available releases are available. The latest release will be located at the top of the page. Scroll to the release of interest and below it’s title is an Assets link in small text. Click on the inverted triangle to the left of the Assets text to access the menu. To download the source code, click on either the zip or tar.gz version of the source code and save it to a directory where the METplotpy source code will reside (e.g. /home/someuser/).
1.1.3. Install METplotpy in a conda environment
[Optional]
METplotpy can be installed into a conda environment. First navigate to the base directory, then run the following commands.
$ conda create -n "metplotpy" python=3.12 pip
$ conda activate metplotpy
(metplotpy)$ pip install -e .
This will install METplotpy into the conda env, along with all the dependancies listed above in requirements.txt.
If you already have an environment setup, or want to install METplotpy without the dependancies, add the –no-deps argument to pip.
$ pip install -e . --no-deps
1.1.4. Install METcalcpy in the Conda Environment
This is the recommended method for installation.
Clone the METcalcpy repository from GitHub.
From within the active conda environment, change directories to the METcalcpy directory. This is the directory where the METcalcpy repository was cloned. In this directory, find the setup.py script.
From the command line run:
pip install -e .
Do NOT forget the ending period ‘.’ This indicates the setup.py is being used in the current working directory.
The -e option allows this installation to be editable, which is useful if the METcalcpy/metcalcpy source code needs updating. Using the -e option will avoid the need to reinstall if any changes are made to the METcalcpy code.
1.1.5. Setting up the PYTHONPATH
This is a workaround for users who can not or do not have permission to create conda environments.
$METCALCPY_SOURCE is the path downloaded/cloned METcalcpy code. $METPLOTPY_SOURCE is the path of the downloaded/cloned METplotpy code.
Command for csh:
setenv PYTHONPATH $METCALCPY_SOURCE/METcalcpy:$METCALCPY_SOURCE/METcalcpy/util:$METPLOTPY_SOURCE/METplotpy${PYTHONPATH}
Command for bash:
export PYTHONPATH=\
$METCALCPY_SOURCE/METcalcpy:$METCALCPY_SOURCE/METcalcpy/util:$METPLOTPY_SOURCE/METplotpy${PYTHONPATH}
1.1.6. Overview of Plots
The plots in the METplotpy repository reside under one of two directories: METplotpy/metplotpy/contributed or METplotpy/metplotpy/plots.
The plots under the METplotpy/metplotpy/contributed directory correspond to plots that were either created prior to the creation of the METplotpy repository, and/or developed outside of the DTC.
The plots that reside in the METplotpy/metplotpy/plots directory were developed by the DTC and were primarily created to replace the R script implementation of plotting done in METviewer. These plots were written using Python plotly, with the exception of the performance diagram, which was written using Matplotlib. The plots in the contributed directory may have different Python and third party Python package requirements that differ from the packages and versions specified in the Section 1.1.1 section.