Skip to content

Commit

Permalink
Update develop-ref after #1741 (#1743)
Browse files Browse the repository at this point in the history
* Start on write netcdf pickle alternative.

* Write dataplane array.

* Start on read of netcdf as pickle alternative.

* Create attribute variables.

* Use global attributes for met_info attrs.

* Add grid structure.

* Read metadata back into met_info.attrs.

* Convert grid.nx and grid.ny to int.

* Rename _name key to name.

* Removed pickle write.

* Fixed write_pickle_dataplane to work for both numpy and xarray.

* Use items() to iterate of key, value attrs.

* Write temporary text file.

* Renamed scripts.

* Changed script names in Makefile.am.

* Replaced pickle with tmp_nc.

* Fixed wrapper script names.

* Test for attrs in met_in.met_data.

* Initial version of read_tmp_point module.

* Added read_tmp_point.py to install list.

* Start on Python3_Script::read_tmp_point.

* Write MPR tmp ascii file.

* Renamed to read_tmp_ascii to use for point point and MPR.

* Renamed to read_tmp_ascii to use for point point and MPR.

* Define Python3_Script::import_read_tmp_ascii_py.

* Call Python3_Script::import_read_tmp_ascii_py.

* Append MET_BASE/wrappers to sys.path.

* Finished implementation of Python3_Script::import_read_tmp_ascii_py.

* Call Python3_Script::read_tmp_ascii in python_handler.

* Revised python3_script::read_tmp_ascii with call to run, PyRun_String.

* Return PyObject* from Python3_Script::run.

* Restored call to run_python_string for now.

* Per #1429, enhance error message from DataLine::get_item(). (#1682)

