dtcenter / METplus

Python scripting infrastructure for MET tools.
https://metplus.readthedocs.io
Apache License 2.0
99 stars 37 forks source link

Internal: Improve NetCDF file diff to match MET diff functionality #2708

Open georgemccabe opened 1 month ago

georgemccabe commented 1 month ago

This came up in the comments of issue #2704.

Describe the Enhancement

Improve the logic in the METplus diff code to catch the differences flagged by the MET diff tests but not in METplus. @JohnHalleyGotway will comment to provide some sample files to use for testing.

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.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

@natalieb-noaa is funded through the DTC to work on METplus tasks.

Define the Metadata

Assignee

Labels

Milestone and Projects

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

JohnHalleyGotway commented 1 month ago

Please note that differences to NetCDF MTD output file were flagged in this MET GHA Testing Workflow run. The diff.zip artifact can be found here: diff.zip

In that zip file compare: mtd/mtd_BASIC_20100517_010000V_obj_TRUTH.nc vs mtd/mtd_BASIC_20100517_010000V_obj_OUTPUT.nc

Where the order of the dimensions and details of the global attributes, as seen in output from ncdump -h. While the order of the dimensions and variables really do not matter, we really should be checking for differences in the global and variable attributes. In MET the comp_nc.R script calls the compareNc utility which calls ncdump -h followed by diff to check for NetCDF header diffs. I'd recommend using a Python-only solution rather than adding a dependency on ncdump, if possible and convenient.

JohnHalleyGotway commented 1 week ago

Reassigned this issue @natalieb-noaa so that she can work on it in conjunction with dtcenter/MET#2718, which updates MET to use the differencing logic provided by METplus. Seems like it'd be good to do these at the same time.