EnsembleStat: Basic Use Case

met_tool_wrapper/EnsembleStat/EnsembleStat.conf

Scientific Objective

To provide useful statistical information on the relationship between observation data (in both grid and point formats) to an ensemble forecast. These values can be used to help correct ensemble member deviations from observed values.

Datasets

Forecast: WRF ARW 24 hour precipitation accumulation
…met_test/data/sample_fcst/2009123112/
arw-fer-gep1/d01_2009123112_02400.grib
arw-fer-gep5/d01_2009123112_02400.grib
arw-sch-gep2/d01_2009123112_02400.grib
arw-sch-gep6/d01_2009123112_02400.grib
arw-tom-gep3/d01_2009123112_02400.grib
arw-tom-gep7/d01_2009123112_02400.grib
Gridded Observation: ST4 24 hour precipitation accumulation
met_test/data/sample_obs/ST4/sample_obs/ST4/ST4.2010010112.24h
Point Observation:
met_test/out/ascii2nc/precip24_2010010112.nc
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
The 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 EnsembleStat wrapper to search for files that are valid at a given run time and generate a command to run the MET tool EnsembleStat if all required files are found.

METplus Workflow

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

Init: 2009-12-31_12Z
Forecast lead: 24 hour

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/EnsembleStat/EnsembleStat.conf

[config]

# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/met_tool_wrapper/EnsembleStat/EnsembleStat.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 = EnsembleStat


###
# 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=2009123112
INIT_END=2009123112
INIT_INCREMENT=3600

LEAD_SEQ = 24H


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

FCST_ENSEMBLE_STAT_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst
FCST_ENSEMBLE_STAT_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/arw-???-gep?/d01_{init?fmt=%Y%m%d%H}_0{lead?fmt=%HH}00.grib

#ENSEMBLE_STAT_CTRL_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_fcst
#ENSEMBLE_STAT_CTRL_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/arw-fer-gep1/d01_{init?fmt=%Y%m%d%H}_0{lead?fmt=%HH}00.grib

OBS_ENSEMBLE_STAT_POINT_INPUT_DIR = {INPUT_BASE}/met_test/out/ascii2nc
OBS_ENSEMBLE_STAT_POINT_INPUT_TEMPLATE = precip24_{valid?fmt=%Y%m%d%H}.nc

OBS_ENSEMBLE_STAT_GRID_INPUT_DIR = {INPUT_BASE}/met_test/data/sample_obs/ST4
OBS_ENSEMBLE_STAT_GRID_INPUT_TEMPLATE = ST4.{valid?fmt=%Y%m%d%H}.24h

#ENSEMBLE_STAT_ENS_MEAN_INPUT_DIR =
#ENSEMBLE_STAT_ENS_MEAN_INPUT_TEMPLATE =

ENSEMBLE_STAT_CLIMO_MEAN_INPUT_DIR =
ENSEMBLE_STAT_CLIMO_MEAN_INPUT_TEMPLATE =

ENSEMBLE_STAT_CLIMO_STDEV_INPUT_DIR =
ENSEMBLE_STAT_CLIMO_STDEV_INPUT_TEMPLATE =


ENSEMBLE_STAT_OUTPUT_DIR = {OUTPUT_BASE}/ensemble
ENSEMBLE_STAT_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H%M}/ensemble_stat


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

MODEL = WRF
OBTYPE = MC_PCP


FCST_VAR1_NAME = APCP
FCST_VAR1_LEVELS = A24
FCST_VAR1_OPTIONS = ens_ssvar_bin_size = 0.1; ens_phist_bin_size = 0.05;


OBS_VAR1_NAME = {FCST_VAR1_NAME}
OBS_VAR1_LEVELS = {FCST_VAR1_LEVELS}
OBS_VAR1_OPTIONS = {FCST_VAR1_OPTIONS}


###
# EnsembleStat Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#ensemblestat
###

#LOG_ENSEMBLE_STAT_VERBOSITY = 2

ENSEMBLE_STAT_N_MEMBERS = 6

ENSEMBLE_STAT_CONFIG_FILE = {PARM_BASE}/met_config/EnsembleStatConfig_wrapped

ENSEMBLE_STAT_DESC = NA

