Multi_Tool (MTD): Feature Relative by Lead (with lead groupings)

model_applicaitons/medium_range/ MTD_SeriesAnalysis_fcstGFS _obsGFS_FeatureRelative _SeriesByLead.conf

Scientific Objective

Demonstrate the capability in the Feature Relative use case but using output from the MET MODE Time Domain (MTD) tool.

Datasets

Relevant information about the datasets that would be beneficial include:

  • MODE Time Domain Forecast dataset: GFS

  • Series-Analysis Forecast dataset: GFS

  • MODE Time Domain Observation dataset: GFS Analysis

  • Series-Analysis Observation dataset: GFS Analysis

METplus Components

This use case first runs MODE Time Domain and ExtractTiles wrappers to generate tiles of data centered on objects defined using MTD. The MET regrid_data_plane tool is used to regrid the data (GRIB1 or GRIB2 into netCDF). Next, a series analysis by lead time is performed on the results and plots (.ps and .png) are generated for all variable-level-stat combinations from the requested variables, levels, and requested statistics. The final results are aggregated into forecast hour groupings as specified by the start and end increment in the METplus configuration file, as well as labels to identify each forecast hour grouping.

METplus Workflow

The following tools are used for each run time:

MTD > RegridDataPlane (via ExtractTiles) > SeriesAnalysis

This example loops by forecast/lead time (with begin, end, and increment as specified in the METplus MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.conf file). The following list of model initialization and forecast leads are processed in this use case:

Init: 20210712_00Z
Forecast lead: 6, 12, 18, 24, 30

Init: 20210712_06Z
Forecast lead: 6, 12, 18, 24, 30

Init: 20210712_12Z
Forecast lead: 6, 12, 18, 24, 30

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.

[config]

# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/model_applications/medium_range/MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.html

# For additional information, please see the METplus Users Guide.
# https://metplus.readthedocs.io/en/latest/Users_Guide

###
# Processes to run
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#process-list
###

PROCESS_LIST = MTD, ExtractTiles, SeriesAnalysis


###
# Time Info
# LOOP_BY options are INIT, VALID, RETRO, and REALTIME
# If set to INIT or RETRO:
#   INIT_TIME_FMT, INIT_BEG, INIT_END, and INIT_INCREMENT must also be set
# If set to VALID or REALTIME:
#   VALID_TIME_FMT, VALID_BEG, VALID_END, and VALID_INCREMENT must also be set
# LEAD_SEQ is the list of forecast leads to process
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#timing-control
###

LOOP_BY = INIT
INIT_TIME_FMT = %Y%m%d%H
INIT_BEG = 2021071200
INIT_END = 2021071212
INIT_INCREMENT = 6H

LEAD_SEQ = begin_end_incr(0,30,6)


###
# File I/O
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#directory-and-filename-template-info
###

FCST_MTD_INPUT_DIR = {INPUT_BASE}/model_applications/medium_range/MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead
FCST_MTD_INPUT_TEMPLATE= {init?fmt=%Y%m%d%H}/gfs.t{init?fmt=%H}z.pgrb2.1p00.f{lead?fmt=%HHH}

OBS_MTD_INPUT_DIR = {FCST_MTD_INPUT_DIR}
OBS_MTD_INPUT_TEMPLATE = {valid?fmt=%Y%m%d%H}/gfs.t{valid?fmt=%H}z.pgrb2.1p00.f000

MTD_OUTPUT_DIR = {OUTPUT_BASE}/mtd
MTD_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H}


EXTRACT_TILES_SKIP_IF_OUTPUT_EXISTS = no

EXTRACT_TILES_MTD_INPUT_DIR = {MTD_OUTPUT_DIR}
EXTRACT_TILES_MTD_INPUT_TEMPLATE = {MTD_OUTPUT_TEMPLATE}/mtd_{MODEL}_{FCST_VAR1_NAME}_vs_{OBTYPE}_{OBS_VAR1_NAME}_{OBS_VAR1_LEVELS}_{init?fmt=%Y%m%d_%H%M%S}V_2d.txt

FCST_EXTRACT_TILES_INPUT_DIR = {FCST_MTD_INPUT_DIR}
FCST_EXTRACT_TILES_INPUT_TEMPLATE = {FCST_MTD_INPUT_TEMPLATE}

OBS_EXTRACT_TILES_INPUT_DIR = {FCST_MTD_INPUT_DIR}
OBS_EXTRACT_TILES_INPUT_TEMPLATE = {OBS_MTD_INPUT_TEMPLATE}

