METplus Practical Session Guide (July 2019) | Session 5: Trk&Int/Feature Relative > Use Case: Track and Intensity

METplus Use Case: Track and Intensity TCMPR (Tropical Cyclone Matched Pair) Plotter

This is a wrapper to the MET plot_tcmpr.R Rscript.

Setup

Create Custom Configuration File

Define a unique directory under output that you will use for this use case. Create a configuration file to override OUTPUT_BASE to that directory.

vi ${METPLUS_PARM_BASE}/user_config/track_and_intensity.output.conf

Set OUTPUT_BASE to contain a subdirectory specific to the Track and Intensity use case. Make sure to put it under the [dir] section.

[dir]
OUTPUT_BASE = {ENV[METPLUS_TUTORIAL_DIR]}/output/track_and_intensity

Using this custom configuration file and the Track and Intensity use case configuration files that are distributed with METplus, you should be able to run the use case using the sample input data set without any other changes.

Review: Take a look at the following settings.

The default image resolution for the plot_tcmpr.R Rscript is set to 300, for print quality, but quite large for display purposes. The following is an R config file that is passed to the Rscript and changes the default and reduces the image size. It is a simple one line file, but go and take a look.

less ${METPLUS_PARM_BASE}/use_cases/model_applications/tc_and_extra_tc/TCMPRPlotterConfig_customize

The plot_tcmpr.R script knows to read this tcmpr_customize.conf R config file since it is defined in the track_and_intensity.conf file.

less ${METPLUS_PARM_BASE}/use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_RPlotting.conf
CONFIG_FILE = {PARM_BASE}/use_cases/model_applications/tc_and_extra_tc/TCMPRPlotterConifg_customize   Note: If you modify the CONFIG_FILE variable and leave it undefined (not set) CONFIG_FILE = , then no configuration file will be read by the R script and the default setting of 300 will be usede

These are some common settings for the track and intensity use case. These have already been defined in the track_and_intensity.conf file. If desired or needed, these can be overridden in this track and intensity use case conf files

TCMPR_PLOT_OUT_DIR - directory where the final plots will be stored. 
TCMPR_DATA - the path to the input data, in this example, we are using the data in the TC_PAIRS_DIR directory. 
MODEL_DATA_DIR - path to the METplus input data. 
TRACK_DATA_DIR - path to the METplus input data.

Optional, Refer to the TC-Stat tool example section of the MET Users Guide for a description of plot_tcmpr.R 
If you wish, refer to Table 19.2 Format Information for TCMPR output line type, for a tabular description of the TC-Pairs output TCST format. After running this Track and Intensity example, you can view the TC-Pairs TCST output files generate by this example under your ${METPLUS_TUTORIAL_DIR}/output/track_and_intensity/tc_pairs directory while comparing to the information in the table.

The tcmpr defaults are used for any conf settings left as, unset, For example as: XLAB = 
The current settings in the conf files are ok and no changes are required.
 However, after running the exercise feel free to experiment with these settings.

The R script that Track and Intensity runs is located in the MET installation; share/met/Rscripts/plot_tcmpr.R. The usage statement with a short description of the options for plot_tcmpr.R can be obtained by typing: Rscript plot_tcmpr.R with no additional arguments. The usage statement can be helpful when setting some of the option in METplus, below is a description of these settings. 

  • CONFIG_FILE is a plotting configuration file 
    PREFIX is the output file name prefix. 
    TITLE overrides the default plot title. Bug: CAN_NOT_HAVE_SPACES 
    SUBTITLE overrides the default plot subtitle. 
    XLAB overrides the default plot x-axis label. 
    YLAB overrides the default plot y-axis label. 
    XLIM is the min,max bounds for plotting the X-axis. 
    YLIM is the min,max bounds for plotting the Y-axis. 
    FILTER is a list of filtering options for the tc_stat tool. 
    FILTERED_TCST_DATA_FILE is a tcst data file to be used instead of running the tc_stat tool. 
    DEP_VARS is a comma-separated list of dependent variable columns to plot. 
    SCATTER_X is a comma-separated list of x-axis variable columns to plot. 
    SCATTER_Y is a comma-separated list of y-axis variable columns to plot. 
    SKILL_REF is the identifier for the skill score reference. 
    LEGEND is a comma-separted list of strings to be used in the legend. 
    LEAD is a comma-separted list of lead times (h) to be plotted. 
    RP_DIFF is a comma-separated list of thresholds to specify meaningful differences for the relative performance plot. 
    DEMO_YR is the demo year 
    HFIP_BASELINE is a string indicating whether to add the HFIP baseline and which version (no, 0, 5, 10 year goal) 
    FOOTNOTE_FLAG to disable footnote (date). 
    PLOT_CONFIG_OPTS to read model-specific plotting options from a configuration file. 
    SAVE_DATA to save the filtered track data to a file instead of deleting it. 
    PLOT_TYPES

    • is a comma-separated list of plot types to create: 
      BOXPLOT, POINT, MEAN, MEDIAN, RELPERF, RANK, SKILL_MN, SKILL_MD 
      -for this example, set to MEAN,MEDIAN to generate MEAN and MEDIAN plots.

    SERIES

    • is the column whose unique values define the series on the plot, 
      optionally followed by a comma-separated list of values, including: 
      ALL, OTHER, and colon-separated groups.

    SERIES_CI

    • is a list of true/false for confidence intervals.
      optionally followed by a comma-separated list of values, including: 
      ALL, OTHER, and colon-separated groups.

Run METplus: Run Track and Intensity use case.

Examples: Run the track and intensity plotting script
Generates plots using the MET plot_tcmpr.R Rscript.

Example: 
In this case we are generating the BOXPLOT, MEAN, and MEDIAN plots.
Run the following command:

master_metplus.py -c use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_Rplotting.conf -c user_config/track_and_intensity.output.conf

The following directory lists the files generated from running these use cases:

ls ${METPLUS_TUTORIAL_DIR}/output/track_and_intensity/tcmpr_plots
AMAX_WIND-BMAX_WIND_mean.png 
AMAX_WIND-BMAX_WIND_median.png 
AMSLP-BMSLP_mean.png 
AMSLP-BMSLP_median.png 
TK_ERR_boxplot.png 
TK_ERR_boxplot.log 
TK_ERR_mean.png 
TK_ERR_median.png

To view the images generated by running these examples, use the display command. 
cd to your OUTPUT_BASE/tcmpr_plots directory, depending on your setting it may be here.

cd ${METPLUS_TUTORIAL_DIR}/output/track_and_intensity/tcmpr_plots
display AMAX_WIND-BMAX_WIND_mean.png