5.1.18.1. TCStat: Basic Use Case

This use case will run the MET TCi-Stat tool to provide summary statistics from a TC-Pairs run.

Scientific Objective

Summarize and stratify the data from TC-Pairs track and intensity data

Datasets

TC-Pairs data from 201503
Location: All of the input data required for this use case can be found in the met_test sample data tarball. Click here to the METplus releases page and download sample data for the appropriate release: https://github.com/NCAR/METplus/releases
This tarball should be unpacked into the directory that you will set the value of INPUT_BASE. See ‘Running METplus’ section for more information.
Data Source: Unknown

METplus Components

This use case utilizes the METplus TCStat wrapper to search for files that are valid at a given run time and generate a command to run the MET tool tc_stat if all required files are found.

METplus Workflow

TCStat is the only tool called in this example. It processes the following run times:

TCST:* 2015030100

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/met_tool_wrapper/TCStat/TCStat.conf

#
#  CONFIGURATION
#
[config]
# set looping method to processes-each 'task' in the process list runs to
# completion (for all init times) before the next 'task' is run
LOOP_ORDER = processes

# List of 'tasks' to run
PROCESS_LIST = TcStat


# Run tc_stat using a config file or as command line
# if running via MET tc_stat config file, set to CONFIG.  Leave blank or
# anything other than CONFIG if running via command line.
#TC_STAT_RUN_VIA =
TC_STAT_RUN_VIA = CONFIG
TC_STAT_CONFIG_FILE = {PARM_BASE}/met_config/TCStatConfig_wrapped


#              !!!!!!!IMPORTANT!!!!!!
# Please refer to the README_TC located in ${MET_INSTALL_DIR}/share/met/config
# for details on setting up your analysis jobs.

# For arithmetic expressions such as:
# -column 'ABS(AMSLP-BMSLP)', enclose the expression in ''. Notice that there are no
# whitespaces within the arithmetic expression.  White spaces are to be used to
# separate options from values (e.g. -job summary -by AMODEL,LEAD,AMSLP -init_hour 00 -column 'AMSLP-BMSLP').
# eg. -lookin {OUTPUT_BASE}/tc_pairs -job filter -dump_row {OUTPUT_BASE}/tc_stat_filter.out -basin ML -init_hr 00
# or -lookin {OUTPUT_BASE}/tc_pairs -job summary -by AMODEL,LEAD -column AMSLP -column AMAX_WIND -column 'ABS(AMAX_WIND-BMAX_WIND)' -out {OUTPUT_BASE}/tc_stat/tc_stat_summary.tcst

# Only if TC_STAT_RUN_VIA = CLI
# TC_STAT_CMD_LINE_JOB = -job filter -dump_row {OUTPUT_BASE}/tc_stat/tc_stat_filter.out -basin ML -init_hour 00

#TC_STAT_RUN_VIA=  indicates run via command line, so you MUST define TC_STAT_JOBS_LIST, below

# Define the job filter via TC_STAT_JOBS_LIST.
# Separate each option and value with whitespace, and each job with a whitespace.
# No whitespace within arithmetic expressions or lists of items
# (e.g. -by AMSLP,AMODEL,LEAD -column '(AMAX_WIND-BMAX_WIND)')
# Enclose your arithmetic expressions with '' and separate each job
# by whitespace:
#  -job filter -dump_row /path/to,  -job summary -line_type TCMPR  -column 'ABS(AMAX_WIND-BMAX_WIND)' -out {OUTPUT_BASE}/tc_stat/file.tcst
#TC_STAT_JOBS_LIST = -job summary -line_type TCMPR -column 'ABS(AMAX_WIND-BMAX_WIND)' -dump_row {OUTPUT_BASE}/tc_stat/tc_stat_summary.tcst
TC_STAT_JOBS_LIST = -job summary -line_type TCMPR -column 'ASPEED' -dump_row {OUTPUT_BASE}/tc_stat/tc_stat_summary.tcst


#
#  FILL in the following values if running multiple jobs which
#  requires a MET tc_stat config file.
#
# These all map to the options in the default TC-Stat config file, except these
# are pre-pended with TC_STAT to avoid clashing with any other similarly
# named options from other MET tools (eg TC_STAT_AMODEL corresponds to the
# amodel option in the default MET tc-stat config file, whereas AMODEL
# corresponds to the amodel option in the MET tc-pairs config file).

# Stratify by these columns:
TC_STAT_AMODEL =
TC_STAT_BMODEL =
TC_STAT_DESC =
TC_STAT_STORM_ID =
TC_STAT_BASIN =
TC_STAT_CYCLONE =
TC_STAT_STORM_NAME =

# Stratify by init times via a comma-separate list of init times to
# include or exclude.  Time format defined as YYYYMMDD_HH or YYYYMMDD_HHmmss
TC_STAT_INIT_BEG = 20150301
TC_STAT_INIT_END = 20150304
TC_STAT_INIT_INCLUDE =
TC_STAT_INIT_EXCLUDE =
TC_STAT_INIT_HOUR = 00

# Stratify by valid times via a comma-separate list of valid times to
# include or exclude.  Time format defined as YYYYMMDD_HH or YYYYMMDD_HHmmss
TC_STAT_VALID_BEG =
TC_STAT_VALID_END =
TC_STAT_VALID_INCLUDE =
TC_STAT_VALID_EXCLUDE =
TC_STAT_VALID_HOUR =
TC_STAT_LEAD_REQ =
TC_STAT_INIT_MASK =
TC_STAT_VALID_MASK =

# Stratify by the valid time and lead time via comma-separated list of
# times in format HH[MMSS]
TC_STAT_VALID_HOUR =
TC_STAT_LEAD =

# Stratify over the watch_warn column in the tcst file.  Setting this to
# 'ALL' will match HUWARN, HUWATCH, TSWARN, TSWATCH
TC_STAT_TRACK_WATCH_WARN =

# Stratify by applying thresholds to numeric data columns.  Specify with
# comma-separated list of column names and thresholds to be applied.
# The length of TC_STAT_COLUMN_THRESH_NAME should be the same as
# TC_STAT_COLUMN_THRESH_VAL.
TC_STAT_COLUMN_THRESH_NAME =
TC_STAT_COLUMN_THRESH_VAL =

# Stratify by a list of comma-separated columns names and values corresponding
# to non-numeric data columns of the values of interest.
TC_STAT_COLUMN_STR_NAME =
TC_STAT_COLUMN_STR_VAL =

# Stratify by applying thresholds to numeric data columns only when lead=0.
# If lead=0 and the value does not meet the threshold, discard the entire
# track.  The length of TC_STAT_INIT_THRESH_NAME must equal the length of
# TC_STAT_INIT_THRESH_VAL.
TC_STAT_INIT_THRESH_NAME =
TC_STAT_INIT_THRESH_VAL =

# Stratify by applying thresholds to numeric data columns only when lead = 0.
# If lead = 0 but the value doesn't meet the threshold, discard the entire
# track.
TC_STAT_INIT_STR_NAME =
TC_STAT_INIT_STR_VAL =

# Excludes any points where distance to land is <=0. When set to TRUE, once land
# is encountered, the remainder of the forecast track is NOT used for the
# verification, even if the track moves back over water.
TC_STAT_WATER_ONLY =

# TRUE or FALSE.  To specify whether only those track points occurring near
# landfall should be retained. Landfall is the last bmodel track point before
# the distance to land switches from water to land.
TC_STAT_LANDFALL =

# Define the landfall retention window, which is defined as the hours offset
# from the time of landfall. Format is in HH[MMSS]. Default TC_STAT_LANDFALL_BEG
# is set to -24, and TC_STAT_LANDFALL_END is set to 00
TC_STAT_LANDFALL_BEG = -24
TC_STAT_LANDFALL_END = 00

# Specify whether only those track points common to both the ADECK and BDECK
# tracks should be written out
TC_STAT_MATCH_POINTS = false

# IMPORTANT  Refer to the README_TC for details on setting up analysis
# jobs (located in {MET_INSTALL_DIR}/share/met/config



#
#  DIRECTORIES
#
[dir]
# TC-Stat input data (uses output from tc-pairs)
TC_STAT_INPUT_DIR = {INPUT_BASE}/met_test/tc_pairs

# TC-Stat output data (creates .tcst ASCII files which can be read or used as
# input to TCMPR_Plotter_wrapper (the Python wrapper to plot_tcmpr.R) to create plots.
TC_STAT_OUTPUT_DIR = {OUTPUT_BASE}/tc_stat

MET Configuration

METplus sets environment variables based on the values in the METplus configuration file. These variables are referenced in the MET configuration file. 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 not controlled by an environment variable, you can add additional environment variables to be set only within the METplus environment using the [user_env_vars] section of the METplus configuration files. See the ‘User Defined Config’ section on the ‘System Configuration’ page of the METplus User’s Guide for more information.

////////////////////////////////////////////////////////////////////////////////
//
// Default TCStat configuration file
//
////////////////////////////////////////////////////////////////////////////////

//
// The parameters listed below are used to filter the TC-STAT data down to the
// desired subset of lines over which statistics are to be computed.  Only
// those lines which meet ALL of the criteria specified will be retained.
//
// The settings that are common to all jobs may be specified once at the top
// level.  If no selection is listed for a parameter, that parameter will not
// be used for filtering.  If multiple selections are listed for a parameter,
// the analyses will be performed on their union.
//

//
// Stratify by the AMODEL or BMODEL columns.
//
amodel = ${AMODEL};
bmodel = ${BMODEL};

//
// Stratify by the DESC column.
//
desc = ${DESC};

//
// Stratify by the STORM_ID column.
//
storm_id = ${STORM_ID};

//
// Stratify by the BASIN column.
// May add using the "-basin" job command option.
//
basin = ${BASIN};

//
// Stratify by the CYCLONE column.
// May add using the "-cyclone" job command option.
//
cyclone = ${CYCLONE};

//
// Stratify by the STORM_NAME column.
// May add using the "-storm_name" job command option.
//
storm_name = ${STORM_NAME};

//
// Stratify by the INIT times.
// Model initialization time windows to include or exclude
// May modify using the "-init_beg", "-init_end", "-init_inc",
// and "-init_exc" job command options.
//
init_beg = "${INIT_BEG}";
init_end = "${INIT_END}";
init_inc = ${INIT_INCLUDE};
init_exc = ${INIT_EXCLUDE};

//
// Stratify by the VALID times.
//
valid_beg = "${VALID_BEG}";
valid_end = "${VALID_END}";
valid_inc = ${VALID_INCLUDE};
valid_exc = ${VALID_EXCLUDE};

//
// Stratify by the initialization and valid hours and lead time.
//
init_hour = ${INIT_HOUR};
valid_hour = ${VALID_HOUR};
lead = ${LEAD};

//
// Select tracks which contain all required lead times.
//
lead_req = ${LEAD_REQ};

//
// Stratify by the INIT_MASK and VALID_MASK columns.
//
init_mask = ${INIT_MASK};
valid_mask = ${VALID_MASK};

//
// Stratify by the LINE_TYPE column.
//
line_type = [];

//
// Stratify by checking the watch/warning status for each track point
// common to both the ADECK and BDECK tracks.  If the watch/warning status
// of any of the track points appears in the list, retain the entire track.
//
track_watch_warn = ${TRACK_WATCH_WARN};

//
// Stratify by applying thresholds to numeric data columns.
//
column_thresh_name = ${COLUMN_THRESH_NAME};
column_thresh_val = ${COLUMN_THRESH_VAL};

//
// Stratify by performing string matching on non-numeric data columns.
//
column_str_name = ${COLUMN_STR_NAME};
column_str_val = ${COLUMN_STR_VAL};

//
// Similar to the column_thresh options above
//
init_thresh_name = ${INIT_THRESH_NAME};
init_thresh_val = ${INIT_THRESH_VAL};

//
// Similar to the column_str options above
//
init_str_name = ${INIT_STR_NAME};
init_str_val = ${INIT_STR_VAL};

//
// Stratify by the ADECK and BDECK distances to land.
//
water_only = ${WATER_ONLY};

//
// Specify whether only those track points for which rapid intensification
// or weakening of the maximum wind speed occurred in the previous time
// step should be retained.
//
rirw = {
   track  = NONE;
   adeck = {
      time   = "24";
      exact  = TRUE;
      thresh = >=30.0;
   }
   bdeck = adeck;
}

//
// Specify whether only those track points occurring near landfall should be
// retained, and define the landfall retention window in HH[MMSS] format
// around the landfall time.
//
landfall = ${LANDFALL};
landfall_beg = "${LANDFALL_BEG}";
landfall_end = "${LANDFALL_END}";


//
// Specify whether only those track points common to both the ADECK and BDECK
// tracks should be retained.  May modify using the "-match_points" job command
// option.
//
match_points = ${MATCH_POINTS};

//
// Specify whether only those cases common to all models in the dataset should
// be retained.
//
event_equal = FALSE;

//
// Specify lead times that must be present for a track to be included in the
// event equalization logic.
//
event_equal_lead = [];

//
// Apply polyline masking logic to the location of the ADECK track at the
// initialization time.
//
out_init_mask = "";

//
// Apply polyline masking logic to the location of the ADECK track at the
// valid time.
//
out_valid_mask = "";

//
// Array of TCStat analysis jobs to be performed on the filtered data
//
jobs = ${JOBS};

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

Note the following variables are referenced in the MET configuration file.

  • ASPEED

Running METplus

This use case can be run two ways:

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

    master_metplus.py -c /path/to/METplus/parm/use_cases/met_tool_wrapper/TCStat/TCStat.conf -c /path/to/user_system.conf
    
  2. Modifying the configurations in parm/metplus_config, then passing in TCStat.conf:

    master_metplus.py -c /path/to/METplus/parm/use_cases/met_tool_wrapper/TCStat/TCStat.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]
OUTPUT_BASE = /path/to/output/dir
INPUT_BASE/tc_pairs = path/to/tc_pairs/
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. Output for this use case will be found in tc_paris/201503 (relative to OUTPUT_BASE) and will contain the following files:

OUTPUT_BASE/tc_stat/tc_stat_summary.tcst

Keywords

sphinx_gallery_thumbnail_path = ‘_static/met_tool_wrapper-TCStat.png’

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

Gallery generated by Sphinx-Gallery