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

Update develop-ref after PR #1354 #1367

Merged
merged 54 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2a7b085
Feature 1091 extent cycloneplotter (#1218)
bikegeek Oct 27, 2021
fa40cca
Github Issue #1091 Merge branch 'develop-ref' into develop
bikegeek Oct 27, 2021
ee5e274
convert file back to unix format via dos2unix and added change that w…
georgemccabe Nov 3, 2021
8d444e2
return None from function instead of exiting so that METplus clean up…
georgemccabe Nov 3, 2021
f9480e8
fixed indentation
georgemccabe Nov 3, 2021
dbdec0b
fixed indentation - for loop should not be nested inside other for loop
georgemccabe Nov 3, 2021
4ec50af
fixed check for failure in retrieve_data function
georgemccabe Nov 3, 2021
54f368a
feature 1223 error if file not found (#1238)
georgemccabe Nov 4, 2021
fb2ffed
Merge branch 'develop-ref' into develop
georgemccabe Nov 4, 2021
7094e0a
feature 1252 allow dictionary value for time_summary.width (#1253)
georgemccabe Nov 11, 2021
b021341
feature 1213 obs_quality_inc/exc (#1260)
georgemccabe Nov 15, 2021
9a6473a
Feature 1203 ioda2nc (#1262)
georgemccabe Nov 15, 2021
0bb5327
Merge branch 'develop-ref' into develop
georgemccabe Nov 15, 2021
a68c61c
Add default title for the new use case issue template.
JohnHalleyGotway Nov 16, 2021
083b80d
Feature 1019 harmonic preprocessing (#1272)
CPKalb Nov 16, 2021
4fbb689
Feature 1266 gen ens prod missing ensembles (#1275)
georgemccabe Nov 16, 2021
c16cb42
Merge branch 'develop-ref' into develop
georgemccabe Nov 16, 2021
fd90ba9
Feature 1049 statistics list (#1271)
lisagoodrich Nov 16, 2021
9e0f7e3
Feature 1263 v4.1.0 beta4 (#1277)
georgemccabe Nov 16, 2021
801cc94
update version to note development towards beta5
georgemccabe Nov 16, 2021
33ba9ac
Feature 934 release stage doc (#1235)
jprestop Nov 17, 2021
dd884c1
Merge branch 'develop-ref' into develop
georgemccabe Nov 19, 2021
4e8c5c0
Merge branch 'develop-ref' into develop
georgemccabe Nov 22, 2021
5d31979
Feature 344 met util refactor (#1292)
georgemccabe Dec 6, 2021
cfc1d09
removed deprecated sections from config examples
georgemccabe Dec 6, 2021
dd0d474
minor change to METplus release guide to add a link to the PDF of the…
georgemccabe Dec 7, 2021
1af654c
Feature 1285 extract tiles mtd times (#1315)
georgemccabe Dec 16, 2021
46658c6
Feature 896 more met config (#1322)
georgemccabe Dec 27, 2021
7e95915
removed incorrect search keyword
georgemccabe Dec 30, 2021
e5f53b1
added workflow_dispatch event so workflow can be triggered by an exte…
georgemccabe Dec 30, 2021
5673771
added another input argument for workflow_dispatch event
georgemccabe Jan 5, 2022
b25d728
added job with name that shows the event name or the repository name …
georgemccabe Jan 5, 2022
ab508d1
GHA: add username that triggered external event to event info job name
georgemccabe Jan 5, 2022
35f2003
added required input argument for external trigger that contains the …
georgemccabe Jan 5, 2022
1f97785
change event info to show commit hash instead of username that merged…
georgemccabe Jan 5, 2022
e4c2f3b
changed input names to match names of event in repository that trigge…
georgemccabe Jan 5, 2022
e2a44bc
feature 1320 OMP_NUM_THREADS (#1338)
georgemccabe Jan 11, 2022
e65949b
Feature 1183 memory documentation (#1340)
j-opatz Jan 11, 2022
8f8b9f9
add email address of user who triggered push event to job name
georgemccabe Jan 12, 2022
a4a0551
Merge branch 'develop' of github.com:dtcenter/METplus into develop
georgemccabe Jan 12, 2022
a138355
Feature 1166 series analysis field info (#1353)
georgemccabe Jan 13, 2022
c77d5d5
Feature 1116 usecase smos (#1348)
j-opatz Jan 13, 2022
6890f39
turn off new use case from every push
georgemccabe Jan 13, 2022
a19c343
Merge branch 'develop-ref' into develop
georgemccabe Jan 13, 2022
8ef1609
feature 1236 Control Members in EnsembleStat and GenEnsProd (#1357)
georgemccabe Jan 13, 2022
41add20
added optional argument to change the directory to untar new input da…
georgemccabe Jan 14, 2022
61c5d18
feature 1358 v4.1.0-beta5 release (#1359)
georgemccabe Jan 14, 2022
9aa9058
update version for next development cycle
georgemccabe Jan 15, 2022
d8dd615
Feature 1216 usecase smap (#1361)
j-opatz Jan 19, 2022
50e54cc
updated marine_and_cryo grouping
j-opatz Jan 19, 2022
2b12f78
Merge branch 'develop-ref' into develop
j-opatz Jan 20, 2022
7ff0637
Merge remote-tracking branch 'origin/develop-ref' into develop
bikegeek Jan 20, 2022
77d954d
Feature 1230 stratosphere metrics (#1354)
hankenstein2 Jan 21, 2022
b5ee821
Merge branch 'develop-ref' into develop
Jan 21, 2022
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 @@ -154,6 +154,11 @@
"index_list": "11",
"run": false
},
{
"category": "s2s",
"index_list": "12",
"run": false
},
{
"category": "space_weather",
"index_list": "0-1",
Expand Down
2 changes: 0 additions & 2 deletions ci/docker/docker_env/scripts/metplotpy_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# matplotlib==3.3.0
# scipy==1.5.1
# plotly==4.9.0
# pingouin==0.3.8
# cartopy==0.18.0
# eofs==1.3.0
# cmocean==2.0
Expand All @@ -34,7 +33,6 @@ conda create -y --clone ${BASE_ENV} --name ${ENV_NAME}
conda install -y --name ${ENV_NAME} -c conda-forge matplotlib==3.3.0
conda install -y --name ${ENV_NAME} -c conda-forge scipy==1.5.1
conda install -y --name ${ENV_NAME} -c conda-forge plotly==4.9.0
conda install -y --name ${ENV_NAME} -c conda-forge pingouin==0.3.8
conda install -y --name ${ENV_NAME} -c conda-forge cartopy==0.18.0
conda install -y --name ${ENV_NAME} -c conda-forge eofs==1.3.0
conda install -y --name ${ENV_NAME} -c conda-forge cmocean==2.0
Expand Down
Binary file added docs/_static/s2s-zonal_means.png
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,137 @@
"""
UserScript: Make zonal and meridonial means
========================================================================

model_applications/
s2s/
UserScript_obsERA_obsOnly_Stratosphere.py

"""

##############################################################################
# Scientific Objective
# --------------------
#
# This use case calls functions in METcalcpy to create zonal and meridonial
# means
#

##############################################################################
# Datasets
# --------
#
# SSWC_v1.0_varFull_ERAi_d20130106_s20121107_e20130307_c20160701.nc

##############################################################################
# METplus Components
# ------------------
#
# This use case runs the UserScript wrapper tool to run a user provided script,
# in this case, meridonial.py.
#

##############################################################################
# METplus Workflow
# ----------------
#
# This use case does not loop but plots the entire time period of data
#
# UserScript
# This uses data from 20130106,20121107,20130307,20160701
#
#

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

#############################################################################
# MET Configuration
# ---------------------
#
# There are no MET tools used in this use case.
#

##############################################################################
# Python Embedding
# ----------------
#
# There is no python embedding in this use case
#

##############################################################################
# Running METplus
# ---------------
#
# This use case can be run two ways:
#
# 1) Passing in meridonial_means.conf,
# then a user-specific system configuration file::
#
# run_metplus.py \
# -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere.conf \
# -c /path/to/user_system.conf
#
# 2) Modifying the configurations in parm/metplus_config, then passing in meridonial.conf::
#
# run_metplus.py \
# -c /path/to/METplus/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere.conf
#
# The former method is recommended. Whether you add them to a user-specific configuration file or modify the metplus_config files, the following variables must be set correctly:
#
# * **INPUT_BASE** - Path to directory where sample data tarballs are unpacked (See Datasets section to obtain tarballs). This is not required to run METplus, but it is required to run the examples in parm/use_cases
# * **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
#
# and for the [exe] section, you will need to define the location of NON-MET executables.
# If the executable is in the user's path, METplus will find it from the name.
# If the executable is not in the path, specify the full path to the executable here (i.e. RM = /bin/rm)
# The following executables are required for performing series analysis use cases:
#
# 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
#
# [exe]
# RM = /path/to/rm
# CUT = /path/to/cut
# TR = /path/to/tr
# NCAP2 = /path/to/ncap2
# CONVERT = /path/to/convert
# NCDUMP = /path/to/ncdump
#

##############################################################################
# Expected Output
# ---------------
#
# A successful run will output the following both to the screen and to the logfile::
#
# INFO: METplus has successfully finished running.
#

##############################################################################
# Keywords
# --------
#
# .. note::
#
# * UserScriptUseCase
# * S2SAppUseCase
#
# Navigate to the :ref:`quick-search` page to discover other similar use cases.
#
#
#
# sphinx_gallery_thumbnail_path = '_static/s2s-zonal_means.png'
1 change: 1 addition & 0 deletions internal_tests/use_cases/all_use_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Category: s2s
9:: UserScript_obsERA_obsOnly_OMI:: model_applications/s2s/UserScript_obsERA_obsOnly_OMI.conf:: spacetime_env, metdatadb
10:: UserScript_obsERA_obsOnly_RMM:: model_applications/s2s/UserScript_obsERA_obsOnly_RMM.conf:: spacetime_env, metdatadb
11:: UserScript_fcstGFS_obsERA_WeatherRegime:: model_applications/s2s/UserScript_fcstGFS_obsERA_WeatherRegime.conf:: weatherregime_env,cartopy,metplus
12:: UserScript_obsERA_obsOnly_Stratosphere:: model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere.conf:: metplotpy_env,metdatadb,metplus

Category: space_weather
0::GridStat_fcstGloTEC_obsGloTEC_vx7:: model_applications/space_weather/GridStat_fcstGloTEC_obsGloTEC_vx7.conf
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

[config]

# 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 = REALTIME

# %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

# BLank for this usecase but the parameter still needs to be there
VALID_BEG =

# BLank for this usecase but the parameter still needs to be there
VALID_END =

# BLank for this usecase but the parameter still needs to be there
VALID_INCREMENT =

# List of forecast leads to process for each run time (init or valid)
# In hours if units are not specified
# If unset, defaults to 0 (don't loop through forecast leads)
LEAD_SEQ =

# 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 = processes

PROCESS_LIST = UserScript

USER_SCRIPT_RUNTIME_FREQ = RUN_ONCE

USER_SCRIPT_COMMAND = {PARM_BASE}/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere/meridonial_mean.py


[user_env_vars]
INPUT_FILE_NAME = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere/SSWC_v1.0_varFull_ERAi_d20130106_s20121107_e20130307_c20160701.nc
YAML_CONFIG_NAME = {METPLUS_BASE}/parm/use_cases/model_applications/s2s/UserScript_obsERA_obsOnly_Stratosphere/meridonial_mean.yaml


LOG_FILE = "Meridonial_means.log"

LOG_LEVEL = "INFO"

OUTPUT_DIR = {OUTPUT_BASE}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
These files are a use case to show how to compute meridial and zonal means

You need METcalcpy and METdatadb in your python path or your conda environment
i.e.
export PYTHONPATH=<path>/METdatadb:<path>/METcalcpy

The file SSWC_v1.0_varFull_ERAi_d20130106_s20121107_e20130307_c20160701.nc needs to be
on disk somewhere on your computer and referenced correctly in the file
meridial_mean.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env python3

"""
Create meridonial mean statistics

"""
import os
import sys
import logging
import yaml
import xarray as xr # http://xarray.pydata.org/
import metcalcpy.util.read_env_vars_in_config as readconfig
import metcalcpy.pre_processing.directional_means as directional_means
import METreadnc.util.read_netcdf as read_netcdf


def main():
"""
Use existing default meridonial mean config file found in METcalcpy to
grab the test file
"""


"""
Read Meridial Mean YAML configuration file
user can use their own, if none specified at the command line,
use the "default" example YAML config file, spectra_plot_coh2.py
Using a custom YAML reader so we can use environment variables
"""

try:
input_config_file = os.getenv("YAML_CONFIG_NAME","meridonial_mean.yaml")
config = readconfig.parse_config(input_config_file)
logging.info(config)
except yaml.YAMLError as exc:
logging.error(exc)

"""
Read METplus config file paramaters
"""
#input_file_name = os.environ.get("INPUT_FILE_NAME","SSWC_v1.0_varFull_ERAi_d20130106_s20121107_e20130307_c20160701.nc")
input_file = config["input_filename"]

"""
Setup logging
"""
logfile = "meridonial_mean.log"
logging_level = os.environ.get("LOG_LEVEL","logging.INFO")
logging.basicConfig(stream=logfile, level=logging_level)

"""
Read dataset
"""
try:
logging.info('Opening ' + input_file[0])
file_reader = read_netcdf.ReadNetCDF()

#file_reader returns a list of xarrays even if there is only one file requested to be read
#so we change it from a list to a single
ds = file_reader.read_into_xarray(input_file)[0]
except IOError as exc:
logging.error('Unable to open ' + input_file)
logging.error(exc)
sys.exit(1)
logging.debug(ds)
ds = ds[['uwndFull_TS','vwndFull_TS','tempFull_TS','geopFull_TS']]
ds = ds.rename({'timeEv60':'time',
'lat':'latitude', # pyzome currently expects dimensions named latitude and longitude
'lon':'longitude',
'uwndFull_TS':'u',
'vwndFull_TS':'v',
'tempFull_TS':'T',
'geopFull_TS':'Z'})

uzm = directional_means.zonal_mean(ds.u)
Tzm = directional_means.zonal_mean(ds.T)
T_6090 = directional_means.meridional_mean(Tzm, 60, 90)

print(T_6090)

if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
input_filename:
- !ENV '${INPUT_FILE_NAME}'