EXTRACT_TILES_OUTPUT_DIR = {OUTPUT_BASE}/extract_tiles
FCST_EXTRACT_TILES_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d_%H}/FCST_TILE_F{lead?fmt=%3H}_{MODEL}_{init?fmt=%Y%m%d}_{init?fmt=%H}00_{lead?fmt=%3H}.nc
OBS_EXTRACT_TILES_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d_%H}/OBS_TILE_F{lead?fmt=%3H}_{MODEL}_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00_000.nc


FCST_SERIES_ANALYSIS_INPUT_DIR = {EXTRACT_TILES_OUTPUT_DIR}
FCST_SERIES_ANALYSIS_INPUT_TEMPLATE = {FCST_EXTRACT_TILES_OUTPUT_TEMPLATE}

OBS_SERIES_ANALYSIS_INPUT_DIR = {EXTRACT_TILES_OUTPUT_DIR}
OBS_SERIES_ANALYSIS_INPUT_TEMPLATE = {OBS_EXTRACT_TILES_OUTPUT_TEMPLATE}

SERIES_ANALYSIS_TC_STAT_INPUT_DIR = {SERIES_ANALYSIS_OUTPUT_DIR}

SERIES_ANALYSIS_OUTPUT_DIR = {OUTPUT_BASE}/series_analysis_lead
SERIES_ANALYSIS_OUTPUT_TEMPLATE = {label}/series_F{fcst_beg}_to_F{fcst_end}_{fcst_name}_{fcst_level}.nc


###
# Field Info
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#field-info
###

MODEL = GFS
OBTYPE = GFS_ANLY

FCST_VAR1_NAME = PWAT
FCST_VAR1_LEVELS = L0

OBS_VAR1_NAME = PWAT
OBS_VAR1_LEVELS = L0


###
# MTD Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#mtd
###

MTD_DESC = NA

MTD_SINGLE_RUN = False

FCST_MTD_CONV_RADIUS = 0
FCST_MTD_CONV_THRESH = gt60.0

OBS_MTD_CONV_RADIUS = 0
OBS_MTD_CONV_THRESH = gt60.0

MTD_REGRID_TO_GRID = NONE

MTD_MIN_VOLUME = 2000

MTD_OUTPUT_PREFIX = {MODEL}_{CURRENT_FCST_NAME}_vs_{OBTYPE}_{CURRENT_OBS_NAME}_{CURRENT_FCST_LEVEL}


###
# ExtractTiles Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#extracttiles
###

EXTRACT_TILES_NLAT = 60
EXTRACT_TILES_NLON = 60

EXTRACT_TILES_DLAT = 0.5
EXTRACT_TILES_DLON = 0.5

EXTRACT_TILES_LON_ADJ = 15
EXTRACT_TILES_LAT_ADJ = 15


###
# SeriesAnalysis Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#seriesanalysis
###

SERIES_ANALYSIS_BACKGROUND_MAP = no

SERIES_ANALYSIS_RUNTIME_FREQ = RUN_ONCE_PER_LEAD

SERIES_ANALYSIS_RUN_ONCE_PER_STORM_ID = False

SERIES_ANALYSIS_REGRID_TO_GRID = OBS
SERIES_ANALYSIS_REGRID_METHOD = FORCE

SERIES_ANALYSIS_STAT_LIST = TOTAL, FBAR, OBAR, ME

SERIES_ANALYSIS_BLOCK_SIZE = 4000

SERIES_ANALYSIS_IS_PAIRED = True

SERIES_ANALYSIS_GENERATE_PLOTS = yes

SERIES_ANALYSIS_GENERATE_ANIMATIONS = yes

PLOT_DATA_PLANE_TITLE = {MODEL} series_F{fcst_beg}_to_F{fcst_end} Forecasts{nseries}, {stat} for {fcst_name} {fcst_level}

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

MTDConfig_wrapped

Note

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

////////////////////////////////////////////////////////////////////////////////
//
// MODE Time Domain configuration file.
//
// For additional information, see the MET_BASE/config/README file.
//
////////////////////////////////////////////////////////////////////////////////

   //
   // Output model name to be written
   //

//model =
${METPLUS_MODEL}

   //
   // Output description to be written
   //

//desc =
${METPLUS_DESC}

   //
   // Output observation type to be written
   //

//obtype =
${METPLUS_OBTYPE}

////////////////////////////////////////////////////////////////////////////////

   //
   //  Verification grid
   //  May be set separately in each "field" entry
   //

//regrid = {
${METPLUS_REGRID_DICT}

////////////////////////////////////////////////////////////////////////////////

   //
   // Approximate grid resolution (km)
   //

grid_res = 4;

////////////////////////////////////////////////////////////////////////////////

   //
   // Forecast and observation fields to be verified
   //

