Skip to content

Commit

Permalink
Merge pull request #5 from NCAR/develop
Browse files Browse the repository at this point in the history
Bringing fork up to date 3/21/2018
  • Loading branch information
malloryprow authored Mar 21, 2018
2 parents 6a32347 + 449a146 commit 2506d3e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
18 changes: 9 additions & 9 deletions internal_tests/pytests/pb2nc/pb2nc_test_conus_sfc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ EGREP_EXE = /bin/egrep
## Input data directories
## This is the location of your input files for METplus

PROJ_DIR = /d1/minnawin/pb2nc_crow_test
TMP_DIR = /d1/minnawin/pb2nc_crow_test/tmp
OUTPUT_BASE = /d1/minnawin/pb2nc_crow_test
PROJ_DIR = /d1/minnawin/skunk
TMP_DIR = /d1/minnawin/skunk/tmp
OUTPUT_BASE = /d1/minnawin/skunk
METPLUS_BASE = /home/minnawin/wip/METplus
MET_BUILD_BASE = /usr/local/met-6.1
MET_INSTALL_DIR = /usr/local/met-6.1
Expand All @@ -26,7 +26,7 @@ PREPBUFR_DATA_DIR = /d1/METplus_Mallory/data/prepbufr

# this is the name of model (and subdir to PREPBUFR_DATA_DIR)
# ex: nam for NAM or gdas for GDAS dir
PREPBUFR_MODEL_DIR_NAME = nam ;;
PREPBUFR_MODEL_DIR_NAME = nam
PB2NC_OUTPUT_DIR = {OUTPUT_BASE}/{PREPBUFR_MODEL_DIR_NAME}/conus_sfc


Expand All @@ -38,8 +38,8 @@ LOG_LEVEL = DEBUG
## Configuration-related settings such as the process list, begin and end times, etc.
PROCESS_LIST = PB2NC
## Param file used by MET
#PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NCConfig_conus_sfc
PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NC_SFC_Mallory
PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NCConfig_conus_sfc
#PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NC_SFC_Mallory

# Either conus_sfc or upper_air
VERTICAL_LOCATION = conus_sfc
Expand All @@ -48,7 +48,6 @@ VERTICAL_LOCATION = conus_sfc
GRID_MASK =
MASK_POLY =
STATION_ID =
QUALITY_MARK_THRESH =
MESSAGE_TYPE =

# If you want to change the values in OBS_BUFR_VAR_LIST: 1) keep the number the same or 2) change the
Expand All @@ -57,7 +56,6 @@ MESSAGE_TYPE =
# Leave empty to process all
OBS_BUFR_VAR_LIST = PMO, TOB, TDO, UOB, VOB, PWO, TOCC


## Begin and end times of the prepBUFR data to be converted to netCDF
##

Expand All @@ -74,7 +72,7 @@ END_HOUR = 23

# Indicate the begin and end date, and interval (in hours)
BEG_TIME = 20170601
END_TIME = 20170630
END_TIME = 20170602
INTERVAL_TIME = 24

# start and end dates are created by combining the date with
Expand All @@ -83,6 +81,8 @@ START_DATE = {BEG_TIME}{START_HOUR}
END_DATE = {END_TIME}{END_HOUR}

## For defining the time periods for summarization
# False for no time summary, True otherwise
TIME_SUMMARY_FLAG = False
TIME_SUMMARY_BEG = 000000 ;; start time of time summary in HHMMSS format
TIME_SUMMARY_END = 235959 ;; end time of time summary in HHMMSS format
TIME_SUMMARY_VAR_NAMES = PMO, TOB, TDO, UOB, VOB, PWO, TOCC
Expand Down
10 changes: 5 additions & 5 deletions internal_tests/pytests/pb2nc/pb2nc_test_upper_air.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ LOG_LEVEL = DEBUG
## Configuration-related settings such as the process list, begin and end times, etc.
PROCESS_LIST = PB2NC
## Param file used by MET
PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NCConfig_conus_sfc
#PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NC_UPPER_AIR_Mallory
PB2NC_CONFIG_FILE = {PARM_BASE}/met_config/PB2NC_UPPER_AIR_Mallory

# Either conus_sfc or upper_air
VERTICAL_LOCATION = upper_air
Expand All @@ -48,7 +47,6 @@ VERTICAL_LOCATION = upper_air
GRID_MASK =
MASK_POLY =
STATION_ID =
QUALITY_MARK_THRESH =
MESSAGE_TYPE =

# Leave empty to process all available variables
Expand All @@ -75,10 +73,12 @@ START_DATE = {BEG_TIME}{START_HOUR}
END_DATE = {END_TIME}{END_HOUR}

## For defining the time periods for summarization
# False for no time summary, True otherwise
TIME_SUMMARY_FLAG = False
TIME_SUMMARY_BEG = 000000 ;; start time of time summary in HHMMSS format
TIME_SUMMARY_END = 235959 ;; end time of time summary in HHMMSS format
TIME_SUMMARY_VAR_NAMES = QOB, TOB ;; a list of the variables to summarize
TIME_SUMMARY_TYPES = min, max, range, mean, stdev, median, p80 ;; a list of the statistics to summarize
TIME_SUMMARY_VAR_NAMES = PMO, TOB
TIME_SUMMARY_TYPES = min, max, range, mean, stdev, median, p80

## OVERWRITE OPTIONS
## Don't overwrite files if they already exist.
Expand Down
16 changes: 15 additions & 1 deletion internal_tests/pytests/produtil/produtil_test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ NEW_LINES = very long line requiring newline character to be tested 12345
UNASSIGNED_VALUE =

[dir]
# set in the metplus_data.conf to /path/to, override here for testing
PROJ_DIR = /tmp/produtil_testing

# set in the metplus_system.conf to /path/to, override here for testing, set to
# appropriate version of MET
MET_INSTALL_DIR = /usr/local/met-6.1
METPLUS_BASE = /usr/local/met-6.1
OUTPUT_BASE = /tmp/produtil_testing/out
TMP_DIR = /tmp/produtil_testing/tmp

# Used for testing
DIR_VALUE = /tmp/some_dir
METPLUS_CONF =
BASE_DIR = /tmp
SPECIFIC_DIR = {BASE_DIR}/specific_place
SPECIFIC_DIR = {BASE_DIR}/specific_place

[exe]
WGRIB2 = /usr/local/bin/wgrib2
11 changes: 11 additions & 0 deletions internal_tests/pytests/produtil/test_produtil.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
import produtil.setup
import sys
import logging
Expand Down Expand Up @@ -131,3 +132,13 @@ def test_new_lines_in_conf():
"very long line requiring newline character to be tested 12345\n67890 end of the line."
long_line = conf_obj.getstr('config', 'NEW_LINES')
assert long_line == expected_string


def test_get_exe_ok():
"""! Test that executables are correctly retrieved."""
conf_obj = get_config_obj()
expected_exe = '/usr/local/bin/wgrib2'
executable = conf_obj.getexe('WGRIB2')
assert executable == expected_exe


0 comments on commit 2506d3e

Please sign in to comment.