[config]

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


###
# 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=2022051100
INIT_END=2022051200
INIT_INCREMENT=86400

LEAD_SEQ = begin_end_incr(0,36,1)

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

FCST_GRID_STAT_INPUT_DIR = {INPUT_BASE}/MET_output/GenEnsProd/HREF/
FCST_GRID_STAT_INPUT_TEMPLATE= {init?fmt=%Y%m%d%H}/gen_ens_prod_{valid?fmt=%Y%m%d}_{valid?fmt=%H%M%S}V_ens.nc

OBS_GRID_STAT_FILE_WINDOW_BEGIN = -100
OBS_GRID_STAT_FILE_WINDOW_END = 100
OBS_GRID_STAT_INPUT_DIR = {INPUT_BASE}/obs/mrms/raw
OBS_GRID_STAT_INPUT_TEMPLATE = {valid?fmt=%Y%m%d}/MergedReflectivityQCComposite_00.50_{valid?fmt=%Y%m%d}-{valid?fmt=%H%M%S}.grib2

GRID_STAT_OUTPUT_DIR = {OUTPUT_BASE}/GridStat/HREF_REFC_timeWindow
GRID_STAT_OUTPUT_TEMPLATE = {init?fmt=%Y%m%d%H}


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

MODEL = HREF
OBTYPE = MRMS

# GridStat
FCST_GRID_STAT_IS_PROB = true

FCST_GRID_STAT_VAR1_NAME = REFC_L0_ENS_FREQ_ge35.0
FCST_GRID_STAT_VAR1_LEVELS = "(*,*)"
FCST_GRID_STAT_PROB_THRESH = ge0.0, ge0.1, ge0.2, ge0.3, ge0.4, ge0.5, ge0.6, ge0.7, ge0.8, ge0.9, ge1.0

OBS_GRID_STAT_VAR1_NAME = MergedReflectivityQCComposite
OBS_GRID_STAT_VAR1_LEVELS = Z500 
OBS_GRID_STAT_VAR1_THRESH = ge35.0
OBS_GRID_STAT_VAR1_OPTIONS = censor_thresh = [eq-999, lt0&&ge-99]; censor_val = [-9999, 0];


###
# GridStat Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#gridstat
###

GRID_STAT_REGRID_TO_GRID = FCST
GRID_STAT_REGRID_METHOD = NEAREST
GRID_STAT_REGRID_WIDTH = 1
#GRID_STAT_REGRID_VLD_THRESH =
#GRID_STAT_REGRID_SHAPE =
#GRID_STAT_REGRID_CONVERT =
#GRID_STAT_REGRID_CENSOR_THRESH =
#GRID_STAT_REGRID_CENSOR_VAL =

#GRID_STAT_MASK_GRID = FULL
#GRID_STAT_MASK_POLY = 

GRID_STAT_OUTPUT_FLAG_PCT = STAT
GRID_STAT_OUTPUT_FLAG_PSTD = STAT
GRID_STAT_OUTPUT_FLAG_PJC = STAT
GRID_STAT_OUTPUT_FLAG_PRC = STAT

GRID_STAT_NC_PAIRS_FLAG_LATLON = FALSE
GRID_STAT_NC_PAIRS_FLAG_RAW = FALSE
GRID_STAT_NC_PAIRS_FLAG_DIFF = FALSE
GRID_STAT_NC_PAIRS_FLAG_CLIMO = FALSE
GRID_STAT_NC_PAIRS_FLAG_APPLY_MASK = FALSE

GRID_STAT_OUTPUT_PREFIX = PROB_{MODEL}_vs_{OBTYPE}_REFC


