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

Improve MET library logging for NetCDF level dimension matches #3038

Closed
8 of 21 tasks
JohnHalleyGotway opened this issue Dec 16, 2024 · 1 comment · Fixed by #3039
Closed
8 of 21 tasks

Improve MET library logging for NetCDF level dimension matches #3038

JohnHalleyGotway opened this issue Dec 16, 2024 · 1 comment · Fixed by #3039
Assignees
Labels
MET: Library Code priority: low Low Priority reporting: NRL METplus Naval Research Laboratory METplus Project requestor: Navy/NRL Naval Research Laboratory type: enhancement Improve something that it is currently doing
Milestone

Comments

@JohnHalleyGotway
Copy link
Collaborator

Describe the Enhancement

Improve logging for NetCDF level dimension matches. @DanielAdriaansen had questions about how the level string he provided to plot_data_plane was being used to read data from the input NetCDF file.

For example, using the sample data in seneca /home/dadriaan/projects/NRL/CSU_Satellite/GEO-stitch-cloud3d_L3_2.3.1_20241108T1800Z_CONUS.nc, run the following 2 commands:

plot_data_plane GEO-stitch-cloud3d_L3_2.3.1_20241108T1800Z_CONUS.nc obs.ps 'name="cloud3d"; level="(@0.5,*,*)"; file_type=NETCDF_NCCF;' -v 7

plot_data_plane GEO-stitch-cloud3d_L3_2.3.1_20241108T1800Z_CONUS.nc obs.ps 'name="cloud3d"; level="(0.5,*,*)"; file_type=NETCDF_NCCF;'

For the first, no log message states how @0.5 was actually converted into a dimension index.
And for the second, no warning message points out that 0.5 is passed through atoi(0.5) and converted into index = 0.

Fix the first by adding the following log message:

DEBUG 7: MetNcCFDataFile::convert_value_to_offset() -> Found "altitude" dimension value of "0.5" at dimension index 1.

And fix the second with a warning message:

WARNING: 
WARNING: check_dim_offset() -> Found non-integer NetCDF dimension index (0.5 != 0).
WARNING: Did you intend to use "@0.5" to specify the value for that dimension instead?
WARNING: 

Time Estimate

4 hours.

Sub-Issues

Consider breaking the enhancement down into sub-issues.
None

Relevant Deadlines

None

Funding Source

Use NRL METplus 7730022 since it came up during that testing

Define the Metadata

Assignee

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

Labels

  • Review default alert labels
  • Select component(s)
  • Select priority
  • Select requestor(s)

Milestone and Projects

  • Select Milestone as a MET-X.Y.Z version, Consider for Next Release, or Backlog of Development Ideas
  • For a MET-X.Y.Z version, select the MET-X.Y.Z Development project

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.
  • 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 issue
    Select: Milestone as the next official version
    Select: MET-X.Y.Z Development project for development toward the next official release
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added type: enhancement Improve something that it is currently doing priority: low Low Priority requestor: Navy/NRL Naval Research Laboratory MET: Library Code reporting: NRL METplus Naval Research Laboratory METplus Project labels Dec 16, 2024
@JohnHalleyGotway JohnHalleyGotway added this to the MET-12.1.0 milestone Dec 16, 2024
@JohnHalleyGotway JohnHalleyGotway self-assigned this Dec 16, 2024
JohnHalleyGotway added a commit that referenced this issue Dec 16, 2024
@JohnHalleyGotway JohnHalleyGotway linked a pull request Dec 16, 2024 that will close this issue
17 tasks
JohnHalleyGotway added a commit that referenced this issue Dec 17, 2024
JohnHalleyGotway added a commit that referenced this issue Dec 17, 2024
* Per #3038, add debug and warning log messages to tell the user which NetCDF dimension indices are being used.

* Per #3038, fix a few SonarQube code smells to reduce the overall number of them for the #3039 PR.
@DanielAdriaansen
Copy link
Contributor

Closed by #3039

@JohnHalleyGotway JohnHalleyGotway changed the title Improve logging for NetCDF level dimension matches Improve MET library logging for NetCDF level dimension matches Jan 24, 2025
@github-project-automation github-project-automation bot moved this to 🩺 Needs Triage in METplus-6.1.0 Development Jan 28, 2025
@JohnHalleyGotway JohnHalleyGotway moved this from 🩺 Needs Triage to 🏁 Done in METplus-6.1.0 Development Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MET: Library Code priority: low Low Priority reporting: NRL METplus Naval Research Laboratory METplus Project requestor: Navy/NRL Naval Research Laboratory type: enhancement Improve something that it is currently doing
Projects
Status: 🏁 Done
Development

Successfully merging a pull request may close this issue.

2 participants