* Feature 1429 tc_log second try (#1686)

* Per #1429, enhance error message from DataLine::get_item().

* Per #1429, I realize that the line number actually is readily available in the DataLine class... so include it in the error message.

* Feature 1588 ps_log (#1687)

* Per #1588, updated pair_data_point.h/.cc to add detailed Debug(4) log messages, as specified in the GitHub issue. Do still need to test each of these cases to confirm that the log messages look good.

* Per #1588, switch very detailed interpolation details from debug level 4 to 5.

* Per #1588, remove the Debug(4) log message about duplicate obs since it's been moved up to a higher level.

* Per #1588, add/update detailed log messages when processing point observations for bad data, off the grid, bad topo, big topo diffs, bad fcst value, and duplicate obs.

* #1454 Disabled plot_data_plane_CESM_SSMI_microwave and plot_data_plane_CESM_sea_ice_nc becaues of not evenly spaced

* #1454 Moved NC attribute name to nc_utils.h

* #1454 Corrected sanity checking for lat/lon projection based on the percentage of the delta instead of fixed tolerance

* #1454 Corrected sanity checking for lat/lon projection based on the percentage of the delta instead of fixed tolerance

* #1454 Corrected data.delta_lon

* #1454 Change bact to use diff instead of absolute value of diff

* 454 Deleted instea dof commenting out

* 454 Deleted instea dof commenting out

* Feature 1684 bss and 1685 single reference model (#1689)

* Per #1684, move an instance of the ClimoCDFInfo class into PairBase. Also define derive_climo_vals() and derive_climo_prob() utility functions.

* Add to VxPairDataPoint and VxPairDataEnsemble functions to set the ClimoCDFInfo class.

* Per #1684, update ensemble_stat and point_stat to set the ClimoCDFInfo object based on the contents of the config file.

* Per #1684, update the vx_statistics library and stat_analysis to make calls to the new derive_climo_vals() and derive_climo_prob() functions.

* Per #1684, since cdf_info is a member of PairBase class, need to handle it in the PairDataPoint and PairDataEnsemble assignment and subsetting logic.

* Per #1684, during development, I ran across and then updated this log message.

* Per #1684, working on log messages and figured that the regridding climo data should be moved from Debug(1) to at least Debug(2).

* Per #1684 and #1685, update the logic for the derive_climo_vals() utility function. If only a single climo bin is requested, just return the climo mean. Otherwise, sample the requested number of values.

* Per #1684, just fixing the format of this log message.

* Per #1684, add a STATLine::get_offset() member function.

* Per #1684, update parse_orank_line() logic. Rather than calling NumArray::clear() call NumArray::erase() to preserve allocated memory. Also, instead of parsing ensemble member values by column name, parse them by offset number.

* Per #1684, call EnsemblePairData::extend() when parsing ORANK data to allocate one block of memory instead of bunches of litte ones.

* Per #1684 and #1685, add another call to Ensemble-Stat to test computing the CRPSCL_EMP from a single climo mean instead of using the full climo distribution.

* Per #1684 and #1685, update ensemble-stat docs about computing CRPSS_EMP relative to a single reference model.

* Per #1684, need to update Grid-Stat to store the climo cdf info in the PairDataPoint objects.

* Per #1684, remove debug print statements.

* Per #1684, need to set cdf_info when aggregating MPR lines in Stat-Analysis.

* Per #1684 and #1685, update PairDataEnsemble::compute_pair_vals() to print a log message indicating the climo data being used as reference:

For a climo distribution defined by mean and stdev:
DEBUG 3: Computing ensemble statistics relative to a 9-member climatological ensemble.

For a single deterministic reference:
DEBUG 3: Computing ensemble statistics relative to the climatological mean.

* Per #1691, add met-10.0.0-beta4 release notes. (#1692)

* Updated Python documentation

* Per #1694, add VarInfo::magic_str_attr() to construct a field summary string from the name_attr() and level_attr() functions.

* Per #1694, fixing 2 issues here. There was a bug in the computation of the max value. Had a less-than sign that should have been greater-than. Also, switch from tracking data by it's magic_str() to simply using VAR_i and VAR_j strings. We *could* have just used the i, j integers directly, but constructing the ij joint histogram integer could have been tricky since we start numbering with 0 instead of 1. i=0, j=1 would result in 01 which is the same as integer of 1. If we do want to switch to integers, we just need to make them 1-based and add +1 all over the place.

* Per #1694, just switching to consistent variable name.

* Just consistent spacing.

* Added python3_script::import_read_tmp_ascii.

* Restored read_tmp_ascii call.

* Added lookup into ascii module.

* Adding files for ReadTheDocs

* Adding .yaml file for ReadTheDocs

* Updated path to requirements.txt file

* Updated path to conf.py file

* Removing ReadTheDocs files and working in separate branch

* Return PyObject* from read_tmp_ascii.

* Put point_data in global namespace.

* Remove temporary ascii file.

* Added tmp_ascii_path.

* Removed read_obs_from_pickle.

* Trying different options for formats (#1702)

* Per #1706, add bugfix to the develop branch. Also add a new job to unit_stat_analysis.xml to test out the aggregation of the ECNT line type. This will add new unit test output and cause the NB to fail. (#1708)

* Feature 1471 python_grid (#1704)

* Per #1471, defined a parse_grid_string() function in the vx_statistics library and then updated vx_data2d_python to call that function. However, this creates a circular dependency because vx_data2d_python now depends on vx_statistics.

* Per #1471, because of the change in dependencies, I had to modify many, many Makefile.am files to link to the -lvx_statistics after -lvx_data2d_python. This is not great, but I didn't find a better solution.

* Per #1471, add a sanity check to make sure the grid and data dimensions actually match.

* Per #1471, add 3 new unit tests to demonstrate setting the python grid as a named grid, grid specification string, or a gridded data file.

* Per #1471, document python grid changes in appendix F.

* Per #1471, just spacing.

* Per #1471, lots of Makefile.am changes to get this code to compile on kiowa. Worringly, it compiled and linked fine on my Mac laptop but not on kiowa. Must be some large differences in the linker logic.

Co-authored-by: John Halley Gotway <[email protected]>

* Committing a fix for unit_python.xml directly to the develop branch. We referenced  in a place where it's not defined.

* Add *.dSYM to the .gitignore files in the src and internal_tests directories.

* Replaced tmp netcdf _name attribute with name_str.

* Append user script path to system path.

* Revert "Feature 1319 no pickle" (#1717)

* Fixed typos, added content, and modified release date format

* #1715 Initial release

* #1715 Do not combined if there are no overlapping beteewn TQZ and UV records

* #1715 Added pb2nc_compute_pbl_cape

* #1715 Added pb2nc_compute_pbl_cape

* #1715 Reduced obs_bufr_var. Removed pb_report_type

* #1715 Added a blank line for Error/Warning

* Per #1725, return good status from TrackInfoArray::add() when using an ATCF line to create a new track. (#1726)

* Per #1705, update the threshold node heirarchy by adding a climo_prob() function to determine the climatological probability of a CDP-type threshold. Also update derive_climo_prob() in pair_base.cc to call the new climo_prob() function. (#1724)

* Bugfix 1716 develop perc_thresh (#1722)

* Per #1716, committing changes from Randy Bullock to support floating point percentile thresholds.

* Per #1716, no code changes, just consistent formatting.

* Per #1716, change SFP50 example to SFP33.3 to show an example of using floating point percentile values.

* Update pull_request_template.md

* Feature 1733 exc (#1734)

* Per #1733, add column_exc_name, column_exc_val, init_exc_name, and init_exc_val options to the TCStat config files.

* Per #1733, enhance tc_stat to support the column_exc and init_exc config file and job command filtering options.

* Per #1733, update stat_analysis to support the -column_exc job filtering option. Still need to update docuementation and add unit tests.

* Per #1773, update the user's guide with the new config and job command options.

* Per #1733, add call to stat_analysis to exercise -column_str and -column_exc options.

* Per #1733, I ran into a namespace conflict in tc_stat where -init_exc was used for to filter by time AND my string value. So I switched to using -init_str_exc instead. And made the corresponding change to -column_str_exc in stat_analysis and tc_stat. Also changed internal variable names to use IncMap and ExcMap to keep the logic clear.

* Per #1733, tc_stat config file updates to switch from column_exc and init_exc to column_str_exc and init_str_exc.

* Per #1733, add tc_stat and stat_analysis jobs to exercise the string filtering options.

* Bugfix 1737 develop little_r (#1739)

* Per #1737, migrate the same fix from main_v9.1 over to the develop branch.

* Per #1737, add another unit test for running ascii2nc with corrupt littl_r records.

* Feature GitHub actions (#1742)

* Adding files to build documenation via GitHub Actions

* Removing html_theme_options

* Removed warnings.log from help section

* Feature 1575 large_diffs (#1741)

* Per #1575, add mpr_column and mpr_thresh entries to all of the Grid-Stat and Point-Stat config files.

* Per #1575, define config strings to be parsed from the config files.

* Per #1575, store col_name_ptr and col_thresh_ptr in PairBase. They are being used for PairDataPoint to do MPR filtering in Grid-Stat and Point-Stat. But they could be eventually be extended to filter ORANK columns for Ensemble-Stat.

* Per #1575, add MPR filtering logic to pair_data_point.cc. Include filtering logic in PairDataPoint instead of VxPairDataPoint since Grid-Stat uses PairDataPoint.

* Per #1575, update point_stat to parse the mpr_column and mpr_thresh config file options. Include the MPR rejection reason code counts in the log output.

* Per #1575, updated Grid-Stat to parse mpr_column and mpr_thresh options.

* Per #1575, update Point-Stat to store mpr_sa and mpr_ta locally and then call set_mpr_filt() after the VxPairDataPoint object has been sized and allocated.

* Per #1575, renamed PairDataEnsemble::subset_pairs() to subset_pairs_obs_thresh() to be a little more explicit about things. I'll do the same for PairDataPoint using names subset_pairs_cnt_thresh() and subset_pairs_mpr_thresh().

* Per #1575, some cleanup, moving check_fo_thresh() utility function from vx_config to vx_statistics library.

* Per #1575, when implementing this for Grid-Stat, I realized that there isn't much benefit in storing col_name_ptr and col_name_thresh in PairBase. These changes remove that.

* Per #1575, updating pair_data_point.h/.cc to handle the subsetting of data based on the MPR thresh.

* Per #1575, rename subset_pairs() to subset_pairs_cnt_thresh() to be a bit more explicit with the naming conventions.

* Per #1575, no real changes here. Just reorganizing the location of the mpr_sa and mpr_ta members.

* Per #1575, make the subset_pairs() utility function a member function of the PairDataPoint class named subset_pairs_cnt_thresh() and update the application code to call it.

* Per #1575, need to actually set the mpr_thresh!

* Per #1575, update subset_pairs_mpr_thresh() to make sure the StringArray and ThreshArray lengths are the same.

* Per #1575, replace PairDataPoint::subset_pairs_mpr_thresh() with a utility function named apply_mpr_thresh_mask(). This is for Grid-Stat to apply the mpr_thresh settings after the DataPlane pairs have been created but prior to applying any smoothing operations.

* Per #1575, add documentation about mpr_column and mpr_thresh.

* Per #1575, mpr_columns can also include CLIMO_CDF.

* Per #1575, add tests for Grid-Stat and Point-Stat to exercise the mpr_column and mpr_thresh config file options.

Co-authored-by: David Fillmore <[email protected]>
Co-authored-by: Howard Soh <[email protected]>
Co-authored-by: hsoh-u <[email protected]>
Co-authored-by: Julie.Prestopnik <[email protected]>
Co-authored-by: David Fillmore <[email protected]>
Co-authored-by: John Halley Gotway <[email protected]>
Co-authored-by: MET Tools Test Account <[email protected]>
  • Loading branch information
8 people authored Apr 2, 2021
1 parent 7ad8e22 commit 0c2f4d7
Show file tree
Hide file tree
Showing 79 changed files with 1,117 additions and 121 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: MET CI/CD Workflow
on:
push:
branches:
- develop
- develop-ref
- feature_*
- main_*
- bugfix_*
pull_request:
types: [opened, reopened, synchronize]

jobs:
documentation:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: |
python -m pip install --upgrade python-dateutil requests sphinx \
sphinx-gallery Pillow sphinx_rtd_theme
- name: Build docs
continue-on-error: true
run: |
DOCS_DIR=${GITHUB_WORKSPACE}/met/docs
cd ${DOCS_DIR}
make clean html
cd ${GITHUB_WORKSPACE}
warning_file=${DOCS_DIR}/_build/warnings.log
mkdir -p artifact/documentation
cp -r ${DOCS_DIR}/_build/html/* artifact/documentation
if [ -s $warning_file ]; then
cp -r ${DOCS_DIR}/_build/warnings.log artifact/doc_warnings.log
cp artifact/doc_warnings.log artifact/documentation
else
rm ${warning_file}
fi
- uses: actions/upload-artifact@v2
with:
name: documentation
path: artifact/documentation
- uses: actions/upload-artifact@v2
with:
name: documentation_warnings.log
path: artifact/doc_warnings.log
if-no-files-found: ignore
2 changes: 2 additions & 0 deletions met/data/config/GridStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/data/config/PointStatConfig_default
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [ NA ];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
3 changes: 2 additions & 1 deletion met/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ clean:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -w "$(BUILDDIR)/warnings.log"
25 changes: 23 additions & 2 deletions met/docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ to be verified. This dictionary may include the following entries:
metadata of any output files, but the user can set the "desc" entry
accordingly.

Examples of user-defined conversion functions include:
Examples of user-defined data censoring operations include:

.. code-block:: none
censor_thresh = [ >12000 ];
censor_val = [ 12000 ];
censor_val = [ 12000 ];
* Several configuration options are provided to override and correct the
metadata read from the input file. The supported options are listed
Expand Down Expand Up @@ -678,6 +678,25 @@ to be verified. This dictionary may include the following entries:
is_wind_direction = boolean;
is_prob = boolean;
* The "mpr_column" and "mpr_thresh" entries are arrays of strings and
thresholds to specify which matched pairs should be included in the
statistics. These options apply to the Point-Stat and Grid-Stat tools.
They are parsed seperately for each "obs.field" array entry.
The "mpr_column" strings specify MPR column names ("FCST", "OBS",
"CLIMO_MEAN", "CLIMO_STDEV", or "CLIMO_CDF"), differences of columns
("FCST-OBS"), or the absolute value of those differences ("ABS(FCST-OBS)").
The number of "mpr_thresh" thresholds must match the number of "mpr_column"
entries, and the n-th threshold is applied to the n-th column. Any matched
pairs which do not meet any of the specified thresholds are excluded from
the analysis. For example, the following settings exclude matched pairs
where the observation value differs from the forecast or climatological
mean values by more than 10:

.. code-block:: none
mpr_column = [ "ABS(OBS-FCST)", "ABS(OBS-CLIMO_MEAN)" ];
mpr_thresh = [ <=10, <=10 ];
* The "cat_thresh" entry is an array of thresholds to be used when
computing categorical statistics.

Expand Down Expand Up @@ -981,6 +1000,8 @@ or
obs = {
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
wind_thresh = [ NA ];
Expand Down
4 changes: 3 additions & 1 deletion met/docs/Users_Guide/grid-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,15 @@ __________________________
type = [ { method = NEAREST; width = 1; } ]; }
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
eclv_points = 0.05;
rank_corr_flag = TRUE;
tmp_dir = "/tmp";
output_prefix = "";
version = "VN.N";
The configuration options listed above are common to many MET tools and are described in :numref:`config_options`.
The configuration options listed above are common to multiple MET tools and are described in :numref:`config_options`.

___________________________

Expand Down
4 changes: 3 additions & 1 deletion met/docs/Users_Guide/point-stat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ ________________________
type = [ { method = NEAREST; width = 1; } ]; }
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
eclv_points = 0.05;
rank_corr_flag = TRUE;
sid_inc = [];
Expand All @@ -347,7 +349,7 @@ ________________________
output_prefix = "";
version = "VN.N";
The configuration options listed above are common to many MET tools and are described in :numref:`config_options`.
The configuration options listed above are common to multiple MET tools and are described in :numref:`config_options`.

_________________________

Expand Down
2 changes: 0 additions & 2 deletions met/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
html_theme = 'sphinx_rtd_theme'
html_theme_path = ["_themes", ]
html_js_files = ['pop_ver.js']
html_theme_options = {'canonical_url': 'https://dtcenter.github.io/MET/latest/'}
html_theme_options['versions'] = {'latest': '../latest', 'develop': '../develop'}
html_css_files = ['theme_override.css']

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
3 changes: 2 additions & 1 deletion met/scripts/config/GridStatConfig_APCP_12
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand All @@ -52,7 +54,6 @@ nc_pairs_var_name = "";
nc_pairs_var_suffix = "";
rank_corr_flag = FALSE;


//
// Forecast and observation fields to be verified
//
Expand Down
3 changes: 3 additions & 0 deletions met/scripts/config/GridStatConfig_APCP_24
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand All @@ -51,6 +53,7 @@ eclv_points = 0.05;
nc_pairs_var_name = "";
nc_pairs_var_suffix = "";
rank_corr_flag = FALSE;

//
// Forecast and observation fields to be verified
//
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/GridStatConfig_POP_12
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/GridStatConfig_all
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ regrid = {
//
censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cat_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
Expand Down
2 changes: 2 additions & 0 deletions met/scripts/config/PointStatConfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ regrid = {

censor_thresh = [];
censor_val = [];
mpr_column = [];
mpr_thresh = [];
cnt_thresh = [ NA ];
cnt_logic = UNION;
wind_thresh = [ NA ];
Expand Down
6 changes: 4 additions & 2 deletions met/src/basic/vx_config/config_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ struct MaskLatLon {
//

enum DuplicateType {
DuplicateType_None, // Apply no logic for duplicate point obs
DuplicateType_None, // Apply no logic for duplicate point obs
DuplicateType_Unique // Filter out duplicate observation values
};

Expand All @@ -394,7 +394,7 @@ enum ObsSummary {
ObsSummary_None, // Keep all observations, no statistics
ObsSummary_Nearest, // Keep only the observation closest in time
ObsSummary_Min, // Keep only smallest value
ObsSummary_Max, // Keep only largest valueXS
ObsSummary_Max, // Keep only largest value
ObsSummary_UW_Mean, // Calculate un-weighted mean
ObsSummary_DW_Mean, // Calculate time weighted mean
ObsSummary_Median, // Calculate median
Expand Down Expand Up @@ -536,6 +536,8 @@ static const char conf_key_obs_qty[] = "obs_quality";
static const char conf_key_convert[] = "convert";
static const char conf_key_censor_thresh[] = "censor_thresh";
static const char conf_key_censor_val[] = "censor_val";
static const char conf_key_mpr_column[] = "mpr_column";
static const char conf_key_mpr_thresh[] = "mpr_thresh";
static const char conf_key_cnt_thresh[] = "cnt_thresh";
static const char conf_key_cnt_logic[] = "cnt_logic";
static const char conf_key_cat_thresh[] = "cat_thresh";
Expand Down
40 changes: 0 additions & 40 deletions met/src/basic/vx_config/config_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2285,46 +2285,6 @@ void check_mctc_thresh(const ThreshArray &ta) {

///////////////////////////////////////////////////////////////////////////////

bool check_fo_thresh(const double f, const double o,
const double cmn, const double csd,
const SingleThresh &ft, const SingleThresh &ot,
const SetLogic type) {
bool status = true;
bool fcheck = ft.check(f, cmn, csd);
bool ocheck = ot.check(o, cmn, csd);
SetLogic t = type;

// If either of the thresholds is NA, reset the logic to intersection
// because an NA threshold is always true.
if(ft.get_type() == thresh_na || ot.get_type() == thresh_na) {
t = SetLogic_Intersection;
}

switch(t) {
case(SetLogic_Union):
if(!fcheck && !ocheck) status = false;
break;

case(SetLogic_Intersection):
if(!fcheck || !ocheck) status = false;
break;

case(SetLogic_SymDiff):
if(fcheck == ocheck) status = false;
break;

default:
mlog << Error << "\ncheck_fo_thresh() -> "
<< "Unexpected SetLogic value of " << type << ".\n\n";
exit(1);
break;
}

return(status);
}

///////////////////////////////////////////////////////////////////////////////

const char * statlinetype_to_string(const STATLineType t) {
const char *s = (const char *) 0;

Expand Down
4 changes: 0 additions & 4 deletions met/src/basic/vx_config/config_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ extern void check_climo_n_vx(Dictionary *dict, const int);
extern InterpMthd int_to_interpmthd(int);
extern void check_mctc_thresh(const ThreshArray &);

extern bool check_fo_thresh(const double, const double, const double, const double,
const SingleThresh &, const SingleThresh &,
const SetLogic);

extern const char * statlinetype_to_string(const STATLineType);
extern void statlinetype_to_string(const STATLineType, char *);
extern STATLineType string_to_statlinetype(const char *);
Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/met_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ void SL1L2Info::set(const PairDataPoint &pd_all) {
zero_out();

// Apply continuous filtering thresholds to subset pairs
pd = subset_pairs(pd_all, fthresh, othresh, logic);
pd = pd_all.subset_pairs_cnt_thresh(fthresh, othresh, logic);

// Check for no matched pairs to process
if(pd.n_obs == 0) return;
Expand Down
2 changes: 2 additions & 0 deletions met/src/libcode/vx_statistics/pair_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class PairBase {
MaskLatLon *mask_llpnt_ptr; // Pointer to Lat/Lon thresholds
// which is not allocated

//////////////////////////////////////////////////////////////////

ConcatString msg_typ; // Name of the verifying message type
StringArray msg_typ_vals; // Message type values to be included

Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/pair_data_ensemble.cc
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ void PairDataEnsemble::compute_ssvar() {
//
////////////////////////////////////////////////////////////////////////

PairDataEnsemble PairDataEnsemble::subset_pairs(const SingleThresh &ot) const {
PairDataEnsemble PairDataEnsemble::subset_pairs_obs_thresh(const SingleThresh &ot) const {

// Check for no work to be done
if(ot.get_type() == thresh_na) return(*this);
Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_statistics/pair_data_ensemble.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class PairDataEnsemble : public PairBase {
void compute_phist();
void compute_ssvar();

PairDataEnsemble subset_pairs(const SingleThresh &ot) const;
PairDataEnsemble subset_pairs_obs_thresh(const SingleThresh &ot) const;
};

////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 0c2f4d7

Please sign in to comment.