Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

653 add pointstat met office configuration #1079

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -180M
ASCII2NC_WINDOW_END = 179M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Aircraft_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Aircraft_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
////////////////////////////////////////////////////////////////////////////////
//
// Default ascii2nc configuration file
//
////////////////////////////////////////////////////////////////////////////////

//
// The parameters listed below are used to summarize the ASCII data read in
//

//
// Time periods for the summarization
// obs_var (string array) is added and works like grib_code (int array)
// when the obs name is given instead of grib_code
//
${METPLUS_TIME_SUMMARY_DICT}

//
// Mapping of input little_r report types to output message types
//
message_type_map = [
{ key = "FM-12 SYNOP"; val = "ADPSFC"; },
{ key = "FM-13 SHIP"; val = "SFCSHP"; },
{ key = "FM-15 METAR"; val = "ADPSFC"; },
{ key = "FM-18 BUOY"; val = "SFCSHP"; },
{ key = "FM-281 QSCAT"; val = "ASCATW"; },
{ key = "FM-32 PILOT"; val = "ADPUPA"; },
{ key = "FM-35 TEMP"; val = "ADPUPA"; },
{ key = "FM-88 SATOB"; val = "SATWND"; },
{ key = "FM-97 ACARS"; val = "AIRCFT"; }
];

//message_type_group_map = [
// { key = "SURFACE"; val = "METAR"; }
// ];
//
// Indicate a version number for the contents of this configuration file.
// The value should generally not be modified.
//
//version = "V10.0";

${METPLUS_MET_CONFIG_OVERRIDES}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -180M
ASCII2NC_WINDOW_END = 179M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Sonde_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Sonde_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -180M
ASCII2NC_WINDOW_END = 179M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Satwind_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Satwind_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -30M
ASCII2NC_WINDOW_END = 30M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Srew_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Srew_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -150M
ASCII2NC_WINDOW_END = 30M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Surface_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Surface_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -150M
ASCII2NC_WINDOW_END = 30M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}Stn/Surface_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/SurfaceStn_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -30M
ASCII2NC_WINDOW_END = 30M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Surface_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/Surface_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[config]

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -30M
ASCII2NC_WINDOW_END = 30M

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}Stn/Surface_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/SurfaceStn_{valid?fmt=%Y%m%d}T{valid?fmt=%H}00Z.nc
115 changes: 115 additions & 0 deletions cset-workflow/app/metplus_ascii2nc/file/metoffice/ascii2nc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[config]
## Configuration-related settings such as the process list, begin and end times, etc.

# List of applications to run - only ASCII2NC for this case
PROCESS_LIST = ASCII2NC

# time looping - 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
LOOP_BY = VALID

# Format of VALID_BEG and VALID_END using % items
# %Y = 4 digit year, %m = 2 digit month, %d = 2 digit day, etc.
# see www.strftime.org for more information
# %Y%m%d%H expands to YYYYMMDDHH
VALID_TIME_FMT = %Y%m%d%H

# Start time for METplus run - must match VALID_TIME_FMT
VALID_BEG = {ENV[TASK_INIT_TIME]}

# End time for METplus run - must match VALID_TIME_FMT
VALID_END = {ENV[TASK_END_TIME]}

# Increment between METplus runs (in seconds if no units are specified)
# Must be >= 60 seconds
VALID_INCREMENT = 60M

# List of forecast leads to process for each run time (init or valid)
# If unset, defaults to 0 (don't loop through forecast leads
LEAD_SEQ = begin_end_incr(0,{ENV[FORECATS_LENGTH]},1)

# Order of loops to process data - Options are times, processes
# Not relevant if only one item is in the PROCESS_LIST
# times = run all wrappers in the PROCESS_LIST for a single run time, then
# increment the run time and run all wrappers again until all times have
# been evaluated.
# processes = run the first wrapper in the PROCESS_LIST for all times
# specified, then repeat for the next item in the PROCESS_LIST until all
# wrappers have been run
LOOP_ORDER = times

# Verbosity of MET output - overrides LOG_VERBOSITY for ASCII2NC only
LOG_ASCII2NC_VERBOSITY = 4

