5.2.11.6. Track and Intensity Plotter: Generate mean, median and box plots

model_applications/tc_and_extra_tc/Plotter_fcstGFS _obsGFS_RPlotting.conf

Scientific Objective

By maintaining focus of each evaluation time on a user-defined area around a cyclone, the model statistical errors associated with cyclonic physical features (moisture flux, stability, strength of upper-level PV anomaly and jet, etc.) can be related directly to the model forecasts and provide improvement guidance by accurately depicting interactions with significant weather features around and within the cyclone. This is in contrast to the traditional method of regional averaging cyclone observations in a fixed grid, which “smooths out” system features and limits the meaningful metrics that can be gathered. This use case relays the mean and median of forecast lead times for cyclone position compared to a reference dataset via boxplot.

Datasets

  • Forecast dataset: ADeck ATCF tropical cyclone data

  • Observation dataset: BDeck ATCF tropical cyclone “best track” cyclone data

METplus Components

This use case first runs TCPairs and then generates the requested plot types for statistics of interest. The TCMPRPlotterConfig_customize configuration file is used by the plot_tcmpr.R script to select things such as the size of the plot window that appears on your screen, etc.

METplus Workflow

The following tools are used for each run time:

TCPairs > plot_tcmpr.R

To generate TCPairs output, this example loops by initialization time for every 6 hour period that is available in the data set for 20141214. The output is then used to generate the mean, median, and box plot for the following: the difference between the MSLP of the Adeck and Bdeck tracks (AMSLP-BMSLP), the difference between the max wind of the Adeck and Bdeck tracks (AMAX_WIND-BMSLP), and the track err (TK_ERR).

METplus Configuration

METplus first loads all of the configuration files found in parm/metplus_config, then it loads any configuration files passed to METplus via the command line with the -c option, i.e. -c parm/use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_RPlotting.conf

#
#   PRECONDITION: REQUIRES INSTALLATION OF R on user system
#

#
#  CONFIGURATION
#
[config]

# Loop over each process in the process list (set in PROCESS_LIST) for all times in the time window of
# interest.
LOOP_ORDER = processes
# Configuration files
TC_PAIRS_CONFIG_FILE = {PARM_BASE}/met_config/TCPairsConfig_wrapped

PROCESS_LIST = TCPairs, TCMPRPlotter


# The init time begin and end times, increment
LOOP_BY = INIT
INIT_TIME_FMT = %Y%m%d
INIT_BEG = 20141214
INIT_END = 20141214

# This is the step-size. Increment in seconds from the begin time to the end
# time
INIT_INCREMENT = 21600 ;; set to every 6 hours=21600 seconds

# A list of times to include, in format YYYYMMDD_hh
INIT_INCLUDE =

# A list of times to exclude, in format YYYYMMDD_hh
INIT_EXCLUDE =

#
# Specify model valid time window in format YYYYMM[DD[_hh]].  Only tracks
# that fall within the valid time window will
# be used.
#
VALID_BEG =
VALID_END =

##
#
# MET TC-Pairs
#
##

#
# Run MET tc_pairs by indicating the top-level directories for the A-deck
# and B-deck files. Set to 'yes' to run using top-level directories, 'no'
# if you want to run tc_pairs on files paired by the wrapper.
TC_PAIRS_READ_ALL_FILES = no

# List of models to be used (white space or comma separated) eg: DSHP, LGEM, HWRF
# If no models are listed, then process all models in the input file(s).
MODEL =

# List of storm ids of interest (space or comma separated) e.g.: AL112012, AL122012
# If no storm ids are listed, then process all storm ids in the input file(s).
TC_PAIRS_STORM_ID =

# Basins (of origin/region).  Indicate with space or comma-separated list of regions, eg. AL: for North Atlantic,
# WP: Western North Pacific, CP: Central North Pacific, SH: Southern Hemisphere, IO: North Indian Ocean, LS: Southern
# Hemisphere
TC_PAIRS_BASIN =

# Cyclone, a space or comma-separated list of cyclone numbers. If left empty, all cyclones will be used.
TC_PAIRS_CYCLONE =

# Storm name, a space or comma-separated list of storm names to evaluate.  If left empty, all storms will be used.
TC_PAIRS_STORM_NAME =

# DLAND file, the full path of the file that contains the gridded representation of the
# minimum distance from land.
TC_PAIRS_DLAND_FILE = {MET_INSTALL_DIR}/share/met/tc_data/dland_global_tenth_degree.nc

TC_PAIRS_REFORMAT_DECK = yes
TC_PAIRS_REFORMAT_TYPE = SBU

TC_PAIRS_MISSING_VAL_TO_REPLACE = -99
TC_PAIRS_MISSING_VAL = -9999


