Skip to content

Improve MET library logging for NetCDF level dimension matches #3038

@JohnHalleyGotway

Description

@JohnHalleyGotway

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.

Metadata

Metadata

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions