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

Feature #2966 local_solar_time #3008

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

JohnHalleyGotway
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway commented Nov 5, 2024

NOTE: DO NOT MERGE THIS PR UNTIL AFTER THE MET-12.0.0-RC1 RELEASE

Add support for new -type solar_time masking type.
Also adds support for multiple -type, -mask_field, and -thresh settings for a single run, when all use the same mask_file setting.

Expected Differences

  • Do these changes introduce new tools, command line arguments, or configuration file options? [Yes]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [Yes]

    If yes, please describe:

    Adds new units attribute to the NetCDF output from Gen-Vx-Mask.
    Updates the mask_type attribute with additional details about the data processed.
    Adds logic to concatenate masking type names when constructing the output variable name.

Pull Request Testing

  • Describe testing already performed for these changes:

    Tested manually.

  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  1. Confirm all differences in GitHub actions are expected:
  • 1 new Gen-Vx-Mask output file.
  • A units NetCDF variable attribute is added to existing Gen-Vx-Mask output files.
  1. Carefully review updated Gen-Vx-Mask usage statement and User's Guide documentation for typos, accuracy, and clarity.
  2. Test out seneca:/d1/projects/MET/MET_pull_requests/met-12.1.0/beta1/MET-feature_2966_local_solar_time/bin/gen_vx_mask and try to "break it" ensuring it behaves as expected.
  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes]
    Updated the chapter about spatial masking.

  • Do these changes include sufficient testing updates? [Yes]
    Added two new Gen-Vx-Mask unit test to demonstrate:

  • combining the -type solar_alt and -type solar_time options in a single run

  • combining data/data/lat/lon masking types in a single run

  • Will this PR result in changes to the MET test suite? [Yes]

    If yes, describe the new output and/or changes to the existing output:

Two new files described above and changes to the units and mask_type attributes of existing output files.

  • Will this PR result in changes to existing METplus Use Cases? [Yes or No]

    If yes, create a new Update Truth METplus issue to describe them.
    The units variable attribute will be added and mask_type modified for existing Gen-Vx-Mask output files.

  • Do these changes introduce new SonarQube findings? [No]

    If yes, please describe:
    While existing SonarQube findings will be flagged as being "new", the overall number of code smells is reduced from 18,315 to about 18,251.

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s) and Development issue
    Select: Milestone as the version that will include these changes
    Select: Coordinated METplus-X.Y Support project for bugfix releases or MET-X.Y.Z Development project for official releases
  • After submitting the PR, select the ⚙️ icon in the Development section of the right hand sidebar. Search for the issue that this PR will close and select it, if it is not already selected.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

…est to demonstrate, and update the mask_type attribute to include the magic string for the gridded data used for data masking.
@JohnHalleyGotway JohnHalleyGotway requested review from CPKalb and removed request for jvigh November 6, 2024 19:45
@JohnHalleyGotway
Copy link
Collaborator Author

Based on this issue comment, requesting this PR review from @CPKalb. Tina, please LMK if you have any questions or run into any issues.

@JohnHalleyGotway
Copy link
Collaborator Author

JohnHalleyGotway commented Nov 6, 2024

I'd previously found some differences in the presence of timing attributes being added to the Gen-Vx-Mask output files. I updated the logic with this commit to eliminate those diffs.

The remaining diffs flagged by the GHA testing workflow are all expected, including the addition of the units NetCDF variable attribute and changes to the mask_type attribute for data masking, like this:

COMPARING gen_vx_mask/DATA_INPUT_FIELD_APCP_24_where_TMP_Z2_le300.nc
file1: /data/output/met_test_truth/gen_vx_mask/DATA_INPUT_FIELD_APCP_24_where_TMP_Z2_le300.nc
file2: /data/output/met_test_output/gen_vx_mask/DATA_INPUT_FIELD_APCP_24_where_TMP_Z2_le300.nc
ERROR: NetCDF headers differ:
16a17
> 		APCP_24_where_TMP_Z2_le300:units = "kg/m^2" ;
18c19
< 		APCP_24_where_TMP_Z2_le300:mask_type = "data>300" ;
---
> 		APCP_24_where_TMP_Z2_le300:mask_type = "data(TMP/Z2)>300" ;

…here we only write the timing information of the input data to the gen_vx_mask output when no threshold was applied. This should reduce the number of diffs flagged by PR #3008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 In review
Development

Successfully merging this pull request may close these issues.

Enhance gen_vx_mask to support a new local solar time masking region option
1 participant