5.1.26.1. TCStat: Basic Use Case

met_tool_wrapper/TCStat/TCStat.conf

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/dtcenter/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 TCST 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

LOOP_BY = INIT

# The init time begin and end times, increment, and last init hour.
INIT_TIME_FMT = %Y%m%d%H
INIT_BEG = 2019103112
INIT_END = 2019103112

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

# Leave blank or remove to use wrapped config file in parm/met_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

# Define the job filter via TC_STAT_JOB_ARGS.
# 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_JOB_ARGS = -job summary -line_type TCMPR -column 'ASPEED' -dump_row {TC_STAT_OUTPUT_DIR}/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

#TC_STAT_COLUMN_STR_EXC_NAME =
#TC_STAT_COLUMN_STR_EXC_VAL =

#TC_STAT_INIT_STR_EXC_NAME =
#TC_STAT_INIT_STR_EXC_VAL =

# 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 (-lookin argument)
# uses output from tc-pairs
TC_STAT_LOOKIN_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 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 TCStat MET Configuration section of the User’s Guide for more information on the environment variables used in the file below:

///////////////////////////////////////////////////////////////////////////////
//
// 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.
//
${METPLUS_AMODEL}
${METPLUS_BMODEL}

//
// Stratify by the DESC column.
//
${METPLUS_DESC}

//
// Stratify by the STORM_ID column.
//
${METPLUS_STORM_ID}

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

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

//
// Stratify by the STORM_NAME column.
// May add using the "-storm_name" job command option.
//
${METPLUS_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.
//
${METPLUS_INIT_BEG}
${METPLUS_INIT_END}
${METPLUS_INIT_INCLUDE}
${METPLUS_INIT_EXCLUDE}

//
// Stratify by the VALID times.
//
${METPLUS_VALID_BEG}
${METPLUS_VALID_END}
${METPLUS_VALID_INCLUDE}
${METPLUS_VALID_EXCLUDE}

//
// Stratify by the initialization and valid hours and lead time.
//
${METPLUS_INIT_HOUR}
${METPLUS_VALID_HOUR}
${METPLUS_LEAD}

//
// Select tracks which contain all required lead times.
//
${METPLUS_LEAD_REQ}

//
// Stratify by the INIT_MASK and VALID_MASK columns.
//
${METPLUS_INIT_MASK}
${METPLUS_VALID_MASK}

//
// 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.
//
${METPLUS_TRACK_WATCH_WARN}

//
// Stratify by applying thresholds to numeric data columns.
//
${METPLUS_COLUMN_THRESH_NAME}
${METPLUS_COLUMN_THRESH_VAL}

//
// Stratify by performing string matching on non-numeric data columns.
//
${METPLUS_COLUMN_STR_NAME}
${METPLUS_COLUMN_STR_VAL}

//
// Stratify by excluding strings in non-numeric data columns.
//
//column_str_exc_name =
${METPLUS_COLUMN_STR_EXC_NAME}

//column_str_exc_val =
${METPLUS_COLUMN_STR_EXC_VAL}

//
// Similar to the column_thresh options above
//
${METPLUS_INIT_THRESH_NAME}
${METPLUS_INIT_THRESH_VAL}

//
// Similar to the column_str options above
//
${METPLUS_INIT_STR_NAME}
${METPLUS_INIT_STR_VAL}

//
// Similar to the column_str_exc options above
//
//init_str_exc_name =
${METPLUS_INIT_STR_EXC_NAME}

//init_str_exc_val =
${METPLUS_INIT_STR_EXC_VAL}

//
// Stratify by the ADECK and BDECK distances to land.
//
${METPLUS_WATER_ONLY}

//
// 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.
//
${METPLUS_LANDFALL}
${METPLUS_LANDFALL_BEG}
${METPLUS_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.
//
${METPLUS_MATCH_POINTS}

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

${METPLUS_MET_CONFIG_OVERRIDES}

Running METplus

This use case can be run two ways:

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

    run_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:

    run_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_stat/201503 (relative to OUTPUT_BASE) and will contain the following files:

  • 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