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

Add new wind direction verification statistics for RMSE, Bias, and MAE #2395

Closed
11 of 24 tasks
YaliMao-NOAA opened this issue Jan 10, 2023 · 11 comments · Fixed by #2820 or #2892
Closed
11 of 24 tasks

Add new wind direction verification statistics for RMSE, Bias, and MAE #2395

YaliMao-NOAA opened this issue Jan 10, 2023 · 11 comments · Fixed by #2820 or #2892
Assignees
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue MET: Wind Verification priority: high High Priority requestor: NOAA/EMC NOAA Environmental Modeling Center required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone type: new feature Make it do something new
Milestone

Comments

@YaliMao-NOAA
Copy link

YaliMao-NOAA commented Jan 10, 2023

Describe the New Feature

Wind direction verification is different from vector wind and wind speed verification. The specificity of wind direction verification is that wind direction and wind direction difference between forecast and observation need to be adjusted to (-180, +180] degree. The current VCNT and VL1L2 outputs don't support wind direction verifications of RMSE, Bias and MAE.

So here is the request list of new outputs:

  1. N: the number of grid points

  2. MSE (mean squared value of wind direction difference between the forecast and observed wind, this difference needs to be adjusted to (-180, +180] degree)
    DIR2_BAR=sum [(DIRf-DIRo)**2]/N, where DIRf-DIRo needs to be recalculated to (-180, +180], DIRf is forecast wind direction and DIRo is observation wind direction.

  3. Mean Error (mean value of wind direction difference between the forecast and observed wind, this difference needs to be adjusted to (-180, +180] degree)
    DIR_BAR=sum(DIRf-DIRo)/N, where DIRf-DIRo needs to be recalculated to (-180, +180]

  4. MAE (mean absolute value of wind direction difference between the forecast and observed wind, this difference needs to be adjusted to (-180, +180] degree)
    DIR_ABSBAR=sum[abs(DIRf-DIRo)]/N, where DIRf-DIRo needs to be recalculated to (-180, +180]

Meanwhile, the outputs will allow wind speed threshold settings.

Acceptance Testing

List input data types and sources.
Describe tests required for new functionality.

Time Estimate

2 days.

Sub-Issues

Consider breaking the new feature down into sub-issues.
None needed.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Repository and/or Organization level Project(s) or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

Define Related Issue(s)

Consider the impact to the other METplus components.

New Feature Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding source.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Development issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@YaliMao-NOAA YaliMao-NOAA added alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED MORE DEFINITION Not yet actionable, additional definition required alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle type: new feature Make it do something new labels Jan 10, 2023
@JohnHalleyGotway JohnHalleyGotway added requestor: NOAA/EMC NOAA Environmental Modeling Center MET: Wind Verification priority: high High Priority and removed alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle labels Jan 19, 2023
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.1.0 milestone Jan 19, 2023
@JohnHalleyGotway JohnHalleyGotway added the required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone label Jul 24, 2023
@JohnHalleyGotway JohnHalleyGotway added required: FOR DEVELOPMENT RELEASE Required to be completed in the development release for the assigned project and removed required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone labels Oct 16, 2023
@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Jan 24, 2024

@malloryprow and @YaliMao-NOAA, I'm working on this issue and have a question about the degenerate case.

First, I'm adding this to the existing VL1L2Info class and plan to write the resulting stats to the VCNT continuous vector statistics line type. The TOTAL column in that line indicates the number of points used to compute the statistics in it. If any of the 4 forecast or observation U or V wind component values is bad data, then that point will be excluded from these stats. But if the forecast U and V or the observation U and V are both 0, then the direction is not defined for that vector. And MET sets it to bad data... and so the forecast - observation direction difference is also bad data.

The question is what do to in this case? Practically speaking this shouldn't come up that often because you should configure MET to compute vector stats using some wind speed threshold... meaning that we'll only evaluate vectors whose direction is well-defined.

But we do need to decide how the MET software should handle this.

Options include:

  1. Just skip over that point and don't include the direction diff in the running sum. Given how weights are currently computed, that's mathematically equivalent to saying the direction difference is 0 when either or both directions are not defined. Optionally, I could keep track of how often this occurs and write a log message with that info.

  2. Keep separate counts for the valid U/V pairs and valid wind direction differences. This would exclude that point from the statistics, but require more bookkeeping. And there's currently no output column to indicate total number of U/V pairs vs total number wind direction differences. So while the stats would be more accurate, we wouldn't actually be writing the count... unless we add it.

Just wanted to lay out these considerations to see if you can provide any direction on them.

@malloryprow
Copy link

@JohnHalleyGotway,

@YaliMao-NOAA has code the currently does wind direction statistics so hopefully she can provide more insight into what her code does in this situation.

@ericgilleland
Copy link
Contributor

@JohnHalleyGotway What statistics are computed for these data? Is it using directional and/or circular statistics (e.g., von Mises distributions)? I don't see why you can't have zero unless the statistics are undefined there (division or log of zero). I would think the information about u and v being zero in both forecast and obs (or only one) could be useful.

@YaliMao-NOAA
Copy link
Author

@JohnHalleyGotway
Option 1 looks more practically to me but I have one question. For the skipped points that wind direction is not defined (wind speed is zero), will they be skipped if a wind speed threshold is applied?

@JohnHalleyGotway
Copy link
Collaborator

@YaliMao-NOAA, no, if a wind speed threshold is used, then those 0-vectors will be filtered out and the wind directions will be well-defined. So this is easily addressed with a configuration file option.

But there are specific details to consider...

  • If you apply the wind speed threshold to the forecast AND observation vectors, this should never happen because both will have speed > 0.
  • If you apply the wind speed threshold to only the observation vectors (or only the forecast vectors), then you could still encounter 0-vectors with undefined direction.

Based on recent issues raised on WCOSS2, I'll write a DEBUG level 3 log message about this rather than a WARNING message which would raise alarm bells.

If we want to be able to aggregate these direction stats across multiple runs, I should also add new columns to the VL1L2 vector partial sums output line, so that we can aggregated VL1L2 and then derived VCNT stats from the aggregated lines. I'll plan on doing that as well.

@ericgilleland
Copy link
Contributor

@JohnHalleyGotway Perhaps another way to go would be to have a default to a threshold (for both) that is just a little more than zero along with a note in the config file explaining why you want to use a threshold?

@YaliMao-NOAA
Copy link
Author

@JohnHalleyGotway Perhaps another way to go would be to have a default to a threshold (for both) that is just a little more than zero along with a note in the config file explaining why you want to use a threshold?

That's what I am thinking about too. The default threshold should be applied to both forecast and observation. WAFS wind direction uses wind speed threshold 10knots=5.14444m/s which may be too big as a default non-zero value for the general verification.

JohnHalleyGotway added a commit that referenced this issue Feb 12, 2024
…wind direction statistics. Work still in progress.
JohnHalleyGotway added a commit that referenced this issue Feb 13, 2024
…additions to the VL1L2, VAL1L2, and VCNT columns.
@JohnHalleyGotway JohnHalleyGotway changed the title Adding outputs for wind direction verifications of RMSE, Bias and MAE Adding outputs for wind direction verifications of RMSE, Bias, and MAE Feb 13, 2024
@JohnHalleyGotway JohnHalleyGotway removed the alert: NEED MORE DEFINITION Not yet actionable, additional definition required label Feb 13, 2024
JohnHalleyGotway added a commit that referenced this issue Apr 17, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue May 1, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
georgemccabe added a commit that referenced this issue May 8, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue May 15, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented May 16, 2024

Reopening this issue and reassigning to the MET-12.0.0 beta5 development cycle based on discussion dtcenter/METplus#2590.

Recommend adding the following changes:

  1. Update the VL1L2Info class to track the number of U/V pairs for which both the forecast and observation vectors are non-zero, which is required for wind direction to be well-defined.
  2. Update the VL1L2, VAL1L2, and VCNT line types to report that count in a new TOTAL_DIR column.
  3. Update the logic of Stat-Analysis to parse this new TOTAL_DIR column and use it to aggregate wind direction statistics rather than the existing TOTAL column.
  4. Coordinate with METdataio and METcaclpy to update the parsing and aggregation logic there.

JohnHalleyGotway added a commit that referenced this issue May 16, 2024
… superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.
JohnHalleyGotway added a commit that referenced this issue May 16, 2024
…types and update the header column tables.
JohnHalleyGotway added a commit that referenced this issue May 16, 2024
…in the VL1L2, VAL1L2, and VCNT line types.
JohnHalleyGotway added a commit that referenced this issue May 16, 2024
…d use the values to aggregate results when needed.
@JohnHalleyGotway JohnHalleyGotway linked a pull request May 16, 2024 that will close this issue
17 tasks
@AliciaBentley-NOAA
Copy link

@JohnHalleyGotway Can this wind direction MET issue be marked as required for the official release? Thanks!

JohnHalleyGotway added a commit that referenced this issue May 17, 2024
…' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.
JohnHalleyGotway added a commit that referenced this issue May 17, 2024
@JohnHalleyGotway JohnHalleyGotway added required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone and removed required: FOR DEVELOPMENT RELEASE Required to be completed in the development release for the assigned project labels May 17, 2024
JohnHalleyGotway added a commit that referenced this issue May 20, 2024
…king 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.
JohnHalleyGotway added a commit that referenced this issue May 22, 2024
* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.
JohnHalleyGotway added a commit that referenced this issue May 22, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue May 23, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

* Bugfix #2897 develop python_valid_time (#2899)

* Per #2897, fix typos in 2 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, minor change to formatting of log message

* MET #2897, don’t waste time searching, just set the index to n - 1

* Per #2897, remove unused add_prec_point_obs(...) function

* Per #2897, update add_point_obs(...) logic for DEBUG(9) to print very detailed log messages about what obs are being rejected and which are being used for each verification task.

* Per #2897, refine the 'using' log message to make the wording consistent with the summary rejection reason counts log message

