METplus Use Case: Track and Intensity TCMPR (Tropical Cyclone Matched Pair) Plotter
This is a wrapper to the MET plot_tcmpr.R Rscript.
Based on your current mycustom.conf file settings you previously made, the track and intensity use cases should be able to run right now on the sample input data set dates. However, it is prudent to check the current use case you are about to run to make certain there are no unintended overriding settings. For example, do you have an unintended PROCESS_LIST setting that needs to be commented out, or is your OUTPUT_BASE set to a new location so you don't overwrite any previous output. Also, we are going to discuss an additional configuration file that is used to override the Rscripts default image size that will be generated.
Setup
Lets start by defining where to send the output by setting the OUTPUT_BASE configuration variable.
Edit Custom Configuration File
Define a unique directory under output that you will use for this use case.
Edit ${HOME}/METplus/parm/mycustom.conf
Change OUTPUT_BASE to contain a subdirectory specific to the Track and Intensity use case.
... other entries ...
OUTPUT_BASE = {ENV[HOME]}/metplus_tutorial/output/track_and_intensity
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.
cat tcmpr_customize.conf
The plot_tcmpr.R script knows to read this tcmpr_customize.conf R config file since it is defined in METplus use case track_and_intensity.conf file as follows.
view the track_and_intensity.conf under the [config] section, with the following change.
NOTE: If you modify the CONFIG_FILE variable and leave it undefined (not set) CONFIG_FILE = , than no configuration file will be read by the R script and the default setting of 300 will be used.
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 intesity use case conf files
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 section21.2.3 TC-Stat tool example 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 $HOME/METplus/metplus_tutorial/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.
- is a comma-separated list of plot types to create:
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 1:
In this case, the track_and_intensity.conf file PLOT_TYPES is left unset, so the default BOXPLOT will be used.
Run the following command:
Example 2:
In this case, the tcmpr_mean_median.conf file PLOT_TYPES overrides the setting in track_and_intensity.conf to generate the MEAN,MEDIAN plots.
Run the following command:
The following directory lists the files generated from running these use cases:
AMAX_WIND-BMAX_WIND_median.png
AMSLP-BMSLP_mean.png
AMSLP-BMSLP_median.png
TK_ERR_boxplot.png
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.
display AMAX_WIND-BMAX_WIND_mean.png