#  Plot_TCMPR options, if left unset, default values that are
#  pre-defined in the R utility (packaged with MET) will be used.
TCMPR_PLOTTER_CONFIG_FILE = {CONFIG_DIR}/TCMPRPlotterConfig_customize
TCMPR_PLOTTER_PREFIX =
TCMPR_PLOTTER_TITLE =
TCMPR_PLOTTER_SUBTITLE = Your subtitle goes here
TCMPR_PLOTTER_XLAB =
TCMPR_PLOTTER_YLAB = Your y-label goes here
TCMPR_PLOTTER_XLIM =
TCMPR_PLOTTER_YLIM =
TCMPR_PLOTTER_FILTER =
# the tcst data file to be used instead of running the MET tc_stat tool.
TCMPR_PLOTTER_FILTERED_TCST_DATA_FILE =
# Comma separated, no whitespace.  Default is TK_ERR (track error) unless
# otherwise indicated.
TCMPR_PLOTTER_DEP_VARS =AMSLP-BMSLP, AMAX_WIND-BMAX_WIND, TK_ERR
TCMPR_PLOTTER_SCATTER_X =
TCMPR_PLOTTER_SCATTER_Y =
TCMPR_PLOTTER_SKILL_REF =
TCMPR_PLOTTER_SERIES =
TCMPR_PLOTTER_SERIES_CI =
TCMPR_PLOTTER_LEGEND = Your legend text goes here...
TCMPR_PLOTTER_LEAD =
# Mean and median plots. These override the plot_tcmpr.R default of box plot.
# If box plot is desired, this needs to be explicitly indicated.
TCMPR_PLOTTER_PLOT_TYPES = MEAN,MEDIAN,BOXPLOT
TCMPR_PLOTTER_RP_DIFF =
TCMPR_PLOTTER_DEMO_YR =
TCMPR_PLOTTER_HFIP_BASELINE =
TCMPR_PLOTTER_FOOTNOTE_FLAG =
TCMPR_PLOTTER_PLOT_CONFIG_OPTS =
TCMPR_PLOTTER_SAVE_DATA =

#  TCMPR FLAGS no == (don't set flag), yes == (set flag)
TCMPR_PLOTTER_NO_EE = no
TCMPR_PLOTTER_NO_LOG = no
TCMPR_PLOTTER_SAVE = no


# OVERWRITE OPTIONS
# Don't overwrite filter files if they already exist.
# Set to no if you do NOT want to override existing files
# Set to yes if you do want to override existing files

# overwrite modified track data (non-ATCF to ATCF format)
TC_PAIRS_SKIP_IF_REFORMAT_EXISTS = yes

# overwrite tc_pairs output
TC_PAIRS_SKIP_IF_OUTPUT_EXISTS = yes

#  FILENAME TEMPLATES
#
[filename_templates]
# Define the format of the filenames

TC_PAIRS_ADECK_TEMPLATE = {date?fmt=%Y%m}/a{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s}
TC_PAIRS_BDECK_TEMPLATE = {date?fmt=%Y%m}/b{basin?fmt=%s}q{date?fmt=%Y%m}*.gfso.{cyclone?fmt=%s}
TC_PAIRS_OUTPUT_TEMPLATE = {date?fmt=%Y%m}/{basin?fmt=%s}q{date?fmt=%Y%m%d%H}.gfso.{cyclone?fmt=%s}

#
#  DIRECTORIES
#
[dir]

CONFIG_DIR = {PARM_BASE}/use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_RPlotting

# track data, set to your data source
TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/model_applications/medium_range/track_data
TC_PAIRS_BDECK_INPUT_DIR = {TC_PAIRS_ADECK_INPUT_DIR}
TC_PAIRS_REFORMAT_DIR = {OUTPUT_BASE}/track_data_atcf
TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs

TCMPR_PLOTTER_TCMPR_DATA_DIR = {TC_PAIRS_OUTPUT_DIR}
TCMPR_PLOTTER_PLOT_OUTPUT_DIR = {OUTPUT_BASE}/tcmpr_plots

MET Configuration

METplus sets environment variables based on user settings in the METplus configuration file. See How METplus controls MET config file settings for more details.

YOU SHOULD NOT SET ANY OF THESE ENVIRONMENT VARIABLES YOURSELF! THEY WILL BE OVERWRITTEN BY METPLUS WHEN IT CALLS THE MET TOOLS!

If there is a setting in the MET configuration file that is currently not supported by METplus you’d like to control, please refer to: Overriding Unsupported MET config file settings

Note

See the TCPairs MET Configuration section of the User’s Guide for more information on the environment variables used in the file below:

////////////////////////////////////////////////////////////////////////////////
//
// Default TCPairs configuration file
//
////////////////////////////////////////////////////////////////////////////////

//
// ATCF file format reference:
//   http://www.nrlmry.navy.mil/atcf_web/docs/database/new/abrdeck.html
//

//
// Models
//
${METPLUS_MODEL}