ENSEMBLE_STAT_OBS_WINDOW_BEGIN = -5400
ENSEMBLE_STAT_OBS_WINDOW_END = 5400

ENSEMBLE_STAT_ENS_THRESH = 1.0

ENSEMBLE_STAT_VLD_THRESH = 1.0

ENSEMBLE_STAT_OUTPUT_PREFIX = 

#ENSEMBLE_STAT_MET_OBS_ERR_TABLE =

ENSEMBLE_STAT_REGRID_TO_GRID = NONE
ENSEMBLE_STAT_REGRID_METHOD = NEAREST
ENSEMBLE_STAT_REGRID_WIDTH = 1
ENSEMBLE_STAT_REGRID_VLD_THRESH = 0.5
ENSEMBLE_STAT_REGRID_SHAPE = SQUARE
#ENSEMBLE_STAT_REGRID_CONVERT =
#ENSEMBLE_STAT_REGRID_CENSOR_THRESH =
#ENSEMBLE_STAT_REGRID_CENSOR_VAL =

ENSEMBLE_STAT_CENSOR_THRESH =
ENSEMBLE_STAT_CENSOR_VAL =

#ENSEMBLE_STAT_PROB_CAT_THRESH =
#ENSEMBLE_STAT_PROB_PCT_THRESH = ==0.25
#ENSEMBLE_STAT_ECLV_POINTS = 0.05

ENSEMBLE_STAT_MESSAGE_TYPE = ADPSFC
#ENSEMBLE_STAT_OBS_THRESH =
ENSEMBLE_STAT_DUPLICATE_FLAG = NONE
ENSEMBLE_STAT_SKIP_CONST = False

ENSEMBLE_STAT_OBS_ERROR_FLAG = FALSE

ENSEMBLE_STAT_ENS_SSVAR_BIN_SIZE = 1.0
ENSEMBLE_STAT_ENS_PHIST_BIN_SIZE = 0.05

#ENSEMBLE_STAT_CLIMO_MEAN_FILE_NAME =
#ENSEMBLE_STAT_CLIMO_MEAN_FIELD =
#ENSEMBLE_STAT_CLIMO_MEAN_REGRID_METHOD =
#ENSEMBLE_STAT_CLIMO_MEAN_REGRID_WIDTH =
#ENSEMBLE_STAT_CLIMO_MEAN_REGRID_VLD_THRESH =
#ENSEMBLE_STAT_CLIMO_MEAN_REGRID_SHAPE =
#ENSEMBLE_STAT_CLIMO_MEAN_TIME_INTERP_METHOD =
#ENSEMBLE_STAT_CLIMO_MEAN_MATCH_MONTH =
#ENSEMBLE_STAT_CLIMO_MEAN_DAY_INTERVAL = 31
#ENSEMBLE_STAT_CLIMO_MEAN_HOUR_INTERVAL = 6

#ENSEMBLE_STAT_CLIMO_STDEV_FILE_NAME =
#ENSEMBLE_STAT_CLIMO_STDEV_FIELD =
#ENSEMBLE_STAT_CLIMO_STDEV_REGRID_METHOD =
#ENSEMBLE_STAT_CLIMO_STDEV_REGRID_WIDTH =
#ENSEMBLE_STAT_CLIMO_STDEV_REGRID_VLD_THRESH =
#ENSEMBLE_STAT_CLIMO_STDEV_REGRID_SHAPE =
#ENSEMBLE_STAT_CLIMO_STDEV_TIME_INTERP_METHOD =
#ENSEMBLE_STAT_CLIMO_STDEV_MATCH_MONTH =
#ENSEMBLE_STAT_CLIMO_STDEV_DAY_INTERVAL = 31
#ENSEMBLE_STAT_CLIMO_STDEV_HOUR_INTERVAL = 6

ENSEMBLE_STAT_CLIMO_CDF_BINS = 1
ENSEMBLE_STAT_CLIMO_CDF_CENTER_BINS = False
ENSEMBLE_STAT_CLIMO_CDF_WRITE_BINS = True
#ENSEMBLE_STAT_CLIMO_CDF_DIRECT_PROB =

