Skip to content

Commit

Permalink
Updated develop-ref after #2175 and #2177 (#2179)
Browse files Browse the repository at this point in the history
Co-authored-by: Julie Prestopnik <jpresto@seneca.rap.ucar.edu>
Co-authored-by: johnhg <johnhg@ucar.edu>
Co-authored-by: Seth Linden <linden@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
Co-authored-by: jprestop <jpresto@ucar.edu>
Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Randy Bullock <bullock@seneca.rap.ucar.edu>
Co-authored-by: davidfillmore <fillmore.winslow.david@gmail.com>
Co-authored-by: rgbullock <bullock@ucar.edu>
Co-authored-by: Seth Linden <linden@seneca.rap.ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: Seth Linden <linden@ucar.edu>
Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@seneca.rap.ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: mo-mglover <78152252+mo-mglover@users.noreply.github.com>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: lisagoodrich <33230218+lisagoodrich@users.noreply.github.com>
Co-authored-by: Dan Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Dave Albo <dave@seneca.rap.ucar.edu>
Co-authored-by: Molly Smith <molly.b.smith@noaa.gov>
  • Loading branch information
23 people authored Jun 10, 2022
1 parent c5ea4c8 commit ee1e6cd
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ See the [METplus Workflow](https://metplus.readthedocs.io/en/latest/Contributors
Select: **Reviewer(s)**
Select: **Organization** level software support **Project** or **Repository** level development cycle **Project**
Select: **Milestone** as the version that will include these changes
- [ ] After submitting the PR, select **Linked issues** with the original issue number.
- [ ] After submitting the PR, select **Development** issue with the original issue number.
- [ ] After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
- [ ] Close the linked issue and delete your feature or bugfix branch from GitHub.
7 changes: 7 additions & 0 deletions docs/Users_Guide/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ The configuration file language supports the following data types:
and 10 and "==1||==2" defines numbers exactly equal to 1 or 2.

* Percentile Thresholds:

* A threshold type (<, <=, ==, !=, >=, or >), followed by a percentile
type description (SFP, SOP, SCP, USP, CDP, or FBIAS), followed by a
numeric value, typically between 0 and 100.

* Note that the two letter threshold type abbreviations (lt, le, eq, ne,
ge, gt) are not supported for percentile thresholds.

* Thresholds may be defined as percentiles of the data being processed in
several places:
Expand Down
28 changes: 28 additions & 0 deletions internal/test_unit/xml/unit_python.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,34 @@
</output>
</test>

<test name="python_numpy_shift_data_plane">
<exec>&MET_BIN;/shift_data_plane</exec>
<param> \
PYTHON_NUMPY \
&OUTPUT_DIR;/python/shift_data_plane.nc \
'name="&MET_BASE;/python/read_ascii_numpy.py &DATA_DIR_PYTHON;/fcst.txt FCST";' \
-from 30 -110 -to 35 -115 \
-v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/python/shift_data_plane.nc</grid_nc>
</output>
</test>

<test name="python_numpy_shift_data_plane_input_arg">
<exec>&MET_BIN;/shift_data_plane</exec>
<param> \
&DATA_DIR_PYTHON;/fcst.txt \
&OUTPUT_DIR;/python/shift_data_plane_input_arg.nc \
'name="&MET_BASE;/python/read_ascii_numpy.py MET_PYTHON_INPUT_ARG FCST"; file_type=PYTHON_NUMPY;' \
-from 30 -110 -to 35 -115 \
-v 1
</param>
<output>
<grid_nc>&OUTPUT_DIR;/python/shift_data_plane_input_arg.nc</grid_nc>
</output>
</test>

<test name="python_numpy_series_analysis">
<exec>&MET_BIN;/series_analysis</exec>
<env>
Expand Down
12 changes: 10 additions & 2 deletions src/libcode/vx_statistics/ens_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,17 @@ void ECNTInfo::set(const PairDataEnsemble &pd) {
}
}

// Compute ensemble mean based statistics, if possible
// Check if the ensemble mean based statistics were
// already computed by Stat-Analysis
if(!is_bad_data(pd.me)) {
me = pd.me;
rmse = pd.rmse;
me_oerr = pd.me_oerr;
rmse_oerr = pd.rmse_oerr;
}
// If not, compute them from the pairs, if possible
// HiRA stores the ensemble mean as bad data
if(!pd.mn_na.is_const(bad_data_double)) {
else if(!pd.mn_na.is_const(bad_data_double)) {

// Compute ME and RMSE values
fbar = obar = ffbar = oobar = fobar = 0.0;
Expand Down
22 changes: 12 additions & 10 deletions src/tools/other/shift_data_plane/shift_data_plane.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// Mod# Date Name Description
// ---- ---- ---- -----------
// 000 11-12-14 Halley Gotway New
// 001 06-07-22 Halley Gotway MET #2173 Fix python embedding
//
////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -50,6 +51,10 @@ using namespace std;
#include "vx_cal.h"
#include "vx_math.h"

#ifdef WITH_PYTHON
#include "data2d_python.h"
#endif

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

static ConcatString program_name;
Expand Down Expand Up @@ -200,17 +205,11 @@ void process_data_file() {
// Populate the VarInfo object using config
vinfo->set_dict(config);

// Open the input file
if(!mtddf->open(InputFilename.c_str())) {
mlog << Error << "\nprocess_data_file() -> can't open file \""
<< InputFilename << "\"\n\n";
exit(1);
}

// Get the data plane from the file for this VarInfo object
if(!mtddf->data_plane(*vinfo, dp_in)) {
mlog << Error << "\nprocess_data_file() -> trouble getting field \""
<< FieldString << "\" from file \"" << InputFilename << "\"\n\n";
mlog << Error << "\nprocess_data_file() -> "
<< "trouble getting field \"" << FieldString
<< "\" from file \"" << InputFilename << "\"\n\n";
exit(1);
}

Expand Down Expand Up @@ -253,7 +252,6 @@ void process_data_file() {
mlog << Debug(2) << shift_cs << "\n";

// Shift the data

dp_shift = dp_in;
for(x=0; x<dp_shift.nx(); x++) {
for(y=0; y<dp_shift.ny(); y++) {
Expand All @@ -270,6 +268,10 @@ void process_data_file() {
if(mtddf) { delete mtddf; mtddf = (Met2dDataFile *) 0; }
if(vinfo) { delete vinfo; vinfo = (VarInfo *) 0; }

#ifdef WITH_PYTHON
GP.finalize();
#endif

return;
}

Expand Down

0 comments on commit ee1e6cd

Please sign in to comment.