# MET Configuration file for ASCII2NC
# References CONFIG_DIR from the [dir] section
#ASCII2NC_CONFIG_FILE = {CONFIG_DIR}/Ascii2NcConfig_wrapped
ASCII2NC_CONFIG_FILE =/data/users/cfrd/METplus_playaround/Ascii2NcConfig_Robversion

# Time relative to valid time (in seconds if no units are specified) to allow files to be considered
# valid. Set both BEGIN and END to 0 to require the exact time in the filename
# Not used in this example.
ASCII2NC_FILE_WINDOW_BEGIN = 0
ASCII2NC_FILE_WINDOW_END = 0

# Time relative to each input file's valid time (in seconds if no units are specified) for data within the file to be
# considered valid.
ASCII2NC_WINDOW_BEGIN = -150M
ASCII2NC_WINDOW_END = 30M

# Value to pass with the -format argument to ascii2nc. See MET User's Guide for more information
ASCII2NC_INPUT_FORMAT =

# Value to pass with the -mask_grid argument to ascii2nc. See MET User's Guide for more information
ASCII2NC_MASK_GRID =

# Value to pass with the -mask_poly argument to ascii2nc. See MET User's Guide for more information
ASCII2NC_MASK_POLY =

# Value to pass with the -mask_sid argument to ascii2nc. See MET User's Guide for more information
ASCII2NC_MASK_SID =

ASCII2NC_MESSAGE_TYPE =

# For defining the time periods for summarization
# False for no time summary, True otherwise
# The rest of the ASCII2NC_TIME_SUMMARY variables are ignored if set to False
# See the MET User's Guide section regarding ASCII2NC time summary options for more information.
ASCII2NC_TIME_SUMMARY_FLAG = False
ASCII2NC_TIME_SUMMARY_RAW_DATA = False
ASCII2NC_TIME_SUMMARY_BEG = 000000
ASCII2NC_TIME_SUMMARY_END = 235959
ASCII2NC_TIME_SUMMARY_STEP = 300
ASCII2NC_TIME_SUMMARY_WIDTH = 600
ASCII2NC_TIME_SUMMARY_GRIB_CODES =
ASCII2NC_TIME_SUMMARY_VAR_NAMES =
ASCII2NC_TIME_SUMMARY_TYPES = min, max, range, mean, stdev, median, p80
ASCII2NC_TIME_SUMMARY_VALID_FREQ = 0
ASCII2NC_TIME_SUMMARY_VALID_THRESH = 0.0


# End of [config] section and start of [dir] section
[dir]
# location of configuration files used by MET applications
#CONFIG_DIR={PARM_BASE}/met_config

# Input/Output directories can be left empty if the corresponding template contains the full path to the files
ASCII2NC_INPUT_DIR =
ASCII2NC_OUTPUT_DIR =

# End of [dir] section and start of [filename_templates] section
[filename_templates]

# Template to look for input to ASCII2NC relative to ASCII2NC_INPUT_DIR
#ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_OBSERVATION}/Surface_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii
#ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_RAWOB}/Sonde_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii
#ASCII2NC_INPUT_TEMPLATE = {INPUT_BASE_RAWOB}/Aircraft_{valid?fmt=%Y%m%d}_{valid?fmt=%H}00.ascii

# Template to use to write output from ASCII2NC
#ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE_OBSERVATION}/lndsyn_{valid?fmt=%Y%m%d%H}.nc
#ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE}/ascii2nc_canned_global/lndsyn_{valid?fmt=%Y%m%d%H}.nc
#ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE}/ascii2nc_canned_global/sonde_{valid?fmt=%Y%m%d%H}.nc
#ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE}/ascii2nc_canned_global/aircraft_{valid?fmt=%Y%m%d%H}.nc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[dir]
# any {ENV[]} variable is defined within [env] section of the rose-app.conf

INPUT_BASE_OBSERVATION = {ENV[ASCII_INOB]}
OUTPUT_BASE_OBSERVATION = {ENV[ASCII_OUTOB]}

OUTPUT_BASE={ENV[metout]}

MET_INSTALL_DIR={ENV[VERSION_MET]}

# TIMESTRING is linked to whattime in rose-app.conf, linked to the suite.rc so that the time formats in the suite.rc and the METplus' PointStat.conf match up.
TIMESTRING={ENV[DATESTAMP]}