ENSEMBLE_STAT_MASK_GRID = FULL
ENSEMBLE_STAT_MASK_POLY =
    MET_BASE/poly/HMT_masks/huc4_1605_poly.nc,
    MET_BASE/poly/HMT_masks/huc4_1803_poly.nc,
    MET_BASE/poly/HMT_masks/huc4_1804_poly.nc,
    MET_BASE/poly/HMT_masks/huc4_1805_poly.nc,
    MET_BASE/poly/HMT_masks/huc4_1806_poly.nc

ENSEMBLE_STAT_CI_ALPHA = 0.05

ENSEMBLE_STAT_INTERP_FIELD = BOTH
ENSEMBLE_STAT_INTERP_VLD_THRESH = 1.0
ENSEMBLE_STAT_INTERP_SHAPE = SQUARE
ENSEMBLE_STAT_INTERP_METHOD = NEAREST
ENSEMBLE_STAT_INTERP_WIDTH = 1

ENSEMBLE_STAT_OUTPUT_FLAG_ECNT = BOTH
ENSEMBLE_STAT_OUTPUT_FLAG_RPS = NONE
ENSEMBLE_STAT_OUTPUT_FLAG_RHIST = BOTH
ENSEMBLE_STAT_OUTPUT_FLAG_PHIST = BOTH
ENSEMBLE_STAT_OUTPUT_FLAG_ORANK = BOTH
ENSEMBLE_STAT_OUTPUT_FLAG_SSVAR = BOTH
ENSEMBLE_STAT_OUTPUT_FLAG_RELP = BOTH
#ENSEMBLE_STAT_OUTPUT_FLAG_PCT = BOTH
#ENSEMBLE_STAT_OUTPUT_FLAG_PSTD = BOTH
#ENSEMBLE_STAT_OUTPUT_FLAG_PJC = BOTH
#ENSEMBLE_STAT_OUTPUT_FLAG_PRC = BOTH
#ENSEMBLE_STAT_OUTPUT_FLAG_ECLV = BOTH

ENSEMBLE_STAT_NC_ORANK_FLAG_LATLON = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_MEAN = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_RAW = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_RANK = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_PIT = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_VLD_COUNT = TRUE
ENSEMBLE_STAT_NC_ORANK_FLAG_WEIGHT = FALSE

#ENSEMBLE_STAT_OBS_QUALITY_INC =
#ENSEMBLE_STAT_OBS_QUALITY_EXC =

#ENSEMBLE_STAT_ENS_MEMBER_IDS =
#ENSEMBLE_STAT_CONTROL_ID =

#ENSEMBLE_STAT_GRID_WEIGHT_FLAG =

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 EnsembleStat MET Configuration section of the User’s Guide for more information on the environment variables used in the file below:

////////////////////////////////////////////////////////////////////////////////
//
// Ensemble-Stat configuration file.
//
// For additional information, see the MET_BASE/config/README file.
//
////////////////////////////////////////////////////////////////////////////////

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

//
// Output description to be written
// May be set separately in each "obs.field" entry
//
${METPLUS_DESC}

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

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

//
// Verification grid
//
${METPLUS_REGRID_DICT}

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

//
// May be set separately in each "field" entry
//
${METPLUS_CENSOR_THRESH}
${METPLUS_CENSOR_VAL}
cat_thresh    = [];
nc_var_str    = "";

//ens_member_ids =
${METPLUS_ENS_MEMBER_IDS}

//control_id =
${METPLUS_CONTROL_ID}


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

//prob_cat_thresh =
${METPLUS_PROB_CAT_THRESH}

//prob_pct_thresh =
${METPLUS_PROB_PCT_THRESH}

//eclv_points =
${METPLUS_ECLV_POINTS}


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

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

fcst = {

   ${METPLUS_FCST_FILE_TYPE}
   ${METPLUS_ENS_THRESH}
   ${METPLUS_VLD_THRESH}
   ${METPLUS_FCST_FIELD}
}

obs = {

   ${METPLUS_OBS_FILE_TYPE}
 
   ${METPLUS_OBS_FIELD}
}

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

//
// Point observation filtering options
// May be set separately in each "obs.field" entry
//

${METPLUS_MESSAGE_TYPE}
sid_exc        = [];
//obs_thresh     = [ NA ];
${METPLUS_OBS_THRESH}