fcst = {

   ${METPLUS_FCST_FILE_TYPE}

   //field = {
   ${METPLUS_FCST_FIELD}

   censor_thresh     = [];
   censor_val        = [];
   conv_time_window  = { beg = -1; end = 1; };
   //conv_radius       =
   ${METPLUS_FCST_CONV_RADIUS}
   //conv_thresh       =
   ${METPLUS_FCST_CONV_THRESH}

}

obs = {

   ${METPLUS_OBS_FILE_TYPE}

   //field = {
   ${METPLUS_OBS_FIELD}

   censor_thresh     = [];
   censor_val        = [];
   conv_time_window  = { beg = -1; end = 1; };
   //conv_radius       =
   ${METPLUS_OBS_CONV_RADIUS}
   //conv_thresh       =
   ${METPLUS_OBS_CONV_THRESH}
}

////////////////////////////////////////////////////////////////////////////////

   //
   // Intensity percentile value to be written
   //

inten_perc_value = 99;

////////////////////////////////////////////////////////////////////////////////

   //
   //  Throw away 3D objects with volumes smaller than this
   //

//min_volume =
${METPLUS_MIN_VOLUME}


////////////////////////////////////////////////////////////////////////////////

   //
   // Fuzzy engine weights
   //

weight = {

   space_centroid_dist  = 1.0;

   time_centroid_delta  = 1.0;

   speed_delta          = 1.0;

   direction_diff       = 1.0;

   volume_ratio         = 1.0;

   axis_angle_diff      = 1.0;

   start_time_delta     = 1.0;

   end_time_delta       = 1.0;

}

////////////////////////////////////////////////////////////////////////////////

   //
   // Fuzzy engine interest functions
   //

interest_function = {

   space_centroid_dist = (

      (   0.0, 1.0 )
      (  50.0, 0.5 )
      ( 100.0, 0.0 )

   );

   time_centroid_delta = (

      ( -3.0, 0.0 )
      ( -2.0, 0.5 )
      ( -1.0, 0.8 )
      (  0.0, 1.0 )
      (  1.0, 0.8 )
      (  2.0, 0.5 )
      (  3.0, 0.0 )

   );

   speed_delta = (

      ( -10.0, 0.0 )
      (  -5.0, 0.5 )
      (   0.0, 1.0 )
      (   5.0, 0.5 )
      (  10.0, 0.0 )

   );

   direction_diff = (

      (   0.0, 1.0 )
      (  90.0, 0.0 )
      ( 180.0, 0.0 )

   );

   volume_ratio = (

      (  0.0, 0.0 )
      (  0.5, 0.5 )
      (  1.0, 1.0 )
      (  1.5, 0.5 )
      (  2.0, 0.0 )

   );

   axis_angle_diff = (

      (  0.0, 1.0 )
      ( 30.0, 1.0 )
      ( 90.0, 0.0 )

   );

   start_time_delta = (

      ( -5.0, 0.0 )
      ( -3.0, 0.5 )
      (  0.0, 1.0 )
      (  3.0, 0.5 )
      (  5.0, 0.0 )

   );

   end_time_delta = (

      ( -5.0, 0.0 )
      ( -3.0, 0.5 )
      (  0.0, 1.0 )
      (  3.0, 0.5 )
      (  5.0, 0.0 )

   );

}   //  interest functions


////////////////////////////////////////////////////////////////////////////////

   //
   // Total interest threshold for determining matches
   //

total_interest_thresh = 0.7;


////////////////////////////////////////////////////////////////////////////////

   //
   // Output flags
   //

nc_output = {

   latlon       = true;
   raw          = true;
   object_id    = true;
   cluster_id   = true;

}

txt_output = {

   attributes_2d   = true;
   attributes_3d   = true;

}


////////////////////////////////////////////////////////////////////////////////

//output_prefix =
${METPLUS_OUTPUT_PREFIX}
//version        = "V9.0";

tmp_dir = "${MET_TMP_DIR}";

////////////////////////////////////////////////////////////////////////////////

${METPLUS_MET_CONFIG_OVERRIDES}

SeriesAnalysisConfig_wrapped

Note

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

////////////////////////////////////////////////////////////////////////////////
//
// Series-Analysis configuration file.
//
// For additional information, see the MET_BASE/config/README file.
//
////////////////////////////////////////////////////////////////////////////////

//
// Output model name to be written
//
//model =
${METPLUS_MODEL}

//
// Output description to be written
//
//desc =
${METPLUS_DESC}

//
// Output observation type to be written
//
//obtype =
${METPLUS_OBTYPE}

////////////////////////////////////////////////////////////////////////////////

