.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_model_applications_pbl_PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.py: GenVxMask and Point-Stat: Computing PBLH from AMDAR data using "Theta-increase" method ====================================================================================== model_applications/pbl/PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.conf .. GENERATED FROM PYTHON SOURCE LINES 9-13 .. contents:: :depth: 1 :local: :backlinks: none .. GENERATED FROM PYTHON SOURCE LINES 15-28 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. .. GENERATED FROM PYTHON SOURCE LINES 30-34 Version Added ------------- METplus version 6.0 .. GENERATED FROM PYTHON SOURCE LINES 36-42 Datasets -------------------- Forecast: HRRR, RRFS (reads the "HPBL" grib2 field) Observation: AMDAR hourly 1-d netcdf files .. GENERATED FROM PYTHON SOURCE LINES 44-52 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 data MET via python embedding. The configuration file also filters output through static geographic masks generated by GenVxMask. .. GENERATED FROM PYTHON SOURCE LINES 54-64 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 .. GENERATED FROM PYTHON SOURCE LINES 64-67 .. code-block:: default # PointStat is run with Python embedding (calc_amdar_pblh.py). .. GENERATED FROM PYTHON SOURCE LINES 68-77 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 .. GENERATED FROM PYTHON SOURCE LINES 79-95 MET Configuration ----------------- METplus sets environment variables based on user settings in the METplus configuration file. See :ref:`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: :ref:`Overriding Unsupported MET config file settings` .. note:: See the :ref:`PointStat MET Configuration` 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 .. GENERATED FROM PYTHON SOURCE LINES 97-107 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 .. GENERATED FROM PYTHON SOURCE LINES 109-133 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. .. GENERATED FROM PYTHON SOURCE LINES 135-148 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 .. GENERATED FROM PYTHON SOURCE LINES 150-163 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' .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_generated_model_applications_pbl_PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: PointStat_fcstHRRR_obsAMDAR_PBLH_PyEmbed.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_