//obs_quality_inc =
${METPLUS_OBS_QUALITY_INC}

//obs_quality_exc =
${METPLUS_OBS_QUALITY_EXC}

${METPLUS_DUPLICATE_FLAG}
obs_summary    = NONE;
obs_perc_value = 50;
${METPLUS_SKIP_CONST}

//
// Observation error options
// Set dist_type to NONE to use the observation error table instead
// May be set separately in each "obs.field" entry
//
obs_error = {
   ${METPLUS_OBS_ERROR_FLAG}
   dist_type        = NONE;
   dist_parm        = [];
   inst_bias_scale  = 1.0;
   inst_bias_offset = 0.0;
   min              = NA;      // Valid range of data
   max              = NA;
}

//
// Mapping of message type group name to comma-separated list of values.
//
message_type_group_map = [
   { key = "SURFACE"; val = "ADPSFC,SFCSHP,MSONET";               },
   { key = "ANYAIR";  val = "AIRCAR,AIRCFT";                      },
   { key = "ANYSFC";  val = "ADPSFC,SFCSHP,ADPUPA,PROFLR,MSONET"; },
   { key = "ONLYSF";  val = "ADPSFC,SFCSHP";                      }
];

//
// Ensemble bin sizes
// May be set separately in each "obs.field" entry
//
${METPLUS_ENS_SSVAR_BIN_SIZE}
${METPLUS_ENS_PHIST_BIN_SIZE}

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

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


//climo_stdev = {
${METPLUS_CLIMO_STDEV_DICT}



//
// May be set separately in each "obs.field" entry
//
${METPLUS_CLIMO_CDF_DICT}

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

//
// Point observation time window
//
${METPLUS_OBS_WINDOW_DICT}

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

//
// Verification masking regions
//
mask = {
   ${METPLUS_MASK_GRID}
   ${METPLUS_MASK_POLY}
   sid   = [];
   llpnt = [];
}

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

//
// Confidence interval settings
//
${METPLUS_CI_ALPHA}

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

//
// Interpolation methods
//
${METPLUS_INTERP_DICT}

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

//
// Statistical output types
//
${METPLUS_OUTPUT_FLAG_DICT}

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

//
// Gridded verification output types
// May be set separately in each "obs.field" entry
//
${METPLUS_NC_ORANK_FLAG_DICT}

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

//
// Random number generator
//
rng = {
   type = "mt19937";
   seed = "1";
}

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

//grid_weight_flag =
${METPLUS_GRID_WEIGHT_FLAG}

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

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

tmp_dir = "${MET_TMP_DIR}";

${METPLUS_MET_CONFIG_OVERRIDES}

Running METplus

It is recommended to run this use case by:

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

run_metplus.py /path/to/METplus/parm/use_cases/met_tool_wrapper/EnsembleStat/EnsembleStat.conf /path/to/user_system.conf

The following METplus configuration variables must be set correctly to run this example.:

  • INPUT_BASE - Path to directory where sample data tarballs are unpacked (See Datasets section to obtain tarballs).

  • 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]
INPUT_BASE = /path/to/sample/input/data
OUTPUT_BASE = /path/to/output/dir
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 ensemble/200912311200/ensemble_stat (relative to OUTPUT_BASE) and will contain the following files:

  • ensemble_stat_20100101_120000V.stat

  • ensemble_stat_20100101_120000V_ecnt.txt

  • ensemble_stat_20100101_120000V_rhist.txt

  • ensemble_stat_20100101_120000V_phist.txt

  • ensemble_stat_20100101_120000V_orank.txt

  • ensemble_stat_20100101_120000V_ssvar.txt

  • ensemble_stat_20100101_120000V_relp.txt

  • ensemble_stat_20100101_120000V_ens.nc

  • ensemble_stat_20100101_120000V_orank.nc

Keywords

Note

  • EnsembleStatToolUseCase

  • PythonEmbeddingFileUseCase

  • EnsembleAppUseCase

  • ProbabilityGenerationAppUseCase

  • GRIBFileUseCase

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

sphinx_gallery_thumbnail_path = ‘_static/met_tool_wrapper-EnsembleStat.png’

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

Gallery generated by Sphinx-Gallery