* Per #2897, update the User's Guide about -v 9 for Point-Stat

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag (#2890)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* Per #2867, fixing typo in comments.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Hotfix to develop to fix the update_truth.yml workflow logic. This testing workflow run failed (https://github.com/dtcenter/MET/actions/runs/9209471209). Here we switch to a unique update truth branch name to avoid conflicts.

* Avoid pushing directly to the develop or main_vX.Y branches since that is not necessary for the automation logic in MET.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jun 14, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

* Bugfix #2897 develop python_valid_time (#2899)

* Per #2897, fix typos in 2 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, minor change to formatting of log message

* MET #2897, don’t waste time searching, just set the index to n - 1

* Per #2897, remove unused add_prec_point_obs(...) function

* Per #2897, update add_point_obs(...) logic for DEBUG(9) to print very detailed log messages about what obs are being rejected and which are being used for each verification task.

* Per #2897, refine the 'using' log message to make the wording consistent with the summary rejection reason counts log message

* Per #2897, update the User's Guide about -v 9 for Point-Stat

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag (#2890)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* Per #2867, fixing typo in comments.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Hotfix to develop to fix the update_truth.yml workflow logic. This testing workflow run failed (https://github.com/dtcenter/MET/actions/runs/9209471209). Here we switch to a unique update truth branch name to avoid conflicts.

* Avoid pushing directly to the develop or main_vX.Y branches since that is not necessary for the automation logic in MET.

* #2904 Changed R path to R-4.4.0 (#2905)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2912 pb2nc error (#2914)

* Feature 2717 convert unit.pl to unit.py (#2871)

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* fixed how the test command was being run

* added if name/main and command line parsing

* fixed handling of no 'env' in cmd_only mode

* handle params from xml that have \ after filename without space in between

* added logging

* added some more pieces to unit

* more updates to unit.py, including running checks on output files

* bug fixes, improved handling of output file names, improved handling of env vars, improved logging output

* fixed how shell commands are run, and other minor fixes

* added last bits from the perl script, fixed some bugs

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* update scripts to call python unit test script instead of the old perl script

* fix she-bang line to allow script to be run without python3 before it

* add missing test_dir and exit_on_fail tags that are found in the rest of the unit test xml files

* fix call to logger.warning

* change tags named 'exists' to 'exist' to match the rest of the xml files

* added logger to function

* removed tab at end of line that was causing output file path to be excluded from the command

* fix broken checks for output files

* incorporated george's recommended changes

* changed default to overwrite logs; allow for more than one xml file to be passed in command

---------

Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Bugfix 2867 point2grid qc unittest (#2913)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* #2867 Some 'static const' were chnaged to constexpr

* #2867 Changed -qc options (1,2,3 to 0,1 - high & medium) for AOD

* #2867 Merged develop branch

* #2867 Corrected the unit test name

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: natalieb-noaa <146213121+natalieb-noaa@users.noreply.github.com>
Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jun 19, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

* Bugfix #2897 develop python_valid_time (#2899)

* Per #2897, fix typos in 2 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, minor change to formatting of log message

* MET #2897, don’t waste time searching, just set the index to n - 1

* Per #2897, remove unused add_prec_point_obs(...) function

* Per #2897, update add_point_obs(...) logic for DEBUG(9) to print very detailed log messages about what obs are being rejected and which are being used for each verification task.

* Per #2897, refine the 'using' log message to make the wording consistent with the summary rejection reason counts log message

* Per #2897, update the User's Guide about -v 9 for Point-Stat

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag (#2890)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* Per #2867, fixing typo in comments.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Hotfix to develop to fix the update_truth.yml workflow logic. This testing workflow run failed (https://github.com/dtcenter/MET/actions/runs/9209471209). Here we switch to a unique update truth branch name to avoid conflicts.

* Avoid pushing directly to the develop or main_vX.Y branches since that is not necessary for the automation logic in MET.

* #2904 Changed R path to R-4.4.0 (#2905)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2912 pb2nc error (#2914)

* Feature 2717 convert unit.pl to unit.py (#2871)

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* fixed how the test command was being run

* added if name/main and command line parsing

* fixed handling of no 'env' in cmd_only mode

* handle params from xml that have \ after filename without space in between

* added logging

* added some more pieces to unit

* more updates to unit.py, including running checks on output files

* bug fixes, improved handling of output file names, improved handling of env vars, improved logging output

* fixed how shell commands are run, and other minor fixes

* added last bits from the perl script, fixed some bugs

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* update scripts to call python unit test script instead of the old perl script

* fix she-bang line to allow script to be run without python3 before it

* add missing test_dir and exit_on_fail tags that are found in the rest of the unit test xml files

* fix call to logger.warning

* change tags named 'exists' to 'exist' to match the rest of the xml files

* added logger to function

* removed tab at end of line that was causing output file path to be excluded from the command

* fix broken checks for output files

* incorporated george's recommended changes

* changed default to overwrite logs; allow for more than one xml file to be passed in command

---------

Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Bugfix 2867 point2grid qc unittest (#2913)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* #2867 Some 'static const' were chnaged to constexpr

* #2867 Changed -qc options (1,2,3 to 0,1 - high & medium) for AOD

* #2867 Merged develop branch

* #2867 Corrected the unit test name

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2911 tc_stat_set_hdr (#2916)

* Per #2911, no real changes for Stat-Analysis. Just changing order of variables for consistency.

* Per #2911, add StatHdrColumns::apply_set_hdr_opts(...) function to be used by TC-Stat.

* Per #2911, move ByColumn to the TCStatJob base class and add HdrName and HdrValue to support the -set_hdr job command.

* Per #2911, update GSI tools to call the newly added  StatHdrColumns::apply_set_hdr_opts(...) function.

* Per #2911, update logic of Stat-Analysis for consistency to make use of common apply_set_hdr_opts() function.

* Per #2911, add DataLine::set_item() function to support -set_hdr options.

* Per #2911, just update contents of error message

* Per #2911, add TCStatLine member functions for has() and get_offset().

* Per #2911, update tc_stat to support applying -set_hdr to TC-Stat filter jobs.

* Per #2911, revise TC-Stat config files to exercise the -set_hdr job command option

* Per #2911, update TC-Stat documentation to mention the -set_hdr job command option

* Per #2911, add note

* Per #2911, as recommended by SonarQube, make some of these member functions const.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: natalieb-noaa <146213121+natalieb-noaa@users.noreply.github.com>
Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jun 21, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

* Bugfix #2897 develop python_valid_time (#2899)

* Per #2897, fix typos in 2 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, minor change to formatting of log message

* MET #2897, don’t waste time searching, just set the index to n - 1

* Per #2897, remove unused add_prec_point_obs(...) function

* Per #2897, update add_point_obs(...) logic for DEBUG(9) to print very detailed log messages about what obs are being rejected and which are being used for each verification task.

* Per #2897, refine the 'using' log message to make the wording consistent with the summary rejection reason counts log message

* Per #2897, update the User's Guide about -v 9 for Point-Stat

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag (#2890)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* Per #2867, fixing typo in comments.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Hotfix to develop to fix the update_truth.yml workflow logic. This testing workflow run failed (https://github.com/dtcenter/MET/actions/runs/9209471209). Here we switch to a unique update truth branch name to avoid conflicts.

* Avoid pushing directly to the develop or main_vX.Y branches since that is not necessary for the automation logic in MET.

* #2904 Changed R path to R-4.4.0 (#2905)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2912 pb2nc error (#2914)

* Feature 2717 convert unit.pl to unit.py (#2871)

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* fixed how the test command was being run

* added if name/main and command line parsing

* fixed handling of no 'env' in cmd_only mode

* handle params from xml that have \ after filename without space in between

* added logging

* added some more pieces to unit

* more updates to unit.py, including running checks on output files

* bug fixes, improved handling of output file names, improved handling of env vars, improved logging output

* fixed how shell commands are run, and other minor fixes

* added last bits from the perl script, fixed some bugs

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* update scripts to call python unit test script instead of the old perl script

* fix she-bang line to allow script to be run without python3 before it

* add missing test_dir and exit_on_fail tags that are found in the rest of the unit test xml files

* fix call to logger.warning

* change tags named 'exists' to 'exist' to match the rest of the xml files

* added logger to function

* removed tab at end of line that was causing output file path to be excluded from the command

* fix broken checks for output files

* incorporated george's recommended changes

* changed default to overwrite logs; allow for more than one xml file to be passed in command

---------

Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Bugfix 2867 point2grid qc unittest (#2913)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* #2867 Some 'static const' were chnaged to constexpr

* #2867 Changed -qc options (1,2,3 to 0,1 - high & medium) for AOD

* #2867 Merged develop branch

* #2867 Corrected the unit test name

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2911 tc_stat_set_hdr (#2916)

* Per #2911, no real changes for Stat-Analysis. Just changing order of variables for consistency.

* Per #2911, add StatHdrColumns::apply_set_hdr_opts(...) function to be used by TC-Stat.

* Per #2911, move ByColumn to the TCStatJob base class and add HdrName and HdrValue to support the -set_hdr job command.

* Per #2911, update GSI tools to call the newly added  StatHdrColumns::apply_set_hdr_opts(...) function.

* Per #2911, update logic of Stat-Analysis for consistency to make use of common apply_set_hdr_opts() function.

* Per #2911, add DataLine::set_item() function to support -set_hdr options.

* Per #2911, just update contents of error message

* Per #2911, add TCStatLine member functions for has() and get_offset().

* Per #2911, update tc_stat to support applying -set_hdr to TC-Stat filter jobs.

* Per #2911, revise TC-Stat config files to exercise the -set_hdr job command option

* Per #2911, update TC-Stat documentation to mention the -set_hdr job command option

* Per #2911, add note

* Per #2911, as recommended by SonarQube, make some of these member functions const.

* Bugfix #2856 develop ens_climo (#2918)

* Per #2856, port over fixes from main_v11.1 to develop.

* Per #2856, correct conditionals in set_job_controls.sh and tweak existing Ensemble-Stat configuration file to exercise the logic that's being impacted here.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: natalieb-noaa <146213121+natalieb-noaa@users.noreply.github.com>
Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
JohnHalleyGotway added a commit that referenced this issue Jun 24, 2024
* 2673 Moved dvariable declaration after include

* #2673 Move down namespace below include

* Feature #2395 wdir (#2820)

* Per #2395, add new columns to VL1L2, VAL1L2, and VCNT line types for wind direction statistics. Work still in progress.

* Per #2395, write the new VCNT columns to the output and document the additions to the VL1L2, VAL1L2, and VCNT columns.

* Per #2395, add the definition of new statistics to Appendix G.

* Per #2395, update file version history.

* Per #2395, tweak warning message about zero wind vectors and update grid-stat and point-stat to log calls to the do_vl1l2() function.

* Per #2395, refine the weights for wind direction stats, ignoring the undefined directions.

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Update src/tools/core/stat_analysis/parse_stat_line.cc

* Update src/tools/core/stat_analysis/aggr_stat_line.cc

* Recent changes to branch protection rules for the develop branch have broken the logic of the update_truth.yml GHA workflow. Instead of submitting a PR to merge develop into develop-ref directly, use an intermediate update_truth_for_develop branch.

* Feature #2280 ens_prob (#2823)

* Per #2280, update to support probability threshold strings like ==8, where 8 is the number of ensemble members, to create probability bins centered on the n/8 for n = 0 ... 8.

* Per #2280, update docs about probability threshold settings.

* Per #2280, use a loose tolerance when checking for consistent bin widths.

* Per #2280, add a new unit test for grid_stat to demonstrate processing the output from gen_ens_prod.

* Per #2280, when verifying NMEP probability forecasts, smooth the obs data first.

* Per #2280, only request STAT output for the PCT line type to match unit_grid_stat.xml and minimize the new output files.

* Per #2280, update config option docs.

* Per #2280, update config option docs.

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Change 0 to nullptr

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 Removed the redundant parentheses with return

* #2673 restored return statement

* #2673 Added std namespace

* #2673 Moved down 'using namespace' statement. Removed trailing spaces

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Moved down 'using namespace' statement.

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Added std namespace

* #2673 Changed literal 1 to boolean value, true

* Feature #2673 enum_to_string (#2835)

* Feature #2583 ecnt (#2825)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Revert #2825 since more documentation and testing is needed (#2837)

This reverts commit 108a895.

* Feature #2583 ecnt fix IGN_OERR_CORR (#2838)

* Unrelated to #2583, fix typo in code comments.

* Per #2583, add hooks write 3 new ECNT columns for observation error data.

* Per #2583, make error messages about mis-matched array lengths more informative.

* Per #2583, switch to more concise variable naming conventions of ign_oerr_cnv, ign_oerr_cor, and dawid_seb.

* Per #2583, fix typo to enable compilation

* Per #2583, define the 5 new ECNT column names.

* Per #2583, add 5 new columns to the ECNT table in the Ensemble-Stat chapter

* Per #2583, update stat_columns.cc to write these 5 new ECNT columns

* Per #2583, update ECNTInfo class to compute the 5 new ECNT statistics.

* Per #2583, update stat-analysis to parse the 5 new ECNT columns.

* Per #2583, update aggregate_stat logic for 5 new ECNT columns.

* Per #2583, update PairDataEnsemble logic for 5 new ECNT columns

* Per #2583, update vx_statistics library with obs_error handling logic for the 5 new ECNT columns

* Per #2583, changes to make it compile

* Per #2583, changes to make it compile

* Per #2583, switch to a consistent ECNT column naming convention with OERR at the end. Using IGN_CONV_OERR and IGN_CORR_OERR.

* Per #2583, define ObsErrorEntry::variance() with a call to the dist_var() utility function.

* Per #2583, update PairDataEnsemble::compute_pair_vals() to compute the 5 new stats with the correct inputs.

* Per #2583, add DEBUG(10) log messages about computing these new stats.

* Per #2583, update Stat-Analysis to compute these 5 new stats from the ORANK line type.

* Per #2583, whitespace and comments.

* Per #2583, update the User's Guide.

* Per #2583, remove the DS_ADD_OERR and DS_MULT_OERR ECNT columns and rename DS_OERR as DSS, since observation error is not actually involved in its computation.

* Per #2583, minor update to Appendix C

* Per #2583, rename ECNT line type statistic DSS to IDSS.

* Per #2583, fix a couple of typos

* Per #2583, more error checking.

* Per #2583, remove the ECNT IDSS column since its just 2*pi*IGN, the existing ignorance score, and only provides meaningful information when combined with the other Dawid-Sebastiani statistics that have already been removed.

* Per #2583, add Eric's documentation of these new stats to Appendix C. Along the way, update the DOI links in the references based on this APA style guide: https://apastyle.apa.org/style-grammar-guidelines/references/dois-urls#:~:text=Include%20a%20DOI%20for%20all,URL%2C%20include%20only%20the%20DOI.

* Per #2583, fix new equations with embedded underscores for PDF by defining both html and pdf formatting options.

* Per #2583, update the ign_conv_oerr equation to include a 2
*pi multiplier for consistency with the existing ignorance score. Also, fix the documented equations.

* Per #2583, remove log file that was inadvertently added on this branch.

* Per #2583, simplify ObsErrorEntry::variance() implementation. For the distribution type of NONE, return a variance of 0.0 rather than bad data, as discussed with @michelleharrold and @JeffBeck-NOAA on 3/8/2024.

* Per #2583, updates to ensemble-stat.rst recommended by @michelleharrold and @JeffBeck-NOAA.

* Per #2583, implement changes to the IGN_CORR_OERR corrected as directed by @ericgilleland.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Update the pull request template to include a question about expected impacts to existing METplus Use Cases.

* #2830 Changed enum Builtin to enum class

* #2830 Converted enum to enum class at config_constants.h

* Feature #2830 bootstrap enum (#2843)

* Bugfix #2833 develop azimuth (#2840)

* Per #2833, fix n-1 bug when defining the azimuth delta for range/azimuth grids.

* Per #2833, when definng TcrmwData:range_max_km, divide by n_range - 1 since the range values start at 0.

* Per #2833, remove max_range_km from the TC-RMW config file. Set the default rmw_scale to NA so that its not used by default. And update the documentation. Still actually need to make the logic of the code work as it should.

* Per #2833, update tc_rmw to define the range as either a function of rmw or using explicit spacing in km.

* Per #2833, update the TCRMW Config files to remove the max_range_km entry, and update the unit test for one call to use RMW ranges and the other to use ranges defined in kilometers.

* Per #2833, just correct code comments.

* Per #2833, divide by n - 1 when computing the range delta, rather than n.

* Per #2833, correct the handling of the maximum range in the tc-rmw tool. For fixed delta km, need to define the max range when setting up the grid at the beginning.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* #2830 Changed enum PadSize to enum class

* #2830 Removed redundant parantheses

* #2830 Removed commenyted out code

* #2830 Use auto

* #2830 Changed enum to enum class for DistType, InterpMthd, GridTemplates, and NormalizeType

* #2830 Moved enum_class_as_integer from header file to cc files

* #2830 Added enum_as_int.hpp

* #2830 Added enum_as_int.hpp

* Deleted enum_class_as_integer and renamed it to enum_class_as_int

* Removed redundant paranthese

* #2830 Changed enum to enumclass

* #2830 Changed enum_class_as_integer to enum_class_as_int

* Feature #2379 sonarqube gha (#2847)

* Per #2379, testing initial GHA SonarQube setup.

* Per #2379, switch to only analyzing the src directory.

* Per #2379, move more config logic from sonar-project.properties into the workflow. #ci-skip-all

* Per #2379, try removing + symbols

* Per #2379, move projectKey into xml workflow and remove sonar-project.properties.

* Per #2379, try following the instructions at https://github.com/sonarsource-cfamily-examples/linux-autotools-gh-actions-sq/blob/main/.github/workflows/build.yml ci-skip-all

* Per #2379, see details of progress described in this issue comment: #2379 (comment)

* Unrelated to #2379, just removing spurious space that gets flagged as a diff when re-running enum_to_string on seneca.

* Per #2379, try running SonarQube through GitHub.

* Per #2379, remove empty env section and also disable the testing workflow temporarily during sonarqube development.

* Per #2379, fix docker image name.

* Per #2379, delete unneeded script.

* Per #2379, update GHA to scan Python code and push to the correct SonarQube projects.

* Per #2379, update GHA SonarQube project names

* Per #2379, update the build job name

* Per #2379, update the comile step name

* Per #2379, switch to consistent SONAR variable names.

* Per #2379, fix type in sed expressions.

* Per #2379, just rename the log artifact

* Per #2379, use time_command wrapper instead of run_command.

* Per #2379, fix bad env var name

* Per #2379, switch from egrep to grep.

* Per #2379, just try cat-ting the logfile

* Per #2379, test whether cat-ting the log file actually works.

* Per #2379, revert back

* Per #2379, mention SonarQube in the PR template. Make workflow name more succinct.

* Per #2379, add SONAR_REFERENCE_BRANCH setting to define the sonar.newCode.referenceBranch property. The goal is to define the comparison reference branch for each SonarQube scan.

* Per #2379, have the sonarqube.yml job print the reference branch it's using

* Per #2379, intentionally introduce a new code smell to see if SonarQube correctly flag it as appearing in new code.

* Per #2379, trying adding the SonarQube quality gate check.

* Per #2379, add logic for using the report-task.txt output files to check the quality gate status for both the python and cxx scans.

* Per #2379 must use unique GHA id's

* Per #2379, working on syntax for quality gate checks

* Per #2379, try again.

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try again

* Per #2379, try yet again

* Per #2379

* Per #2379, add more debug

* Per #2379, remove -it option from docker run commands

* Per #2379, again

* Per #2379, now that the scan works as expected, remove the intentional SonarQube code smell as well as debug logging.

* Hotfix related to #2379. The sonar.newCode.referenceBranch and sonar.branch.name cannot be set to the same string! Only add the newCode definition when they differ.

* #2830 Changed enum STATJobType to enum class

* #2830 Changed STATLineType to enum class

* #2830 Changed Action to enum class

* #2830 Changed ModeDataType to enum class

* #2830 Changed StepCase to enum class

* #2830 Changed enum to enum class

* #2830 Changed GenesisPairCategory to enum class

* #2830 Removed rediundabt parenrthese

* #2830 Reduced same if checking

* #2830 Cleanup

* #2830 USe empty() instead of lebgth checking

* #2830 Adjusted indentations

* Feature #2379 develop sonarqube updates (#2850)

* Per #2379, move rgb2ctable.py into the python utility scripts directory for better organization and to enable convenient SonarQube scanning.

* Per #2379, remove point.py from the vx_python3_utils directory which cleary was inadvertenlty added during development 4 years ago. As far as I can tell it isn't being called by any other code and doesn't belong in the repository. Note that scripts/python/met/point.py has the same name but is entirely different.

* Per #2379, update the GHA SonarQube scan to do a single one with Python and C++ combined. The nightly build script is still doing 2 separate scans for now. If this all works well, they could also be combined into a single one.

* Per #2379, eliminate MET_CONFIG_OPTIONS from the SonarQube workflow since it doesn't need to be and probably shouldn't be configurable.

* Per #2379, trying to copy report-task.txt out of the image

* Per #2379, update build_met_sonarqube.sh to check the scan return status

* Per #2379, fix bash assignment syntax

* Per #2379, remove unused SCRIPT_DIR envvar

* Per #2379, switch to a single SonarQube scan for MET's nightly build as well

* Feature 2654 ascii2nc polar buoy support (#2846)

* Added iabp data type, and modified file_handler to filter based on time range, which was added as a command line option

* handle time using input year, hour, min, and doy

* cleanup and switch to position day of year for time computations

* Added an ascii2nc unit test for iabp data

* Added utility scripts to pull iabp data from the web and find files in a time range

* Modified iabp_handler to always output a placeholder 'location' observation with value 1

* added description of IABP data python utility scripts

* Fixed syntax error

* Fixed Another syntax error.

* Slight reformat of documentation

* Per #2654, update the Makefiles in scripts/python/utility to include all the python scripts that should be installed.

* Per #2654, remove unused code from get_iabp_from_web.py that is getting flagged as a bug by SonarQube.

* Per #2654, fix typo in docs

---------

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Feature #2786 rpss_from_prob (#2861)

* Per #2786, small change to a an error message unrelated to this development.

* Per #2786, add RPSInfo::set_climo_prob() function to derive the RPS line type from climatology probability bins. And update Ensemble-Stat to call it.

* Per #2786, minor change to clarify error log message.

* Per #2786, for is_prob = TRUE input, the RPS line type is the only output option. Still need to update docs!

* Per #2786, add new call to Ensemble-Stat to test computing RPS from climo probabilities

* Per #2786, use name rps_climo_bin_prob to be very explicit.

* Per #2786, redefine logic of RPSInfo::set_climo_bin_prob() to match the CPC definition. Note that reliability, resolution, uncertainty, and RPSS based on the sample climatology are all set to bad data. Need to investigate whether they can be computed using these inputs.

* Per #2786, remove the requirement that any fcst.prob_cat_thresh thresholds must be defined. If they are defined, pass them through to the FCST_THRESH output column. If not, write NA. Add check to make sure the event occurs in exactly 1 category.

* Per #2786, don't enforce fcst.prob_cat_thresh == obs.prob_cat_thresh for probabilistic inputs. And add more is_prob checks so that only the RPS line type can be written when given probabilistic inputs.

* updated documentation

* Per #2786, call rescale_probability() function to convert from 0-100 probs to 0-1 probs.

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>

* Feature #2862 v12.0.0-beta4 (#2864)

* Feature #2379 develop single_sq_project (#2865)

* Hotfix to the documentation in the develop branch. Issue #2858 was closed as a duplicate of #2857. I had included it in the MET-12.0.0-beta4 release notes, but the work is not yet actually complete.

* Feature 2842 ugrid config (#2852)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature 2753 comp script config (#2868)

* set dynamic library file extension to .dylib if running on MacOS and .so otherwise

* Added disabling of jasper documentation for compiliation on Hera

* Updated

* remove extra export of compiler env vars

* include full path to log file so it is easier to file the log file to examine when a command fails

* send cmake output to a log file

* remove redundant semi-colon

* use full path to log file so it is easier to examine on failure

* use run_cmd to catch if rm command fails

* Modifications for compilation on hera, gaea, and orion

* Updating

* fixed variable name

* clean up if/else statements

* set TIFF_LIBRARY_RELEASE argument to use full path to dynamic library file to prevent failure installing proj library

* set LDFLAGS so that LDFLAGS value set in the user's environment will also be used

* Updated based on gaea, orion, and hera installs

* Updated

* change extension of dynamic library files only if architecture is arm64 because older Macs still use .so

* added netcdf library to args to prevent error installing NetCDF-CXX when PROJ has been installed in the same run of the script -- PATH is set in the COMPILE_PROJ if block that causes this flag from being added automatically

* clean up how rpath and -L are added to LDFLAGS so that each entry is separate -- prevents errors installing on Mac arm64 because multiple rpath values aren't read using :. Also use MET_PROJLIB

* Updated

* removed -ltiff from MET libs

* only add path to rpath and -L arguments if they are not already included in LDFLAGS

* changed from using LIB_TIFF (full path to tiff lib file) to use TIFF_LIB_DIR (dir containing tiff lib file). Added TIFF_INCLUDE_DIR to proj compilation and -DJAS_ENABLE_DOC to jasper compliation taken from @jprestop branch

* update comments

* ensure all MET_* and MET_*LIB variables are added to the rpath for consistency

* remove unnecessary if block and only export LDFLAGS at the end of setting locally

* Updated

* Added section for adding <VALUE>/lib64 and rearranged placement of ADDTL_DIR

* Commenting out the running of the Jasper lib tests

* Updating and/or removing files

* Updating and/or removing files

* Latest udpates which include the addition of the tiff library for proj

* Remove commented out line.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Make indentation consistent.

Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Per 2753, added -lm to configure_lib_args for NetCDF-CXX

* Per #2753 updating acorn files

* Per #2753, update wcoss2 files

* Per #2753, updating acorn file to include MET_PYTHON_EXE

* Per #2753, updated files for 12.0.0 for derecho

* Per #2753, updated derecho file adding MET_PYTHON_EXE and made corrections

* Updating config files

* Updating orion files

* Updates for gaea's files

* Updating gaea modulefile

* Removing modulefile for cheyenne

* Added MET_PYTHON_EXE

* Added MET_PYTHON_EXE to hera too

* Adding file for hercules

* Removing equals sign from setenv

* Adding file for hercules

* Updated script to add libjpeg installation for grib2c

* Per #2753, Adding file for casper

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Feature #2795 level_mismatch_warning (#2873)

* Per #2795, move the warning message about level mismatch from the config validation step to when the forecast files are being processed. Only check this when the number of forecast fields is greater than 1, but no longer limit the check to pressure levels only.

* Per #2795, add comments

* Whitespace

* Per #2795, port level mismatch fix over to Ensemble-Stat. Check it for each verification task, but only print it once for each task, rather than once for each task * ensemble member.

* Feature #2870 removing_MISSING_warning (#2872)

* Per #2870, define utility functions for parsing the file type from a file list and for logging missing files, checking for the MISSING keyword. Also, update Ensemble-Stat and Gen-Ens-Prod to call these functions.

* Per #2870, update the gen_ens_prod tests to demonstrate the use of the MISSING keyword for missing files. METplus uses this keyword for Ensemble-Stat and Gen-Ens-Prod.

* Feature 2842 ugrid config (#2875)

* #2842 Removed UGrid related setting

* #2842 Corrected vertical level for data_plane_array

* #2842 Do not allow the time range

* #2842 The UGridConfig file can be passed as ugrid_dataset

* #2842 Changed -config option to -ugrid_config

* #2842 Deleted UGrid configurations

* 2842 Fix a compile error when UGrid is disabled

* #2842 Cleanup

* #2842 Added an unittest point_stat_ugrid_mpas_config

* #2842 Added a PointStatConfig without UGrid dataset.

* #2842 Corrected ty[po at the variable name

* Switched from time_centered to time_instant. I think time_centered is the center of the forecast lead window and time_instant is the time the forecast is valid (end of forecast window).

* #2842 Removed ugrid_max_distance_km and unused metadata names

* #2842 Restored time variable time_instant for LFric

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjust lon between -180 and 180

* #2842 Adjusted lon to between -180 to 180

* #2842 Changed variable names

* Per #2842, switch from degrees east to west right when the longitudes are read.

* #2842, switch from degrees east to west right when the longitudes are read

* #2842 Cleanup debug messages

* #2842 Disabled output types except STAT for sl1l2

* #2842 Disabled output types except STAT for sl1l2 and MPR

* #2842 Reduced output files for UGrid

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>

* Hotfix to develop branch to remove duplicate test named 'point_stat_ugrid_mpas_config'. That was causing unit_ugrid.xml to fail because it was still looking for .txt output files that are no longer being generated.

* Feature 2748 document ugrid (#2869)

* Initial documentation of the UGRID capability.

* Fixes error in references, adds appendix to index, and adds sub-section for configuration entries and a table for metadata map items.

* Corrects LFRic, rewords section on UGRID conventions, updates description of using GridStat, and removes mention of nodes.

* Forgot one more mention of UGRID conventions.

* Incorporates more suggestions from @willmayfield.

* Switches to numerical table reference.

* Feature #2781 Convert MET NetCDF point obs to Pandas DataFrame (#2877)

* Per #2781, added function to convert MET NetCDF point observation data to pandas so it can be read and modified in a python embedding script. Added example python embedding script

* ignore python cache files

* fixed function call

* reduce cognitive complexity to satisfy SonarQube and add boolean return value to catch if function fails to read data

* clean up script and add comments

* replace call to object function that doesn't exist, handle exception when file passed to script cannot be read by the NetCDF library

* rename example script

* add new example script to makefiles

* fix logic to build pandas DataFrame to properly get header information from observation header IDs

* Per #2781, add unit test to demonstrate python embedding script that reads MET NetCDF point observation file and converts it to a pandas DataFrame

* Per #2781, added init function for nc_point_obs to take an input filename. Also raise TypeError exception from nc_point_obs.read_data() if input file cannot be read

* call parent class init function to properly initialize nc_point_obs

* Feature #2833 pcp_combine_missing (#2886)

* Per #2883, add -input_thresh command line option to configure allowable missing input files.

* Per #2883, update pcp_combine usage statement.

* Per #2883, update existing pcp_combine -derive unit test example by adding 3 new missing file inputs at the beginning, middle, and end of the file list. The first two are ignored since they include the MISSING keyword, but the third without that keyword triggers a warning message as desired. The -input_thresh option is added to only require 70% of the input files be present. This should produce the exact same output data.

* Per #2883, update the pcp_combine logic for the sum command to allow missing data files based on the -input_thresh threshold. Add a test in unit_pcp_combine.xml to demonstrate.

* Update docs/Users_Guide/reformat_grid.rst

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2883, update pcp_combine usage statement in the code to be more simliar to the User's Guide.

* Per #2883, switch to using derive_file_list_missing as the one containing missing files and recreate derive_file_list as it had existed for the test named pcp_combine_derive_VLD_THRESH.

* Per #2883, move initialization inside the same loop to resolve SonarQube issues.

* Per #2883, update sum_data_files() to switch from allocating memory to using STL vectors to satisfy SonarQube.

* Per #2883, changes to declarations of variables to satisfy SonarQube.

* Per #2883, address more SonarQube issues

* Per #2883, backing out an unintended change I made to tcrmw_grid.cc. This change belongs on a different branch.

* Per #2883, update logic of parse_file_list_type() function to handle python input strings. Also update pcp_combine to parse the type of input files being read and log non-missing python input files expected.

---------

Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>

* Per #2888, update STATAnalysisJob::dump_stat_line() to support dumping stat line types VCNT, RPS, DMAP, and SSIDX. (#2891)

* Per #2659, making updates as proposed at the 20240516 MET Eng. Mtg. (#2895)

* Feature #2395 TOTAL_DIR (#2892)

* Per #2395, remove the n_dir_undef and n_dira_undef variables that are superceded by the new dcount and dacount VL1L2Info members to keep track of the number of valid wind direction vectors.

* Per #2395, add TOTAL_DIR columns to the VL1L2, VAL1L2, and VCNT line types and update the header column tables.

* Per #2395, update the User's Guide to list the new TOTAL_DIR columns in the VL1L2, VAL1L2, and VCNT line types.

* Per #2395, update stat_analysis to parse the new TOTAL_DIR columns and use the values to aggregate results when needed.

* Per #2395, for SonarQube change 'const char *' to 'const char * const' to satisfy the finding that 'Global variables should be const.' Should probably switch from 'char char *' to strings eventually. But for now, I'm just making up for some SonarQube technical debt.

* Per #2395, fix typo in placement of the DIR_ME column name in the met_header_columns_V12.0.txt file

* Per #2395, add 2 new Stat-Analysis jobs to demonstrate the processing of VL1L2 lines.

* Per #2395, update logic of is_vector_dir_stat(). Instead of just checking 'DIR_', check 'DIR_ME', 'DIR_MAE', and 'DIR_MSE' to avoid an false positive match for the 'DIR_ERR' column which is computed from the vector partial sums rather than the individual direction differences.

* Bugfix #2897 develop python_valid_time (#2899)

* Per #2897, fix typos in 2 log messages. Also fix the bug in storing the valid time strings. The time string in vld_array should exactly correspond to the numeric unixtime values in vld_num_array. Therefore they need to be updated inside the same if block. The bug is that we were storing only the unique unixtime values but storing ALL of the valid time string, not just the unique ones.

* Per #2897, minor change to formatting of log message

* MET #2897, don’t waste time searching, just set the index to n - 1

* Per #2897, remove unused add_prec_point_obs(...) function

* Per #2897, update add_point_obs(...) logic for DEBUG(9) to print very detailed log messages about what obs are being rejected and which are being used for each verification task.

* Per #2897, refine the 'using' log message to make the wording consistent with the summary rejection reason counts log message

* Per #2897, update the User's Guide about -v 9 for Point-Stat

---------

Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

* Bugfix 2867 point2grid qc flag (#2890)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* Per #2867, fixing typo in comments.

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Hotfix to develop to fix the update_truth.yml workflow logic. This testing workflow run failed (https://github.com/dtcenter/MET/actions/runs/9209471209). Here we switch to a unique update truth branch name to avoid conflicts.

* Avoid pushing directly to the develop or main_vX.Y branches since that is not necessary for the automation logic in MET.

* #2904 Changed R path to R-4.4.0 (#2905)

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2912 pb2nc error (#2914)

* Feature 2717 convert unit.pl to unit.py (#2871)

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* fixed how the test command was being run

* added if name/main and command line parsing

* fixed handling of no 'env' in cmd_only mode

* handle params from xml that have \ after filename without space in between

* added logging

* added some more pieces to unit

* more updates to unit.py, including running checks on output files

* bug fixes, improved handling of output file names, improved handling of env vars, improved logging output

* fixed how shell commands are run, and other minor fixes

* added last bits from the perl script, fixed some bugs

* created unit.py module in new internal/test_unit/python directory

* added xml parsing to unit.py

* added repl_env function

* added reading of the remaining xml tags in build_tests function

* progress on main function (putting together test commands)

* a few more lines in the main function

* minor updates

* update scripts to call python unit test script instead of the old perl script

* fix she-bang line to allow script to be run without python3 before it

* add missing test_dir and exit_on_fail tags that are found in the rest of the unit test xml files

* fix call to logger.warning

* change tags named 'exists' to 'exist' to match the rest of the xml files

* added logger to function

* removed tab at end of line that was causing output file path to be excluded from the command

* fix broken checks for output files

* incorporated george's recommended changes

* changed default to overwrite logs; allow for more than one xml file to be passed in command

---------

Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: j-opatz <jopatz@ucar.edu>

* Bugfix 2867 point2grid qc unittest (#2913)

* #2867 Added compute_adp_qc_flag and adjusted ADP QC flags

* #2867 Added point2grid_GOES_16_ADP_Enterprise_high. Changed AOD QC flags to 0,1,2 (was 1,2,3)

* #2867 Added get_nc_att_values_

* #2867 Added get_nc_att_values. Added the argument allow_conversion to get_nc_data(netCDF::NcVar *, uchar  *data)

* #2867 Read the ADP QC flag values and meanings attributes from DQF variable and set the QC high, meduium, low values to support Enterprise algorithm. Adjusted the ADP QC values by using AOD qc values

* #2867 Cleanup

* #2867 Corrected indent

* #2867 Changed log message

* #2867 Removed unused argument

* #2867 Removed unused argument

* Cleanup

* #2867 Fix SonarQube findings

* #2867 Deleted protected section with no members

* #2867 Cleanup

* #2867 FIxed SonarQube findings; unused local variables, decalare as const, etc

* #2867 MOved include directives to top

* #2867 Changed some argumenmt with references to avoid copying objects

* #2867 Do not filter by QC flag if -qc is not given

* #2867 Use enumj class for GOES QC: HIGH, MEDIUM, and LOW

* #2867 Added log message back which were deleted accidently

* #2867 Chaned statci const to constexpr

* #2867 Initial release. Separated from nc_utils.h

* @2867 Added nc_utils_core.h

* #2867 Moved some blocks to nc_utils_core.h

* #2867 Include nc_utils_core.h

* #2867 Added const references

* #2867 Some 'static const' were chnaged to constexpr

* #2867 Changed -qc options (1,2,3 to 0,1 - high & medium) for AOD

* #2867 Merged develop branch

* #2867 Corrected the unit test name

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>

* Feature #2911 tc_stat_set_hdr (#2916)

* Per #2911, no real changes for Stat-Analysis. Just changing order of variables for consistency.

* Per #2911, add StatHdrColumns::apply_set_hdr_opts(...) function to be used by TC-Stat.

* Per #2911, move ByColumn to the TCStatJob base class and add HdrName and HdrValue to support the -set_hdr job command.

* Per #2911, update GSI tools to call the newly added  StatHdrColumns::apply_set_hdr_opts(...) function.

* Per #2911, update logic of Stat-Analysis for consistency to make use of common apply_set_hdr_opts() function.

* Per #2911, add DataLine::set_item() function to support -set_hdr options.

* Per #2911, just update contents of error message

* Per #2911, add TCStatLine member functions for has() and get_offset().

* Per #2911, update tc_stat to support applying -set_hdr to TC-Stat filter jobs.

* Per #2911, revise TC-Stat config files to exercise the -set_hdr job command option

* Per #2911, update TC-Stat documentation to mention the -set_hdr job command option

* Per #2911, add note

* Per #2911, as recommended by SonarQube, make some of these member functions const.

* Bugfix #2856 develop ens_climo (#2918)

* Per #2856, port over fixes from main_v11.1 to develop.

* Per #2856, correct conditionals in set_job_controls.sh and tweak existing Ensemble-Stat configuration file to exercise the logic that's being impacted here.

* Bugfix #2841 develop tang_rad_winds (#2921)

* Per #2841, port over fixes from bugfix_2841_main_v11.1_tang_rad_winds for the develop branch

* Per #2841, clarify in the docs that azimuths are defined in degrees counter-clockwise from due east.

* Per #2841, just updating with output from enum_to_string.

* Per #2841, tweak the documentation.

* Per #2841, correct the location of using namespace lines.

* Per #2841, update compute_tc_diag.py to no longer skip writing the radial and tangential wind diagnostics.

* Per #2841, update compute_tc_diag.py to no longer skip writing radial and tangential wind diagnostics.

* Revert "Per #2841, update compute_tc_diag.py to no longer skip writing radial and tangential wind diagnostics."

This reverts commit f097345.

* Revert "Per #2841, update compute_tc_diag.py to no longer skip writing the radial and tangential wind diagnostics."

This reverts commit c040215.

* Per #2841, update comp_dir.sh logic to include .dat in the files that are diffed

* Replace tab with spaces

* Per #2841, correct the units for the azimuth netcdf output variable

* Per #2841, reverse the x dimension of the rotated latlon grid to effectively switch from counterclockwise rotation to clockwise.

---------

Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>

---------

Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Howard Soh <hsoh@ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: j-opatz <jopatz@ucar.edu>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: natalieb-noaa <146213121+natalieb-noaa@users.noreply.github.com>
Co-authored-by: Natalie babij <natalie.babij@natbabij-mac1.home>
Co-authored-by: Natalie babij <natalie.babij@vpn68-237.vpnclient.ucar.edu>
Co-authored-by: Natalie babij <natalie.babij@gsd-sslvpn-209.fsl.noaa.gov>
Co-authored-by: Natalie Babij <nbabij@seneca.rap.ucar.edu>
Co-authored-by: metplus-bot <97135045+metplus-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue MET: Wind Verification priority: high High Priority requestor: NOAA/EMC NOAA Environmental Modeling Center required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone type: new feature Make it do something new
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

5 participants