Note
Go to the end to download the full example code
IODA2NC: Basic Use Case
met_tool_wrapper/IODA2NC/IODA2NC.conf
Scientific Objective
Convert IODA NetCDF files to MET NetCDF format.
Datasets
Input: IODA NetCDF observation
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 the Running METplus section for more information.
METplus Components
This use case utilizes the METplus IODA2NC wrapper to generate a command to run the MET tool ioda2nc if all required files are found.
METplus Workflow
IODA2NC is the only tool called in this example. It processes the following run time(s):
METplus Configuration
parm/use_cases/met_tool_wrapper/IODA2NC/IODA2NC.conf
[config]
# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/met_tool_wrapper/IODA2NC/IODA2NC.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 = IODA2NC
###
# 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 = VALID
VALID_TIME_FMT = %Y%m%d%H
VALID_BEG = 2020031012
VALID_END = 2020031012
VALID_INCREMENT = 6H
###
# File I/O
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#directory-and-filename-template-info
###
IODA2NC_INPUT_DIR = {INPUT_BASE}/met_test/new/ioda
IODA2NC_INPUT_TEMPLATE = ioda.NC001007.{valid?fmt=%Y%m%d%H}.nc
IODA2NC_OUTPUT_DIR = {OUTPUT_BASE}/ioda2nc
IODA2NC_OUTPUT_TEMPLATE = ioda.NC001007.{valid?fmt=%Y%m%d%H}.summary.nc
###
# IODA2NC Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#ioda2nc
###
#IODA2NC_VALID_BEG = {valid?fmt=%Y%m%d_%H?shift=-24H}
#IODA2NC_VALID_END = {valid?fmt=%Y%m%d_%H}
#IODA2NC_NMSG = 10
#IODA2NC_MESSAGE_TYPE =
#IODA2NC_MESSAGE_TYPE_MAP =
#IODA2NC_MESSAGE_TYPE_GROUP_MAP =
#IODA2NC_STATION_ID =
IODA2NC_OBS_WINDOW_BEG = -5400
IODA2NC_OBS_WINDOW_END = 5400
#IODA2NC_MASK_GRID =
#IODA2NC_MASK_POLY =
IODA2NC_ELEVATION_RANGE_BEG = -1000
IODA2NC_ELEVATION_RANGE_END = 100000
#IODA2NC_LEVEL_RANGE_BEG = 1
#IODA2NC_LEVEL_RANGE_END = 255
#IODA2NC_OBS_VAR =
IODA2NC_OBS_NAME_MAP =
{ key = "wind_direction"; val = "WDIR"; },
{ key = "wind_speed"; val = "WIND"; }
#IODA2NC_METADATA_MAP =
#IODA2NC_MISSING_THRESH = <=-1e9, >=1e9, ==-9999
IODA2NC_QUALITY_MARK_THRESH = 0
IODA2NC_TIME_SUMMARY_FLAG = True
IODA2NC_TIME_SUMMARY_RAW_DATA = True
IODA2NC_TIME_SUMMARY_BEG = 000000
IODA2NC_TIME_SUMMARY_END = 235959
IODA2NC_TIME_SUMMARY_STEP = 300
IODA2NC_TIME_SUMMARY_WIDTH = 600
IODA2NC_TIME_SUMMARY_GRIB_CODE =
IODA2NC_TIME_SUMMARY_OBS_VAR = "WIND"
IODA2NC_TIME_SUMMARY_TYPE = "min", "max", "range", "mean", "stdev", "median", "p80"
IODA2NC_TIME_SUMMARY_VLD_FREQ = 0
IODA2NC_TIME_SUMMARY_VLD_THRESH = 0.0
MET Configuration
Note
See the IODA2NC MET Configuration section of the User’s Guide for more information on the environment variables used in the file below.
parm/met_config/IODA2NCConfig_wrapped
////////////////////////////////////////////////////////////////////////////////
//
// IODA2NC configuration file.
//
// For additional information, please see the MET Users Guide.
//
////////////////////////////////////////////////////////////////////////////////
//
// IODA message type
//
// message_type = [
${METPLUS_MESSAGE_TYPE}
//
// Mapping of message type group name to comma-separated list of values
// Derive PRMSL only for SURFACE message types
//
// message_type_group_map = [
${METPLUS_MESSAGE_TYPE_GROUP_MAP}
//
// Mapping of input IODA message types to output message types
//
// message_type_map = [
${METPLUS_MESSAGE_TYPE_MAP}
//
// IODA station ID
//
// station_id = [
${METPLUS_STATION_ID}
////////////////////////////////////////////////////////////////////////////////
//
// Observation time window
//
// obs_window = {
${METPLUS_OBS_WINDOW_DICT}
////////////////////////////////////////////////////////////////////////////////
//
// Observation retention regions
//
// mask = {
${METPLUS_MASK_DICT}
////////////////////////////////////////////////////////////////////////////////
//
// Observing location elevation
//
// elevation_range = {
${METPLUS_ELEVATION_RANGE_DICT}
////////////////////////////////////////////////////////////////////////////////
//
// Vertical levels to retain
//
// level_range = {
${METPLUS_LEVEL_RANGE_DICT}
///////////////////////////////////////////////////////////////////////////////
//
// IODA variable names to retain or derive.
// Use obs_bufr_map to rename variables in the output.
// If empty or 'all', process all available variables.
//
// obs_var = [
${METPLUS_OBS_VAR}
////////////////////////////////////////////////////////////////////////////////
//
// Mapping of input IODA variable names to output variables names.
// The default IODA map, obs_var_map, is appended to this map.
//
// obs_name_map = [
${METPLUS_OBS_NAME_MAP}
//
// Default mapping for Metadata.
//
// metadata_map = [
${METPLUS_METADATA_MAP}
// missing_thresh = [
${METPLUS_MISSING_THRESH}
////////////////////////////////////////////////////////////////////////////////
// quality_mark_thresh =
${METPLUS_QUALITY_MARK_THRESH}
////////////////////////////////////////////////////////////////////////////////
//
// Time periods for the summarization
// obs_var (string array) is added and works like grib_code (int array)
// when use_var_id is enabled and variable names are saved.
//
// time_summary = {
${METPLUS_TIME_SUMMARY_DICT}
////////////////////////////////////////////////////////////////////////////////
tmp_dir = "${MET_TMP_DIR}";
//version = "V10.0";
////////////////////////////////////////////////////////////////////////////////
${METPLUS_MET_CONFIG_OVERRIDES}
Running METplus
Provide the use case .conf configuration file to the run_metplus.py script.
/path/to/METplus/parm/use_cases/met_tool_wrapper/IODA2NC/IODA2NC.conf
See the Running METplus section of the System Configuration chapter for more details.
Expected Output
A successful run will output the following to the screen and 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 met_tool_wrapper/ioda2nc (relative to OUTPUT_BASE) and will contain the following file(s):
ioda.NC001007.2020031012.summary.nc
Keywords
Note
IODA2NCToolUseCase
Navigate to METplus Quick Search for Use Cases to discover other similar use cases.
sphinx_gallery_thumbnail_path = ‘_static/met_tool_wrapper-IODA2NC.png’
Total running time of the script: (0 minutes 0.000 seconds)