4. Python Wrappers

This chapter provides a description of each supported Python wrapper in METplus Wrappers. A wrapper is generally a Python script that encapsulates the behavior of a corresponding MET tool. Each of these sections can be added to the PROCESS_LIST configuration list variable. The Configuration section of each wrapper section below lists the METplus Wrappers configuration variables that are specific to that wrapper organized by config file section. You can find more information about each item in the METplus Configuration Glossary.

4.2. CyclonePlotter

4.2.1. Description

This wrapper does not have a corresponding MET tool but instead wraps the logic necessary to create plots of cyclone tracks. Currently only the output from the MET tc-pairs tool can be plotted.

4.3. EnsembleStat

4.3.1. Description

Used to configure the MET tool ensemble_stat.

4.3.2. Configuration

[dir]

[filename_templates]

[config]

4.4. Example

4.4.1. Description

Used to demonstrate how the METplus wrappers handle looping and building commands.

4.4.2. Configuration

[dir]

[filename_templates]

[config] | EXAMPLE_CUSTOM_LOOP_LIST

4.5. ExtractTiles

4.5.1. 3.5.1 Description

The ExtractTiles wrapper is used to regrid and extract subregions from paired tropical cyclone tracks that are created by the tc_pairs_wrapper. Unlike the other wrappers, the extract_tiles_wrapper does not correspond to a specific MET tool. It invokes the tc_stat_wrapper, which in turn calls the MET tc_stat tool to determine the lat/lon positions of the paired track data. This information is then used to create tiles of subregions. The ExtractTiles wrapper creates a 2n degree x 2m degree grid/tile with each storm located at the center.

4.5.2. Configuration

The following should be set in the METplus configuration file to define the dimensions and density of the tiles comprising the subregion:

[dir]

[config]

4.6. GempakToCF

4.6.1. Description

Used to configure the utility GempakToCF.

4.7. GridStat

4.7.1. Description

Used to configure the MET tool grid_stat.

4.10. MTD

4.10.1. Description

Used to configure the MET MODE Time Domain tool mtd. This tools follows objects through time and can also be used to track objects.

4.12. PCPCombine

4.12.1. Description

The PCPCombine wrapper is a Python script that encapsulates the MET PCPCombine tool. It provides the infrastructure to combine or extract from files to build desired accumulations.

4.12.2. Configuration

[dir]

[filename_templates]

[config]

4.13. PointStat

4.13.1. Description

The PointStat wrapper is a Python script that encapsulates the MET point_stat tool. It provides the infrastructure to read in gridded model data and netCDF point observation data to perform grid-to-point (grid-to-obs) verification.

4.13.2. Configuration

[dir]

[filename_templates]

[config]

4.14. PyEmbedIngest

4.14.1. Description

Used to configure the PyEmbedIngest wrapper that runs RegridDataPlane to convert data using python embedding scripts into NetCDF so it can be read by the MET tools.

4.17. SeriesByInit

4.17.1. Description

The SeriesByInit wrapper provides the infrastructure needed to demonstrates the use of the series analysis tool using tropical cyclone data, based on initialization times. The SeriesByInit_wrapper creates numerous plots that represent the field, level, and statistic for each initialization time.

4.18. SeriesByLead

4.18.1. Description

The SeriesByLead wrapper provides the infrastructure needed to perform a series analysis on tropical cyclone data, based on lead (forecast hour) times. The SeriesByLead wrapper creates numerous plots that represent the field, level, and statistic for each lead (forecast) time. The SeriesByLead can be done in one of two ways: by all forecast hours or by forecast hour groupings. Performing a series analysis by valid time with forecast hour groupings can be useful when analyzing storm tracks based on time ‘bins’ such as by days (eg. day 1, day 2, day 3, etc.).

4.18.2. Configuration

The input track and model data files are defined in any one of the user’s METplus Wrappers configuration files. If creating a final configuration file that overrides all other config files, it is customary to define the MODEL_DATA_DIR, pointing to the directory where all model data resides. The full file path to the INIT_INCLUDE and INIT_EXCLUDE are used to list the times in YYYYMMDD_HH format to include or exclude from your time window. If these values are undefined (i.e. no value is set for the variable), then all available times in your time window will be considered. For example, if your data is available every 6 hours and you are interested in creating a series analysis from init time 20180601 to 20180615 for all available times, from 00z to 23z, you would set the following:

[dir]

[regex_patterns]

[config]

4.19. StatAnalysis

4.19.1. Description

The StatAnalysis wrapper encapsulates the behavior of the MET stat_analysis tool. It provides the infrastructure to summarize and filter the MET .stat files. StatAnalysis wrapper can be run in two different methods. First is to look at the STAT lines for a single date, to use this method set LOOP_ORDER = times. Second is to look at the STAT lines over a span of dates, to use this method set LOOP_ORDER = processes. To run StatAnalysis wrapper, include StatAnalysis in PROCESS_LIST.

4.19.2. Configuration

The following values must be defined in the METplus Wrappers configuration file for running with LOOP_ORDER = times:

[dir]

[filename_templates]

[config]

The following values are optional in the METplus Wrappers configuration file for running with LOOP_ORDER = times:

[config]

The following values must be defined in the METplus Wrappers configuration file for running with LOOP_ORDER = processes:

[dir]

[config]

The following values are optional in the METplus Wrappers configuration file for running with LOOP_ORDER = processes:

4.20. TCMPRPlotter

4.20.1. Description

The TCMPRPlotter wrapper is a Python script that wraps the R script plot_tcmpr.R. This script is useful for plotting the calculated statistics for the output from the MET-TC tools. This script, and other R scripts are included in the MET installation. Please refer to section 21.2.3 of the MET User’s Guide for usage information.

4.21. TcPairs

4.21.1. Description

The TcPairs wrapper encapsulates the behavior of the MET tc_pairs tool. The wrapper accepts Adeck and Bdeck (Best track) cyclone track data in extra tropical cyclone format (such as the data used by sample data provided in the METplus tutorial), or ATCF formatted track data. If data is in an extra tropical cyclone (non-ATCF) format, the data is reformatted into an ATCF format that is recognized by MET.