MET Users Page

Sample MET Analysis Scripts

This page provides sample scripts that may be run on MET output files to analyze, summarize, and/or plot the data. Feel free to modify these sample scripts to perform the type of analysis you need.

Users are encouraged to submit their own analysis scripts via met_help@ucar.edu to be posted on this page.

Python Scripts

MET version 8.0 includes support for passing data to the MET tools in memory as described in Appendix F of the MET User's Guide. Listed below are examples of using Python to pass data (ASCII, NetCDF, and Binary) to MET's plot_data_plane utility:

R Scripts

R is an extremely powerful statistical analysis and graphics package freely available for many platforms.

NOTE: The scripts provided below are meant purely as examples of using R to read and plot output from MET. Users are strongly encouraged to adapt these scripts for their own needs.

  • Point-Stat and Grid-Stat Output:
    • The plot_mpr.R script may be run to read matched pair (MPR) output lines from Point-Stat and generate histograms, scatter plots, and q-q plots. You may pass this script one or more ".stat" files, matched pair files (*_mpr.txt), or the output of a Stat-Analysis filter type job.
      This sample PDF contains plots generated by running this script on the output of the Point-Stat test script.
    • The plot_cnt.R script may be run to read continuous statistics (CNT) output lines from Point-Stat and Grid-Stat. By default, it will create boxplots and time series plots of RMSE for each case. But a command line argument may be used to specify other CNT statistics to be plotted. You may pass this script one or more ".stat" files, continuous statistics files (*_cnt.txt), or the output of a Stat-Analysis filter type job.
      This sample PDF contains plots generated by running this script.
  • MODE Output:
    • The mode_summary.R script may be run to summarize the object statistics files from one or more MODE runs. The script keeps running sums of the counts and areas for the matched/unmatched forecast/observation objects. For each simple object identified, the script records its maximum interest value. It then dumps out the median value of those maximum interest values found.
      This sample output summarizes a single MODE run.
    • The mode_quilt_plot.R script may be run to generate a quilt plot summarizing MODE output for several scales. A quilt plot may be generated when a single case is run using a variety of choices of convolution radii and thresholds. A quilt plot is an image where each box represents a summary measure of MODE for a given choice of radius and threshold.
      The quilt plots shown in this sample PDF were generated by running the same case through MODE applying combinations of 29 different convolution radii and 30 different convolution thresholds.