Note
Go to the end to download the full example code.
GenVxMask: Solar Altitude
model_applications/space_weather/GenVxMask_fcstGloTEC_solar_altitude.conf
Overview
This use case illustrates the use of the gen_vx_mask tool for the space weather domain. It creates a mask for region where the solar altitude angle is less than 45 degrees (low sun angle or sun below the horizon), only letting data through for the region where the sun is high in the sky (i.e., solar altitude angle greater than 45 degrees).
In this use case, the input data is the GloTEC model run assimilated with COSMIC-1 RO data.
This use case runs gen_vx_mask for a couple forecast times from a space weather event known as the St. Patrick’s Day Storm (Mar 17, 2015).
- Novel aspects of this use case:
First example use case to run gen_vx_mask on a space weather model (GloTEC)
Example of how to run gen_vx_mask on NetCDF input data which do not strictly conform to the Climate Forecasts (CF) conventions
Example of constructing a mask based on the solar altitude angle.
Changing the mask condition to solar alt <= 0 will mask out the night region.
Changing the mask condition to solar alt > 0 will mask the day region.
Background: The solar altitude angle is the angle of the sun relative to the Earth’s horizon, and is measured in degrees. The altitude is zero at sunrise and sunset, and can reach a maximum of 90 degrees (directly overhead) at noon at latitudes near the equator. [Source: https://sciencing.com/solar-altitude-23364.html]
Scientific Objective
Creating masking region files to be used by other MET tools. This use case applies a solar altitude mask (solar altitude restriction) to the input grid, creating a separate masked output file for each time level of the input file.
Version Added
METplus version 3.1
Datasets
Forecast: NOAA Space Weather Prediction Center (SWPC) GloTEC Total Electron Content (TEC) model run without assimilation of any COSMIC-1 RO data
Observation: None
Climatology: None
Location: All of the input data required for this use case can be found in a sample data tarball. Each use case category will have one or more sample data tarballs. It is only necessary to download the tarball with the use case’s dataset and not the entire collection of sample data. Click here to access 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 Running METplus section for more information.
METplus Use Case Contact
METplus Components
This use case utilizes the METplus GenVxMask wrapper to generate a command to run the MET tool GenVxMask if all required files are found.
METplus Workflow
Beginning time (VALID_BEG): 201503170005
End time (VALID_END): 201503170015
Increment between beginning and end times (VALID_INCREMENT): 600
Sequence of forecast leads to process (LEAD_SEQ): 0
GenVxMask is the only tool called in this example. It processes the following run time:
The input file is read to define the output grid. Then the solar altitude angle specified with the -thresh argument is applied to the input file, creating the output file.
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, i.e. parm/use_cases/model_applications/space_weather/GenVxMask_fcstGloTEC_FcstOnly_solar_altitude.conf
[config]
# Documentation for this use case can be found at
# https://metplus.readthedocs.io/en/latest/generated/model_applications/space_weather/GenVxMask_fcstGloTEC_FcstOnly_solar_altitude.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 = GenVxMask
###
# 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
###
# Just run the first two time points for this use case example
# replace with 201503172355 process the entire day
LOOP_BY = VALID
VALID_TIME_FMT = %Y%m%d%H%M
VALID_BEG = 201503170005
VALID_END = 201503170015
VALID_INCREMENT = 600
LEAD_SEQ = 0
###
# 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/space_weather/glotec_vs_glotec/GLO_20190422_with_cosmic
GEN_VX_MASK_INPUT_TEMPLATE = GloTEC_TEC_{valid?fmt=%Y_%m_%d}_cosmic.nc
GEN_VX_MASK_INPUT_MASK_DIR = {INPUT_BASE}/model_applications/space_weather/glotec_vs_glotec/GLO_20190422_with_cosmic
GEN_VX_MASK_INPUT_MASK_TEMPLATE = GloTEC_TEC_{valid?fmt=%Y_%m_%d}_cosmic.nc
GEN_VX_MASK_OUTPUT_DIR={OUTPUT_BASE}/model_applications/space_weather/GenVxMask_glotec_solar_altitude
GEN_VX_MASK_OUTPUT_TEMPLATE = GloTEC_TEC_solar_altitude_le_45_masked_{valid?fmt=%Y_%m_%d_%H%M}.nc
###
# GenVxMask Settings
# https://metplus.readthedocs.io/en/latest/Users_Guide/wrappers.html#genvxmask
###
GEN_VX_MASK_OPTIONS = -type solar_alt -thresh 'le45' -name TEC_with_solar_altitude_angle_le_45_masked_{valid?fmt=%Y_%m_%d_%H%M} -input_field 'name="TEC"; level="({valid?fmt=%Y%m%d_%H%M%S},*,*)"; file_type=NETCDF_NCCF;' -mask_field 'name="TEC"; level="({valid?fmt=%Y%m%d_%H%M%S},*,*)"; file_type=NETCDF_NCCF;'
MET Configuration
None. GenVxMask does not use configuration files.
Python Embedding
This use case does not use Python embedding.
User Scripting
User Scripting is not used in this use case.
Running METplus
Pass the use case configuration file to the run_metplus.py script along with any user-specific system configuration files if desired:
run_metplus.py /path/to/METplus/parm/use_cases/model_applications/space_weather/GenVxMask_fcstGloTEC_FcstOnly_solar_altitude.conf /path/to/user_system.conf
See Running METplus for more information.
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 model_applications/space_weather/GenVxMask_fcstGloTEC_solar_altitude (relative to OUTPUT_BASE) and will contain the following files:
GloTEC_TEC_solar_altitude_le_45_masked_2015_03_17_0005.nc
GloTEC_TEC_solar_altitude_le_45_masked_2015_03_17_0015.nc
Keywords
Note
GenVxMaskToolUseCase
SpaceWeatherAppUseCase
NOAASWPCOrgUseCase
MaskingFeatureUseCase
Navigate to the METplus Quick Search for Use Cases page to discover other similar use cases.