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

Feature 2198 use case amdar pbl #2206

Merged
merged 25 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
50b302b
initial AMDAR PBLH METexpress point-stat use case commit
jason-english Jun 7, 2023
dd13e9f
adding quicksearch
jason-english Jun 8, 2023
606bc1b
fixed underline length in doc file
jason-english Jun 8, 2023
98d355c
fixed error in default masking radius
jason-english Jun 8, 2023
ada08e9
Setting the new use case to run in the automated tests for now.
DanielAdriaansen Jun 8, 2023
1798cdb
changed OBS path in conf file
jason-english Jun 9, 2023
fee0b4d
Merge branch 'feature_2198_useCase_AMDAR_pbl' of https://github.com/d…
jason-english Jun 9, 2023
226dd48
fixed FCST and mask subdirectories too
jason-english Jun 9, 2023
8b83ebe
Missing file suffix for NetCDF file for GenVxMask ci-skip-unit-tests …
DanielAdriaansen Jun 9, 2023
872548f
Missing dated subdirectory for GenVxMask input file.
DanielAdriaansen Jun 9, 2023
a06897b
Mistakenly thought the file suffix was missing but in reality a subdi…
DanielAdriaansen Jun 9, 2023
7780ecf
More changes to try and get GenVxMask to work.
DanielAdriaansen Jun 12, 2023
a4ce0ac
Typo in GEN_VX_MASK_OUTPUT_TEMPLATE.
DanielAdriaansen Jun 12, 2023
4eeb442
We don't need to import the met_point_obs class anymore.
DanielAdriaansen Jun 12, 2023
f58cccb
Changes the Python Embedding script to point to the one for the use c…
DanielAdriaansen Jun 13, 2023
f436d82
point_stat should work with an object named point_data and convert it…
DanielAdriaansen Jun 13, 2023
8390c11
Convert to proper object.
DanielAdriaansen Jun 13, 2023
5074c08
Forgot to remove print statement for wrong object.
DanielAdriaansen Jun 13, 2023
cd77e9b
Removes old code not needed with the latest version of MET.
DanielAdriaansen Jun 13, 2023
fbaf765
Moves time formatting into a template configuration item instead of a…
DanielAdriaansen Jun 16, 2023
3bc07c9
docs typos and cleaned up conf file including new mask radius variable
jason-english Jul 5, 2023
00d086c
Changed INPUT_BASE back to PARM_BASE for Python script, and removed e…
DanielAdriaansen Jul 5, 2023
01b39c6
Adding missing subdirectory.
DanielAdriaansen Jul 6, 2023
0c16940
Merge branch 'develop' into feature_2198_useCase_AMDAR_pbl
georgemccabe Jul 6, 2023
feef26e
turn off use case group for all runs
georgemccabe Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/parm/use_case_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@
"index_list": "9",
"run": false
},
{
"category": "pbl",
"index_list": "0",
"run": true
},
{
"category": "precipitation",
"index_list": "0",
Expand Down
2 changes: 2 additions & 0 deletions docs/Users_Guide/quicksearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Use Cases by Application:
| `Land Surface <../search.html?q=LandSurfaceAppUseCase&check_keywords=yes&area=default>`_
| `Marine and Cryosphere <../search.html?q=MarineAndCryosphereAppUseCase&check_keywords=yes&area=default>`_
| `Medium Range <../search.html?q=MediumRangeAppUseCase&check_keywords=yes&area=default>`_
| `PBL <../search.html?q=PBLAppUseCase&check_keywords=yes&area=default>`_
| `Precipitation <../search.html?q=PrecipitationAppUseCase&check_keywords=yes&area=default>`_
| `Space Weather <../search.html?q=SpaceWeatherAppUseCase&check_keywords=yes&area=default>`_
| `Subseasonal to Seasonal <../search.html?q=S2SAppUseCase&check_keywords=yes&area=default>`_
Expand All @@ -95,6 +96,7 @@ Use Cases by Application:
| **LandSurface**: *LandSurfaceAppUseCase*
| **Marine and Cryosphere**: *MarineAndCryosphereAppUseCase*
| **Medium Range**: *MediumRangeAppUseCase*
| **PBL**: *PBLAppUseCase*
| **Precipitation**: *PrecipitationAppUseCase*
| **Space Weather**: *SpaceWeatherAppUseCase*
| **Subseasonal to Seasonal**: *S2SAppUseCase*
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
"""
GenVxMask and Point-Stat: Computing PBLH from AMDAR data using "Theta-increase" method
======================================================================================

model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf

"""
##############################################################################
# Scientific Objective
# --------------------
#
# The Planetary Boundary Layer Height (PBLH) arises from a complex interaction of
# lower atmosphere and surface processes, and is therefore a useful metric to
# evaluate models. This PointStat use case computes PBLH from AMDAR aircraft data
# using the "Theta-increase" method (Nielsen-Gammon et al., 2008, J. App. Met. Clim.),
# which computes PBLH by finding the lowest altitude in an aircraft profile that
# exceeds a specified increase in potential temperature from a base value.
# Generally this theta-increase (pt_delta) ranges from 1.0-2.5 K. The pt_delta,
# list of airports to process, and sounding are specified in the configuration
# script.
#

##############################################################################
# Datasets
# --------------------
#
# Forecast: HRRR, RRFS (reads the "HPBL" grib2 field)
# Observation: AMDAR hourly 1-d netcdf files
#

##############################################################################
# METplus Components
# --------------------
#
# This use case utilizes GenVxMask and the METplus PointStat tool to compare PBLH
# from AMDAR data to model output. The python embedding script "calc_amdar_pblh.py"
# computes PBLH and sends ascii table to MET. The configuration file also filters
jason-english marked this conversation as resolved.
Show resolved Hide resolved
# output through statics geographic masks generated by GenVxMask.
jason-english marked this conversation as resolved.
Show resolved Hide resolved
#

##############################################################################
# METplus Workflow
# --------------------
# GenVxMask and PointStat are called in this example. The following run times are processed:
#
# | **Valid:** 2022-07-01_20Z
# | **Forecast lead:** 12 hour
#
# GenVxMask input file is a two-row text file (met_mask_AIRPORT.txt): row 1: AIRPORT row 2: lat lon
# GenVxMask output file is a netcdf file w/ geographic radius part of the file name (met_mask_AIRPORT_100km.nc)
# Input file provided in this example: (met_mask_DENVER.txt): row 1: DENVER row2: 39.856 -104.6764

# PointStat is run with Python embedding (calc_amdar_pblh.py).

##############################################################################
# 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/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/use_cases/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf

##############################################################################
# MET Configuration
# -----------------
#
# METplus sets environment variables based on user settings in the METplus configuration file.
# See :ref:`How METplus controls MET config file settings<metplus-control-met>` 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:
# :ref:`Overriding Unsupported MET config file settings<met-config-overrides>`
#
# .. note:: See the :ref:`PointStat MET Configuration<point-stat-met-conf>` section of the User's Guide for more information on the environment variables used in the file below:
#
# .. highlight:: bash
# .. literalinclude:: ../../../../parm/met_config/PointStatConfig_wrapped
#

##############################################################################
# Python Embedding
# -----------------
#
# This use case uses a Python embedding script to read input data
#
# parm/use_cases/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed/calc_amdar_pblh.py
#
# .. highlight:: python
# .. literalinclude:: ../../../../parm/use_cases/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed/calc_amdar_pblh.py
#

##############################################################################
# Running METplus
# ---------------
#
# It is recommended to run this use case by:
#
# Passing in PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf then a user-specific system configuration file::
#
# run_metplus.py -c /path/to/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf -c /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 point_stat_pblh (relative to **OUTPUT_BASE**)
# with subdirectories for valid time (YYYYMMDD) and will contain .stat files with the following naming convention:
#
# convention: point_stat_{AIRPORT}_{SOUNDING_FLAG}_{PT_DELTA}_{LEADTIME}L_{VALIDTIME}.stat
# example: point_stat_DENVER_ALL_1.25_120000L_20220701_200000V.stat

##############################################################################
# Keywords
# --------
#
# .. note::
#
# * GenVxMaskToolUseCase
# * PointStatToolUseCase
# * PythonEmbeddingFileUseCase
# * PBLAppUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
# sphinx_gallery_thumbnail_path = '_static/pbl-PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.png'
3 changes: 3 additions & 0 deletions docs/use_cases/model_applications/pbl/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Planetary Boundary Layer
------------------------
Planetary Boundary Layer (PBL) applications
3 changes: 3 additions & 0 deletions internal/tests/use_cases/all_use_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ Category: medium_range
9::GridStat_fcstGEFS_obsCADB_BinaryObsPOE:: model_applications/medium_range/GridStat_fcstGEFS_obsCADB_BinaryObsPOE.conf:: netcdf4_env


Category: pbl
0::PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed:: model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf

Category: precipitation
0::GenEnsProd_fcstHRRRE_FcstOnly_NetCDF:: model_applications/precipitation/GenEnsProd_fcstHRRRE_FcstOnly_NetCDF.conf
1::GridStat_fcstHREFmean_obsStgIV_Gempak:: model_applications/precipitation/GridStat_fcstHREFmean_obsStgIV_Gempak.conf:: gempak_env
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
[config]

# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/met_tool_wrapper/PointStat/PointStat_python_embedding_obs.html
jason-english marked this conversation as resolved.
Show resolved Hide resolved

# 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 = GenVxMask, PointStat

###
# 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 = 2022070108
INIT_END = 2022070108
#INIT_BEG = 2022070701
#INIT_END = 2022073123
jason-english marked this conversation as resolved.
Show resolved Hide resolved
INIT_INCREMENT = 1H

LEAD_SEQ = 12
#LEAD_SEQ = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18

# USER SETTINGS HERE
# CUSTOM_LOOP_LIST = DENVER, DALLAS, BOSTON, MINNEAPOLIS [list of airports sepearated by commas; each needs a mask file]
# PY_SOUNDING_FLAG = ALL, ASC, DESC [only one value here]
# PY_PT_DELTA = Potential Temperature delta setting (K) [usually 1.0-2.5]
# Valid_Time(YYYYMMDD_HHMMSS)
CUSTOM_LOOP_LIST = DENVER
PY_SOUNDING_FLAG = ALL
PY_PT_DELTA = 1.25
PY_VAL_TIME = {valid?fmt=%Y%m%d_%H0000}

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

GEN_VX_MASK_INPUT_DIR = {INPUT_BASE}/model_applications/pbl
GEN_VX_MASK_INPUT_TEMPLATE = pblh_22{init?fmt=%j}{init?fmt=%H}0000{lead?fmt=%HH}
GEN_VX_MASK_INPUT_MASK_DIR = {INPUT_BASE}/model_applications/pbl
GEN_VX_MASK_INPUT_MASK_TEMPLATE = met_mask_{custom?fmt=%s}.txt

GEN_VX_MASK_OUTPUT_DIR = {INPUT_BASE}/model_applications/pbl
GEN_VX_MASK_OUTPUT_TEMPLATE = {INPUT_BASE}/model_applications/pbl/met_mask_{custom?fmt=%s}_100km.nc

FCST_POINT_STAT_INPUT_DIR = {INPUT_BASE}/model_applications/pbl
FCST_POINT_STAT_INPUT_TEMPLATE = {init?fmt=%Y%m%d%H}/pblh_22{init?fmt=%j}{init?fmt=%H}0000{lead?fmt=%HH}

OBS_POINT_STAT_INPUT_DIR =
OBS_POINT_STAT_INPUT_TEMPLATE = PYTHON_NUMPY= {INPUT_BASE}/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed/calc_amdar_pblh.py {INPUT_BASE}/model_applications/pbl/22{valid?fmt=%j}{valid?fmt=%H}00q.cdf
DanielAdriaansen marked this conversation as resolved.
Show resolved Hide resolved

POINT_STAT_OUTPUT_DIR = {OUTPUT_BASE}/point_stat_pblh
POINT_STAT_OUTPUT_TEMPLATE = {valid?fmt=%Y%m%d}

POINT_STAT_CLIMO_MEAN_INPUT_DIR =
POINT_STAT_CLIMO_MEAN_INPUT_TEMPLATE =

POINT_STAT_CLIMO_STDEV_INPUT_DIR =
POINT_STAT_CLIMO_STDEV_INPUT_TEMPLATE =


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

POINT_STAT_ONCE_PER_FIELD = False

#POINT_STAT_FCST_FILE_TYPE =
#POINT_STAT_OBS_FILE_TYPE =

FCST_VAR1_NAME = HPBL
FCST_VAR1_LEVELS = L0
FCST_VAR1_THRESH = <=0, >10000
OBS_VAR1_NAME = HPBL
OBS_VAR1_LEVELS = L0
OBS_VAR1_THRESH = <=0, >10000
OBS_VAR1_OPTIONS = set_attr_units = "m"


###
# GenVxMask Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#genvxmask
###

GEN_VX_MASK_SKIP_IF_OUTPUT_EXISTS = True
GEN_VX_MASK_OPTIONS = -type "circle" -thresh le100
jason-english marked this conversation as resolved.
Show resolved Hide resolved

# PointStat Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#pointstat
###

LOG_POINT_STAT_VERBOSITY = 4

POINT_STAT_CONFIG_FILE ={PARM_BASE}/met_config/PointStatConfig_wrapped

#POINT_STAT_OBS_QUALITY_INC = 1, 2, 3
#POINT_STAT_OBS_QUALITY_EXC =

POINT_STAT_CLIMO_MEAN_TIME_INTERP_METHOD = NEAREST
#POINT_STAT_CLIMO_STDEV_TIME_INTERP_METHOD =

#POINT_STAT_INTERP_VLD_THRESH =
#POINT_STAT_INTERP_SHAPE =
POINT_STAT_INTERP_TYPE_METHOD = BILIN
POINT_STAT_INTERP_TYPE_WIDTH = 2

#POINT_STAT_OUTPUT_FLAG_FHO =
#POINT_STAT_OUTPUT_FLAG_CTC =
#POINT_STAT_OUTPUT_FLAG_CTS =
#POINT_STAT_OUTPUT_FLAG_MCTC =
#POINT_STAT_OUTPUT_FLAG_MCTS =
#POINT_STAT_OUTPUT_FLAG_CNT =
POINT_STAT_OUTPUT_FLAG_SL1L2 = STAT
#POINT_STAT_OUTPUT_FLAG_SAL1L2 =
POINT_STAT_OUTPUT_FLAG_VL1L2 = STAT
#POINT_STAT_OUTPUT_FLAG_VAL1L2 =
#POINT_STAT_OUTPUT_FLAG_VCNT =
#POINT_STAT_OUTPUT_FLAG_PCT =
#POINT_STAT_OUTPUT_FLAG_PSTD =
#POINT_STAT_OUTPUT_FLAG_PJC =
#POINT_STAT_OUTPUT_FLAG_PRC =
#POINT_STAT_OUTPUT_FLAG_ECNT =
#POINT_STAT_OUTPUT_FLAG_RPS =
#POINT_STAT_OUTPUT_FLAG_ECLV =
POINT_STAT_OUTPUT_FLAG_MPR = STAT
#POINT_STAT_OUTPUT_FLAG_ORANK =

#POINT_STAT_CLIMO_CDF_BINS = 1
#POINT_STAT_CLIMO_CDF_CENTER_BINS = False
#POINT_STAT_CLIMO_CDF_WRITE_BINS = True
#POINT_STAT_CLIMO_CDF_DIRECT_PROB =

#POINT_STAT_HSS_EC_VALUE =

OBS_POINT_STAT_WINDOW_BEGIN = -3600
OBS_POINT_STAT_WINDOW_END = 3600

POINT_STAT_OFFSETS = 0

MODEL = HRRR

POINT_STAT_DESC = {PY_SOUNDING_FLAG}_{PY_PT_DELTA}
OBTYPE =

POINT_STAT_REGRID_TO_GRID = NONE
POINT_STAT_REGRID_METHOD = BILIN
POINT_STAT_REGRID_WIDTH = 2

POINT_STAT_OUTPUT_PREFIX = {custom?fmt=%s}_{PY_SOUNDING_FLAG}_{PY_PT_DELTA}

#POINT_STAT_OBS_VALID_BEG = {valid?fmt=%Y%m%d_%H}
#POINT_STAT_OBS_VALID_END = {valid?fmt=%Y%m%d_%H}

#POINT_STAT_MASK_GRID = FULL
#POINT_STAT_MASK_POLY =
POINT_STAT_MASK_GRID =
POINT_STAT_MASK_POLY = {INPUT_BASE}/model_applications/pbl/met_mask_{custom?fmt=%s}_100km.nc
POINT_STAT_MASK_SID =
#POINT_STAT_MASK_LLPNT =

POINT_STAT_MESSAGE_TYPE = ADPSFC

#POINT_STAT_HIRA_FLAG =
#POINT_STAT_HIRA_WIDTH =
#POINT_STAT_HIRA_VLD_THRESH =
#POINT_STAT_HIRA_COV_THRESH =
#POINT_STAT_HIRA_SHAPE =
#POINT_STAT_HIRA_PROB_CAT_THRESH =

#POINT_STAT_MESSAGE_TYPE_GROUP_MAP =

# INFO TO PASS TO PYTHON SCRIPT
[user_env_vars]

AIRPORT = {custom?fmt=%s}
SOUNDING_FLAG = {PY_SOUNDING_FLAG}
PT_DELTA = {PY_PT_DELTA}
VAL_TIME = {PY_VAL_TIME}
Loading