//
// Verification grid
// May be set separately in each "field" entry
//
//regrid = {
${METPLUS_REGRID_DICT}

////////////////////////////////////////////////////////////////////////////////

censor_thresh = [];
censor_val    = [];
//cat_thresh =
${METPLUS_CAT_THRESH}
cnt_thresh    = [ NA ];
cnt_logic     = UNION;

//
// Forecast and observation fields to be verified
//
fcst = {
   ${METPLUS_FCST_FILE_TYPE}
   ${METPLUS_FCST_CAT_THRESH}
   //field = [
   ${METPLUS_FCST_FIELD}
}
obs = {
   ${METPLUS_OBS_FILE_TYPE}
   ${METPLUS_OBS_CAT_THRESH}
   //field = [
   ${METPLUS_OBS_FIELD}
}

////////////////////////////////////////////////////////////////////////////////

//
// Climatology data
//
//climo_mean = {
${METPLUS_CLIMO_MEAN_DICT}


//climo_stdev = {
${METPLUS_CLIMO_STDEV_DICT}

//climo_cdf = {
${METPLUS_CLIMO_CDF_DICT}

////////////////////////////////////////////////////////////////////////////////

//
// Confidence interval settings
//
ci_alpha  = [ 0.05 ];

boot = {
   interval = PCTILE;
   rep_prop = 1.0;
   n_rep    = 0;
   rng      = "mt19937";
   seed     = "";
}

////////////////////////////////////////////////////////////////////////////////

//
// Verification masking regions
//
//mask = {
${METPLUS_MASK_DICT}

//
// Number of grid points to be processed concurrently.  Set smaller to use
// less memory but increase the number of passes through the data.
//
//block_size =
${METPLUS_BLOCK_SIZE}

//
// Ratio of valid matched pairs to compute statistics for a grid point
//
//vld_thresh =
${METPLUS_VLD_THRESH}

////////////////////////////////////////////////////////////////////////////////

//
// Statistical output types
//
//output_stats = {
${METPLUS_OUTPUT_STATS_DICT}

////////////////////////////////////////////////////////////////////////////////

//hss_ec_value =
${METPLUS_HSS_EC_VALUE}
rank_corr_flag = FALSE;

tmp_dir = "${MET_TMP_DIR}";

//version        = "V10.0";

////////////////////////////////////////////////////////////////////////////////

${METPLUS_MET_CONFIG_OVERRIDES}

Running METplus

This use case can be run two ways:

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

    run_metplus.py /path/to/METplus/parm/use_cases/model_applications/medium_range/MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.conf
    /path/to/user_system.conf
    
  2. Modifying the configurations in parm/metplus_config, then passing in MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.conf:

    run_metplus.py /path/to/METplus/parm/use_cases/model_applications/medium_range/MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.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

If the ‘convert’ executable is not in the user’s path, specify the full path to the executable here

  • CONVERT = /usr/bin/convert

Example User Configuration File:

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

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 series_analysis_lead directory relative to the OUTPUT_BASE, and in the following directories (relative to OUTPUT_BASE):

  • series_FHHH

  • series_animate

The series_FHHH subdirectory will contain files that have the following format:

OBS_FILES_FHHH

FCST_FILES_FHHH

series_Fhhh_to_FHHH_<varname>_<level>_<stat>.png

series_Fhhh_to_FHHH_<varname>_<level>_<stat>.ps

series_Fhhh_to_FHHH_<varname>_<level>_<stat>.nc

Where:

hhh is the starting forecast hour/lead time in hours

HHH is the ending forecast hour/lead time in hours

varname is the variable of interest, as specified in the METplus series_by_lead_all_fhrs config file

level is the level of interest, as specified in the METplus series_by_lead_all_fhrs config file

stat is the statistic of interest, as specified in the METplus series_by_lead_all_fhrs config file.

The series_animate directory contains the animations of the series analysis in .gif format for all variable, level, and statistics combinations:

series_animate_<varname>_<level>_<stat>.gif

Keywords

Note

  • MediumRangeAppUseCase

  • SeriesByLeadUseCase

  • MTDToolUseCase

  • RegridDataPlaneToolUseCase

  • SeriesAnalysisUseCase

  • GRIB2FileUseCase

  • FeatureRelativeUseCase

  • SBUOrgUseCase

  • DiagnosticsUseCase

  • RuntimeFreqUseCase

Navigate to the METplus Quick Search for Use Cases page to discover other similar use cases.

sphinx_gallery_thumbnail_path = ‘_static/medium_range-MTD_SeriesAnalysis_fcstGFS_obsGFS_FeatureRelative_SeriesByLead.png’

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

Gallery generated by Sphinx-Gallery