METplus Use Case: TC-Pairs

METplus Use Case: TC-Pairs
IMPORTANT NOTE: If you are returning to the tutorial, you must source the tutorial setup script before running the following instructions. If you are unsure if you have done this step, please navigate to the Verify Environment is Set Correctly page.

The TCPairs use case utilizes the MET TC-Pairs tool.

Optional: Refer to the MET Users Guide for a description of the MET tools used in this use case.
Optional: Refer to the METplus Config Glossary section of the METplus Users Guide for a reference to METplus variables used in this use case.

Change to the ${METPLUS_TUTORIAL_DIR}
cd ${METPLUS_TUTORIAL_DIR}
See what TCPairs use cases are available in met_tool_wrapper directory and run one
ls ${METPLUS_BUILD_BASE}/parm/use_cases/met_tool_wrapper/TCPairs

There is an example of using TC-Pairs to match Extratropical Cyclones as well as Tropical Cyclones

TCPairs_extra_tropical.conf
TCPairs_tropical.conf
Open the TCPairs_tropical.conf file and look at what is set.
less ${METPLUS_BUILD_BASE}/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf
PROCESS_LIST = TCPairs
MODEL = MYNN, H19C, H19M, CTRL, MYGF
TC_PAIRS_CYCLONE = 06
TC_PAIRS_ADECK_INPUT_DIR = {INPUT_BASE}/met_test/new/hwrf/adeck
TC_PAIRS_OUTPUT_DIR = {OUTPUT_BASE}/tc_pairs
TC_PAIRS_ADECK_TEMPLATE = {model?fmt=%s}/*{cyclone?fmt=%s}l.{date?fmt=%Y%m%d%H}.trak.hwrf.atcfunix

Let's take a look at the data to understand why the configuration file is set up the way it is. If you recall, the {INPUT_BASE} is set in tutorial.conf as ${METPLUS_DATA}, so we will look there:

ls ${METPLUS_DATA}/met_test/new/hwrf/adeck/*

The output from this command will return four separate directories, each with their own collection of track files. Those four directories are:

CTRL
H19C
H19M
MYNN

An example of the track files found in each of these directories is:

six06l.2018083018.trak.hwrf.atcfunix
Run the use case:
run_metplus.py \
${METPLUS_BUILD_BASE}/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf \
${METPLUS_TUTORIAL_DIR}/tutorial.conf \
config.OUTPUT_BASE=${METPLUS_TUTORIAL_DIR}/output/TCPairs

Let's look at the output file:

vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs/tc_pairs/tc_pairs_al2018083006.dat.tcst
vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs/tc_pairs/tc_pairs_al2018083012.dat.tcst
vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs/tc_pairs/tc_pairs_al2018083018.dat.tcst
once open use ":set nowrap" to easily view rows of data

You will notice that there are two models configurations included in the first file for Hurricane Florence, CTRL and MYNN and the line type written out is TCMPR indicate it is the matched pair information. If you open up the third file, you'll notice that there is only the CTRL model listed.

Look at the input files to get a sense of what data are available.
less ${METPLUS_DATA}/met_test/new/hwrf/adeck/CTRL/six06l.2018083018.trak.hwrf.atcfunix
less ${METPLUS_DATA}/met_test/new/hwrf/adeck/H19C/six06l.2018083018.trak.hwrf.atcfunix
less ${METPLUS_DATA}/met_test/new/hwrf/adeck/H19M/six06l.2018083012.trak.hwrf.atcfunix
less ${METPLUS_DATA}/met_test/new/hwrf/adeck/MYNN/six06l.2018083018.trak.hwrf.atcfunix

You will see that in the files are in the ATCF file format. Also note: in the files in the CTRL directory, the model listed in the 5th column is HLAT. Similarly, in the H19C directory, the model is CTRL; in the H19M directory it is MYNN, and in the MYNN directory, it is HLMY. While this is confusing in some ways, it does demonstrate that the TC-Pairs tool does not look at the directory structure and naming convention of the input files, but rather the model information included in the ATCF "a-decks", which is traditional naming convention for files with forecast tracks.

Copy METplus config file to write out all model types, and re-run
cp ${METPLUS_BUILD_BASE}/parm/use_cases/met_tool_wrapper/TCPairs/TCPairs_tropical.conf \
${METPLUS_TUTORIAL_DIR}/user_config/TCPairs_run2.conf
vi ${METPLUS_TUTORIAL_DIR}/user_config/TCPairs_run2.conf

The TC_PAIRS_ADECK_TEMPLATE includes MODEL in the path, so we will leave MYNN and CTRL in the list.

Remove MYGF and add HLMY and HLAT and then rerun
MODEL = MYNN, CTRL, H19C, H19M, HLMY, HLAT
run_metplus.py \
${METPLUS_TUTORIAL_DIR}/user_config/TCPairs_run2.conf \
${METPLUS_TUTORIAL_DIR}/tutorial.conf \
config.OUTPUT_BASE=${METPLUS_TUTORIAL_DIR}/output/TCPairs_run2

Review output

vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs_run2/tc_pairs/tc_pairs_al2018083006.dat.tcst
vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs_run2/tc_pairs/tc_pairs_al2018083012.dat.tcst
vi ${METPLUS_TUTORIAL_DIR}/output/TCPairs_run2/tc_pairs/tc_pairs_al2018083018.dat.tcst

You will notice that now all models are included in the appropriate files. Also note that all of the forecasts leads from 000000 to 1260000 are included in the 10th column.

jopatz Wed, 02/23/2022 - 16:44