//
// Description
//
${METPLUS_DESC}

//
// Storm identifiers
//
${METPLUS_STORM_ID}

//
// Basins
//
${METPLUS_BASIN}

//
// Cyclone numbers
//
${METPLUS_CYCLONE}

//
// Storm names
//
${METPLUS_STORM_NAME}

//
// Model initialization time windows to include or exclude
//
${METPLUS_INIT_BEG}
${METPLUS_INIT_END}
${METPLUS_INIT_INCLUDE}
${METPLUS_INIT_EXCLUDE}

//
// Valid model time window
//
${METPLUS_VALID_BEG}
${METPLUS_VALID_END}

//
// Model initialization hours
//
init_hour = [];

//
// Required lead time in hours
//
lead_req = [];

//
// lat/lon polylines defining masking regions
//
init_mask  = "";
valid_mask = "";

//
// Specify if the code should check for duplicate ATCF lines
//
check_dup = FALSE;

//
// Specify special processing to be performed for interpolated models.
// Set to NONE, FILL, or REPLACE.
//
interp12 = REPLACE;

//
// Specify how consensus forecasts should be defined
//
consensus = [];

//
// Forecast lag times
//
lag_time = [];

//
// CLIPER/SHIFOR baseline forecasts to be derived from the BEST
// and operational (CARQ) tracks.
//
best_technique = [ "BEST" ];
best_baseline  = [];
oper_technique = [ "CARQ" ];
oper_baseline  = [];

//
// Specify the datasets to be searched for analysis tracks (NONE, ADECK, BDECK,
// or BOTH).
//
anly_track = BDECK;

//
// Specify if only those track points common to both the ADECK and BDECK
// tracks be written out.
//
match_points = TRUE;

//
// Specify the NetCDF output of the gen_dland tool containing a gridded
// representation of the minimum distance to land.
//
${METPLUS_DLAND_FILE}

//
// Specify watch/warning information:
//   - Input watch/warning filename
//   - Watch/warning time offset in seconds
//
watch_warn = {
   file_name   = "MET_BASE/tc_data/wwpts_us.txt";
   time_offset = -14400;
}

//
// Indicate a version number for the contents of this configuration file.
// The value should generally not be modified.
//
//version = "V9.0";

${METPLUS_MET_CONFIG_OVERRIDES}

Running METplus

NOTE - In order for this example to run successfully, ensure that your output folder ({OUTPUT_BASE}/tc_pairs/201412) is empty. If there are any files in this directory, the program will fail out and not produce the output for {OUTPUT_BASE}/tcmpr_plots.

This use case can be run two ways:

  1. Passing in Plotter_fcstGFS_obsGFS_RPlotting.conf then a user-specific system configuration file:

    run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_RPlotting.conf -c /path/to/user_system.conf
    
  2. Modifying the configurations in parm/metplus_config, then passing in Plotter_fcstGFS_obsGFS_RPlotting.conf:

    run_metplus.py -c /path/to/METplus/parm/use_cases/model_applications/tc_and_extra_tc/Plotter_fcstGFS_obsGFS_RPlotting.conf
    

The former method is recommended. Whether you add them to a user-specific configuration file or modify the metplus_config files, the following variables must be set correctly:

  • INPUT_BASE - Path to directory where sample data tarballs are unpacked (See Datasets section to obtain tarballs). This is not required to run METplus, but it is required to run the examples in parm/use_cases

  • OUTPUT_BASE - Path where METplus output will be written. This must be in a location where you have write permissions

  • MET_INSTALL_DIR - Path to location where MET is installed locally

Example User Configuration File:

[dir]
INPUT_BASE = /path/to/sample/input/data
OUTPUT_BASE = /path/to/output/dir
MET_INSTALL_DIR = /path/to/met-X.Y

NOTE: All of these items must be found under the [dir] section.

Expected Output

A successful run will output the following both to the screen and to the logfile:

INFO: METplus has successfully finished running.

Refer to the value set for OUTPUT_BASE to find where the output data was generated. TCPairs output for this use case will be found in tc_pairs/201412 (relative to OUTPUT_BASE) and will contain files with the following format:

  • mlq2014121400.gfso.<nnnn>.tcst

where nnnn is a zero-padded 4-digit number

Plots (in .png format) will be found in tcmpr_plots (relative to OUTPUT_BASE): * AMAX_WIND-BMAX_WIND_boxplot.png * AMAX_WIND-BMAX_WIND_boxplot.png * AMAX_WIND-BMAX_WIND_boxplot.png * AMSLP-BMSLP_boxplot.png * AMSLP-BMSLP_boxplot.png * AMSLP-BMSLP_boxplot.png * TK_ERR_boxplot.png * TK_ERR_mean.png * TK_ERR_median.png

Keywords

Total running time of the script: ( 0 minutes 0.000 seconds)

Gallery generated by Sphinx-Gallery