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

Enhance METcalcpy to aggregate statistics added to the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle #361

Closed
11 of 26 tasks
JohnHalleyGotway opened this issue Feb 14, 2024 · 1 comment
Assignees
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue METcalcpy: General Statistics priority: blocker Blocker requestor: NOAA/EMC NOAA Environmental Modeling Center type: enhancement Improve something that it is currently doing

Comments

@JohnHalleyGotway
Copy link
Contributor

JohnHalleyGotway commented Feb 14, 2024

Describe the Enhancement

Issue dtcenter/METdataio#282 updates the schema to load new wind direction statistics from the VL1L2, VAL1L2, and VCNT line types of MET version 12.0.0 and new ignorance score statistics to the ECNT line type. This issue is to update METcalcpy to update the aggregation logic for the VL1L2, VAL1L2, VCNT, and ECNT line types to handle these new columns of data. Please see @JohnHalleyGotway with any questions you may have about the aggregation logic.

Time Estimate

Estimate the amount of work required here.
Issues should represent approximately 1 to 3 days of work.

Sub-Issues

Consider breaking the enhancement down into sub-issues.

  • Add a checkbox for each sub-issue here.

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 CYCLE ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement 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.
  • Add any new Python packages to the METplus Components Python Requirements table.
  • 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.
@JohnHalleyGotway JohnHalleyGotway added priority: blocker Blocker requestor: NOAA/EMC NOAA Environmental Modeling Center type: enhancement Improve something that it is currently doing alert: NEED ACCOUNT KEY Need to assign an account key to this issue METcalcpy: General Statistics labels Feb 14, 2024
@JohnHalleyGotway JohnHalleyGotway added this to the METcalcpy-3.0.0 milestone Feb 14, 2024
@JohnHalleyGotway JohnHalleyGotway changed the title Enhance METcalcpy to aggregate new wind direction statistics in the VL1L2, VAL1L2, and VCNT line types Update schema to handle changes to the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle Mar 14, 2024
@JohnHalleyGotway JohnHalleyGotway changed the title Update schema to handle changes to the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle Enhance METcalcpy to aggregate new wind direction statistics in the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle Mar 14, 2024
@JohnHalleyGotway JohnHalleyGotway changed the title Enhance METcalcpy to aggregate new wind direction statistics in the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle Enhance METcalcpy to aggregate statistics added to the ECNT, VL1L2, VAL1L2, and VCNT line types during the MET 12.0.0 beta4 development cycle Mar 14, 2024
@bikegeek bikegeek self-assigned this Apr 3, 2024
@JohnHalleyGotway
Copy link
Contributor Author

  1. For the VL1L2 columns:
  • DIR_ME, DIR_MAE, DIR_MSE: Aggregate these simply as a weighted average of the input statistics, where the weight is defined by the TOTAL column.
'vl1l2_dir_me': ['dir_me'],
'vl1l2_dir_mae': ['dir_mae'],
'vl1l2_dir_mse': ['dir_mse'],
  1. For the VCNT columns:
  • DIR_ME, DIR_MAE, DIR_MSE: Aggregate these simply as a weighted average of the input statistics, where the weight is defined by the TOTAL column.
'vcnt_dir_me': ['dir_me'],
'vcnt_dir_mae': ['dir_mae'],
'vcnt_dir_mse': ['dir_mse'],
  • DIR_RMSE: Aggregate DIR_MSE, as described above, and then take the square root.
'vcnt_dir_rmse': ['dir_mse'],
  1. For the VAL1L2 columns:
  • DIRA_ME, DIRA_MAE, DIRA_MSE: Aggregate these simply as a weighted average of the input statistics, where the weight is defined by the TOTAL column.
'val1l2_dira_me': ['dira_me],
'val1l2_dira_mae': ['dira_mae],
'val1l2_dira_mse': ['dira_mse],
  1. For the ECNT columns:
  • IGN_CONV_OERR, IGN_CORR_OERR: Aggregate these simply as a weighted average of the input statistics, where the weight is defined by the TOTAL column.

In general, when adding aggregation logic to METcaclpy, recommend testing and validating using MET's Stat-Analysis tool to make sure we get consistent results. e.g. run the -job aggregate and/or -job aggregate_stat job types.

bikegeek added a commit that referenced this issue Apr 6, 2024
hankenstein2 added a commit that referenced this issue Apr 15, 2024
* Issue #361 Added new key-values for the ECNT, VCNT, VL1L2, and VAL1L2 linetypes in the STATISTIC_TO_FIELDS

* Issue #361 Added support for aggregating the VAL1L2 dira_me

* Issue #361 implemented code for VAL1L2 DIRA_MAE and DIRA_MSE

* modified statistics calculations to explicitly pass in columns as numpy arrays

* config file used to calculate VAL1L2 me, mae, and mse aggregated statistics

* Issue #361 Test for the VAL1L2 ME, MAE, and MSE aggregation statistics

* Added test for agg_stat and val1l2_statistics due to addition of ME, MAE, and MSE to VAL1L2 linetype

* correct test name: replaced test_stat_analysis with test_agg_stat

* MET stat_analysis output for VAL1L2

* MET output from point-stat, used as input to agg_stat.py

* Changed location of input file

* Additional columns for VL1L2 and ECNT added for issue #361

* #361 data for testing updates to ECNT linetype

* Temporarily turn off tests that need to be updated as result of linetype additions

* Remove unit tests that fail due to linetype changes and need updating.

* Cleaned up config file: removed hard-coded paths

* Config files for testing the updates to the vl1l2 and vcnt linetypes

* Data from MET for vl1l2 linetype updates

* MET point_stat output for vl1l2 updated linetype

* MET point-stat output for latest vcnt linetype changes

* MET stat-analysis aggregated statistics for VCNT from latest updates to VL1L2

* Updates for calculating statistics for newly added columns to linetypes

* Removed ToDo comment and reverted back to original read_csv parameters

* Add latest test for agg_stat to list

* Clean up formatting

* added cleanup of temporary files and additional tests

* Change separator from regex that checks for tabs or whitespace(s) to just checking for one or more whitespace.

* removed development paths

* Added back some tests, added new tests to coverage run

* change agg_stat_output location to current directory

* convert lower case columns to a numpy array

* Add test_agg_ratio to list of tests to run

---------

Co-authored-by: Hank Fisher <fisherh@ucar.edu>
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 METcalcpy: General Statistics priority: blocker Blocker requestor: NOAA/EMC NOAA Environmental Modeling Center type: enhancement Improve something that it is currently doing
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants