dtcenter / METplus

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

Enhancement: Add support for a Point2Grid config wrapper #2540

Open jprestop opened 3 months ago

jprestop commented 3 months ago

Describe the Enhancement

In this discussion, Need Point2Grid metplus wrapper for EVSv2.0 #2539, Ho-ChunHuang-NOAA mentioned the need to use Point2Grid app to map GOES ABI AOD to model grid for EVS2 AOD verification for AQM, RAP, HRRR, and GEFS-Chem. A Point2GridConfig_wrapped file does not currently exist at https://github.com/dtcenter/METplus/tree/develop/parm/met_config. It seems that METplus does not currently include logic for populating and passing a config file to the MET point2grid tool.

Please note that currently, the METplus documentation states with regard to the MET Configuration, "None. Point2Grid does not use configuration files.", but the MET Point2Grid usage statement indicates that it supports an optional configuration file. The METplus documentation is incorrect and should be updated.

Time Estimate

(For @georgemccabe to fill in.)

Sub-Issues

Consider breaking the enhancement down into sub-issues.

Relevant Deadlines

6.0.0-beta5

Funding Source

TBD

Define the Metadata

Assignee

Labels

Projects and Milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

Ho-ChunHuang-NOAA commented 3 months ago

Simply a reminder to check discussion of 2539 regarding the problem of using "POINT2GRID_QC_FLAGS=" in METplus config file to select the quality of mapped AOD.

Ho-ChunHuang-NOAA commented 2 months ago

@jprestop @georgemccabe I need some answer of whether there is a bug on the usage of "POINT2GRID_QC_FLAGS =" in Point2Grid. Please see detail of comment on April 4 2024 in issue 2539.

I set the POINT2GRID_QC_FLAGS = 0, but the result is like POINT2GRID_QC_FLAGS ="0,1,2".

Thank you.

georgemccabe commented 2 months ago

Hi @Ho-ChunHuang-NOAA, there was a bug in the Point2Grid wrapper that did not properly apply the -qc 0 argument if the value set was 0. The code incorrectly interpreted a zero value as an empty value. This was fixed for METplus bugfix release v5.0.2 (PR: https://github.com/dtcenter/METplus/pull/2101) and v5.1.0 (PR: https://github.com/dtcenter/METplus/pull/2140).

Please let me know if you need any additional information.

Ho-ChunHuang-NOAA commented 2 months ago

Hi, George:

Simply to confirm that the bug fix version will accepts

POINT2GRID_QC_FLAGS = 0 1 2 0,1 0,1,2 (I think it is the default)

georgemccabe commented 2 months ago

Hi @Ho-ChunHuang-NOAA,

Yes, POINT2GRID_QC_FLAGS accepts a comma-separated list of integers, so all of those examples you provided are valid inputs. I am not sure what the default behavior is if no QC flags are specified, but my best guess is that it does not filter by the QC field if no value is specified. @JohnHalleyGotway, can you provide any additional insight?

JohnHalleyGotway commented 2 months ago

@georgemccabe and @Ho-ChunHuang-NOAA, I see a potential source of confusion here.

In general, Point2Grid reads point data and processes it onto a regular grid. It can accept multiple types of input point data, including both GOES satellite data and the NetCDF output created by other MET point pre-processing tools, like PB2NC, ASCII2NC, and MADIS2NC.

Let me clarify two details about quality control:

  1. The -qc command line option applies specifically to GOES data inputs. It's described in the Point2Grid Usage as follows:

The -qc flags option specifies a comma-separated list of quality control (QC) flags, for example “0,1”. This should only be applied if grid_mapping is set to “goes_imager_projection” and the QC variable exists.

This GOES filtering logic is only applied when the -qc option is specified on the command line. You can see that logic on this line of point2grid.cc. To that end, the default behavior is to NOT APPLY any quality control filtering to GOES data unless -qc is specified on the command line.

  1. I see a Point2Grid config file entry named quality_mark_thresh. Checking in the actual code for Point2Grid, I see that that entry is being parsed, it is NOT actually be used at all.

I strongly suspect that this was just copied from the PB2NC tool when Point2Grid was originally written. It does not actually belong here. Instead, we should remove quality_mark_thresh and replace it with the obs_quality_inc and obs_quality_exc options seen here in the PointStatConfig file.

These would apply when processing the NetCDF output from PB2NC, ASCII2NC, and MADIS2NC and give the user to option to specifically include or exclude obs based on their quality control values.

I'd recommend that we write up an issue to change this for MET version 12.0.0.

I'm laying out these details here to prevent any confusion between the -qc command line option and the spurious quality_mark_thresh config file option that doesn't currently actually do anything!

Ho-ChunHuang-NOAA commented 2 months ago

@georgemccabe @JohnHalleyGotway Hi, George: Thanks for the information. I was using the METPlus v5.0.2 when I encountered the POINT2GRID_QC_FLAG = 0 issue in #2539 . I rerun my scripts in METPlus v6.0.0-beta3, and the log output indicates the METPlus did interpret POINT2GRID_QC_FLAG = 0 as "-qc 0". The comparison of AOD graphics also confirms that the the mapped point2grid nc files by METPlus wrapper is high quality AOD as expected.

AliciaBentley-NOAA commented 2 months ago

@Ho-ChunHuang-NOAA Is this enhancement required for EVS v2.0, and should therefore be included in the METplus-6.0.0 release?

Ho-ChunHuang-NOAA commented 1 month ago

@AliciaBentley-NOAA YES. This is for AQM AOD and GEFS AOD verification and they are scheduled to be in EVSv2.0.

AliciaBentley-NOAA commented 1 month ago

Thanks, @Ho-ChunHuang-NOAA. This particular METplus issue was marked as "stalled" ~3 weeks ago when I originally asked. I'll tag the DTC folks and see what can be done. If you need something in METplus for EVS v2.0, please continue to advocate for it. Not all of the open METplus issues will make it into the official release.

Tagging @JohnHalleyGotway @j-opatz @georgemccabe @jprestop @DanielAdriaansen

georgemccabe commented 1 month ago

Hi @AliciaBentley-NOAA and @Ho-ChunHuang-NOAA,

This work is actually completed in a branch (draft pull request #2580) but is waiting for dtcenter/MET#2880 to be completed since there are some corresponding changes needed to the Point2Grid MET tool. I just marked that issue as required for the release to make sure that work gets completed.