# Additional config files required to run Ascii2nc
ADD_CONFIG={ENV[ADD_CONFIG_ASC]}/{ENV[MET_config_ASC]}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ PROCESS_LIST = ASCII2NC
###

LOOP_BY = INIT
INIT_TIME_FMT = %Y%m%dT%H
INIT_BEG = {ENV[TASK_TIME]}
INIT_END = {ENV[TASK_ENDTIME]}
INIT_TIME_FMT = %Y%m%d%H
INIT_BEG = {ENV[TASK_INIT_TIME]}
INIT_END = {ENV[TASK_END_TIME]}
INIT_INCREMENT = 6H

LEAD_SEQ = begin_end_incr(0,5,1)
Expand All @@ -44,25 +44,11 @@ LEAD_SEQ = begin_end_incr(0,5,1)
# File I/O
# https://metplus.readthedocs.io/en/latest/Users_Guide/systemconfiguration.html#directory-and-filename-template-info
###

ASCII2NC_INPUT_DIR =
ASCII2NC_INPUT_TEMPLATE = "python/{ENV[INPUT_READ_SCRIPT]} {INPUT_BASE}"

ASCII2NC_OUTPUT_DIR =
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE}/obs_{TIME_START}.nc

ASCII2NC_SKIP_IF_OUTPUT_EXISTS = False

ASCII2NC_FILE_WINDOW_BEGIN = 0
ASCII2NC_FILE_WINDOW_END = 0


###########################################
ASCII2NC_FILE_WINDOW_BEGIN = -1800
ASCII2NC_FILE_WINDOW_END = 1800

ASCII2NC_INPUT_DIR =
ASCII2NC_INPUT_TEMPLATE = "python/{ENV[INPUT_READ_SCRIPT]} {INPUT_BASE}/Surface.NiwaList.{init?fmt=%Y%m%dT%2H} {valid?fmt=%Y%m%dT%2H?shift=-10800}00 {ASCII2NC_FILE_WINDOW_BEGIN} {ASCII2NC_FILE_WINDOW_END}"
ASCII2NC_INPUT_TEMPLATE = "niwa/python/{ENV[INPUT_READ_SCRIPT]} {INPUT_BASE}/Surface.NiwaList.{init?fmt=%Y%m%dT%2H} {valid?fmt=%Y%m%dT%2H?shift=-10800}00 {ASCII2NC_FILE_WINDOW_BEGIN} {ASCII2NC_FILE_WINDOW_END}"

ASCII2NC_OUTPUT_DIR =
ASCII2NC_OUTPUT_TEMPLATE = {OUTPUT_BASE}/obs_nc/ascii2nc_python_niwa_{valid?fmt=%Y%m%dT%2H?shift=-10800}00.nc
Expand Down
11 changes: 11 additions & 0 deletions cset-workflow/app/metplus_ascii2nc/opt/rose-app-metoffice.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[command]
default=app_env_wrapper run_metplus.py metoffice/ascii2nc.conf metoffice/Ascii2nc_${metplus_obs_type}.conf metoffice/user_system_local.conf

[env]
CONDA_VENV_LOCATION = ${CONDA_METPLUS_VENV_LOCATION}
METPLUS_OBS_DIR = ${METPLUS_OBS_DIR}
ASCII_INOB = ${METPLUS_OBS_DIR}
ASCII_OUTOB =
metout =
VERSION_MET = ${MET_INSTALL_DIR}
DATESTAMP = ${TASK_INIT_TIME}
6 changes: 3 additions & 3 deletions cset-workflow/app/metplus_ascii2nc/opt/rose-app-niwa.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[command]
default=app_env_wrapper run_metplus.py ASCII2NC_python_embedding.conf
default=app_env_wrapper run_metplus.py niwa/ASCII2NC_python_embedding.conf

[env]
CONDA_VENV_LOCATION = ${CONDA_METPLUS_VENV_LOCATION}
METPLUS_OBS_DIR=${METPLUS_OBS_DIR}
INPUT_READ_SCRIPT=restricted_read_ascii_point_niwa.py
TASK_TIME=20230705T00
TASK_ENDTIME=20230706T18
TASK_INIT_TIME=$TASK_INIT_TIME
TASK_END_TIME=$TASK_END_TIME
Loading
Loading