METplus Setup
METplus SetupMETplus Overview
METplus is a set of Python modules that have been developed with the flexibility to run the MET applications for various use cases or scenarios. The goal is to simplify the running of MET for scientists. Currently, the primary means of achieving this is through the use of METplus configuration files, aka "conf files." It is designed to provide a framework in which additional use cases can be added. The conf file implementation utilizes a Python package called produtil that was developed by NOAA/NCEP/EMC for the HWRF system.
Please be sure to follow the instructions in order.
METplus Useful Links
The following links are just for reference, and not required for this practical session. METplus releases are available on GitHub along with sample data and instructions.
The source code for the METplus components are publicly available in the following GitHub repositories:
- https://github.com/dtcenter/METplus - Python wrappers and use cases
- https://github.com/dtcenter/MET - Core MET codebase
- https://github.com/dtcenter/METdataio - Database system for MET output
- https://github.com/dtcenter/METplotpy - Python plotting scripts
- https://github.com/dtcenter/METcalcpy - Python calculation functions
- https://github.com/dtcenter/METviewer - Display system for MET output
- https://github.com/dtcenter/METexpress - Streamlined display system
New features are developed and bugs are tracked using GitHub issues in each repository.
METplus: Initial setup
METplus: Initial setupPrerequisites: Software
The Requirements section in the Software Installation chapter of the METplus User's Guide lists the software and Python packages that are required to run the METplus wrappers. Note that there is a core set of requirements needed to run the METplus wrappers and additional requirements needed to utilize some of the more advanced features.
Prerequisites: Environment
The following instructions are required so the commands in this tutorial can be copied and run without modification. The steps involve creating a working directory to store files used/generated by the tutorial and configuring a simple script that can be run to set up the shell environment. Once configured correctly, the script can be run upon returning to the tutorial content to easily resume progress.
Pre-Configured Environments
Setting up the Tutorial Environment on Hera (NOAA)
Setting up the Tutorial Environment on Jet (NOAA)
Setting up the Tutorial Environment on Cheyenne (NCAR)
Setting up the Tutorial Environment on Seneca (NCAR)
User Configured Environments
Setting up the Tutorial Environment (bash)
Setting up the Tutorial Environment (csh)
Setting up the Tutorial Environment on Cheyenne (NCAR)
Setting up the Tutorial Environment on Cheyenne (NCAR)Setting up the Tutorial Environment on Cheyenne (NCAR)
The following instructions should be run if configuring the shell environment to run the METplus Tutorial on Cheyenne (NCAR). If you are running on your own computer or a NOAA machine that has been set up to run the tutorial, please go back and click the appropriate link for those instructions.
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
DO NOT RUN BOTH SETS OF COMMANDS.
If you are unsure which shell you are using, run the command "echo $SHELL" to check.
Setting up the Tutorial Environment on Jet (NOAA)
Setting up the Tutorial Environment on Jet (NOAA)Setting up the Tutorial Environment on Jet (NOAA)
The following instructions should be run if configuring the shell environment to run the METplus Tutorial on Jet (NOAA). If you are running on your own computer or an NCAR machine that has been set up to run the tutorial, please go back and click the appropriate link for those instructions.
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
cp /lfs1/HFIP/dtc-hurr/METplus/METplus-5.0.0_Tutorial_Files/tutorial-5.0.0.conf ./tutorial.conf
Setting up the Tutorial Environment on Seneca (NCAR)
Setting up the Tutorial Environment on Seneca (NCAR)Setting up the Tutorial Environment on Seneca (NCAR)
The following instructions should be run if configuring the shell environment to run the METplus Tutorial on Seneca (NCAR). If you are running on your own computer or a NOAA machine that has been set up to run the tutorial, please go back and click the appropriate link for those instructions.
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
(OPTIONAL) Set up conda Environment for METplus Analysis and s2s Tutorial Sections
Due to the need for external package dependencies for the METplus Analysis and s2s sections, the following instructions are also necessary. If you do not plan on executing the commands of those sections, you can skip these steps.
First, ensure that you are running the bash environment:
Now, verify that you have a .condarc file in your /home/user directory. If the file does not exist, create one. In that file, you will need the following entries, in the exact same format (dashes and colons):
- defaults
- conda-forge
- anaconda
Verify that you are using the most recent version of anaconda3 in your .bashrc file. Verify that your conda_setup in your .bashrc file is using /usr/local/anaconda3/bin/conda. You should see a code block similar to following:
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/anaconda3/bin/conda' 'shell.bash' 'hook'2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/local/anaconda3/etc/profile.d/conda.sh" ]; then
. "/usr/local/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/usr/local/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
If you do have to make any changes to your .bashrc file, it would be best at this point to sign out, then sign back into your Seneca connection from the terminal. Errors have been found to happen even after sourcing your .bashrc file for the updated content.
From the command line, enter the following:
mamba -y
If this was successful, you will see the following at the end of the output streamed to the screen:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate metplus_analysis_tutorial_env
#
# To deactivate an active environment, use
#
# $ conda deactivate
This creates a basic Python 3.8 conda environment named ‘metplus_analysis_tutorial_env’ that contains mamba (to accelerate installing the remaining Python packages).
Activate this environment by running the following from the command line:
Install the following packages to the conda environment by running the following from the command line (using mamba to speed up the installation):
You will see many lines of information streaming to your screen. You will see following output to your screen if everything was successful:
Verifying transaction: done
Executing transaction: /
Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
More details are available here: https://intel.github.io/scikit-learn-intelex
For example:
$ conda install scikit-learn-intelex
$ python -m sklearnex my_application.py
done
Now you are ready to run the METplus Analysis tutorials.
Setting up the Tutorial Environment on Hera (NOAA)
Setting up the Tutorial Environment on Hera (NOAA)Setting up the Tutorial Environment on Hera (NOAA)
The following instructions should be run if configuring the shell environment to run the METplus Tutorial on Hera (NOAA). If you are running on your own computer or an NCAR machine that has been set up to run the tutorial, please go back and click the appropriate link for those instructions.
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
cp /scratch1/BMC/dtc/METplus/METplus-5.0.0_Tutorial_Files/tutorial-5.0.0.conf ./tutorial.conf
Setting up the Tutorial Environment (bash)
Setting up the Tutorial Environment (bash)Setting up the Tutorial Environment (bash)
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
wget https://dtcenter.org/sites/default/files/community-code/metplus/tutorial-data/tutorial-5.0.0.conf -O ./tutorial.conf
Configure the Tutorial Setup Script
MET_BUILD_BASE is the full path to the MET installation (/path/to/met-X.Y)
METPLUS_DATA is the location of the sample test data directory
Setting up the Tutorial Environment (csh)
Setting up the Tutorial Environment (csh)Setting up the Tutorial Environment (csh)
Create a Working Directory
Create a directory called 'METplus-5.0.0_Tutorial' to hold all of the files you will create during the tutorial. This can be any directory that you have write permission.
Create Directories for Configuration Files and Output Data
mkdir output
Obtain the Tutorial Setup Script
wget https://dtcenter.org/sites/default/files/community-code/metplus/tutorial-data/tutorial-5.0.0.conf -O ./tutorial.conf
Configure the Tutorial Setup Script
MET_BUILD_BASE is the full path to the MET installation (/path/to/met-X.Y)
METPLUS_DATA is the location of the sample test data directory
Verify Environment is Set Correctly
Verify Environment is Set CorrectlyVerify Environment is Set Correctly
Run the Tutorial Setup Script
source METplus-5.0.0_TutorialSetup.sh
The tutorial setup script sets the paths for METPLUS_TUTORIAL_DIR, METPLUS_BUILD_BASE, MET_BUILD_BASE, and METPLUS_DATA. It also appends the $PATH environment variable to include the directory where the METplus scripts are located. If necessary, it may also load modules needed for the METplus software to run correctly.
Check Path
Make sure that all of the environment variables are set to the appropriate values and that the path is set up to locate the METplus components.
You should see the usage statement for Point-Stat. The version number listed should correspond to the version listed in MET_BUILD_BASE. If it does not, you will need to either reload the met module, or add ${MET_BUILD_BASE}/bin to your PATH.
$METPLUS_TUTORIAL_DIR
The directory you created to store all of your tutorial files
Example value:
Example contents:
output/
tutorial.conf
user_config/
$MET_BUILD_BASE
The directory where MET is installed
Example value:
Example contents
share
Check contents of MET bin directory
Example contents:
ensemble_stat
gen_ens_prod
gen_vx_mask
gis_dump_dbf
gis_dump_shp
gis_dump_shx
grid_diag
grid_stat
gsid2mpr
gsidens2orank
ioda2nc
lidar2nc
madis2nc
mode
mode_analysis
modis_regrid
mtd
pb2nc
pcp_combine
plot_data_plane
plot_mode_field
plot_point_obs
point2grid
point_stat
regrid_data_plane
rmw_analysis
series_analysis
shift_data_plane
stat_analysis
tc_dland
tc_gen
tc_pairs
tc_rmw
tc_stat
wavelet_stat
wwmca_plot
wwmca_regrid
$METPLUS_BUILD_BASE
The directory where METplus is installed
Example value:
Example contents:
docs
environment.yml
internal
manage_externals
metplus
parm
produtil
pyproject.toml
README.md
requirements.txt
setup.py
ush
$METPLUS_DATA
The directory containing sample input data to use for the tutorial
Example value:
Example contents:
met_test
model_applications