Skip to content

Fix Point-Stat and Ensemble-Stat GRIB table lookup logic for python embedding of point observations. #2286

@JohnHalleyGotway

Description

@JohnHalleyGotway

Describe the Enhancement

When working on the python embedding of point observations in Point-Stat with @j-opatz, we ran into an issue. When Point-Stat was configured to verify against observation variables named wind_spd we got this runtime error:

ERROR  : VarInfoGrib::add_grib_code() -> unrecognized GRIB1 field abbreviation 'wind_spd' for table version (-9999), center (-9999), and subcenter (-9999) or default table version (2), center (7), and subcenter (1).

This issue is to fix Point-Stat to make this work. Note that the same issue likely exists in Ensemble-Stat.

Here's why we get this error:

  • This line of code checks the first input point observation file to see if it specifies observations by variable name or GRIB code. Earlier versions of MET did latter while newer versions do the former.
  • The default value is use_var_id = FALSE (i.e. meaning point obs are specified by GRIB codes).
  • With python inputs (as in this case), it obviously can't open/read it as a NetCDF file, so it uses the default value of FALSE.
  • This line of code tries to interpret the obs variable string from the config file as being a GRIB code abbreviation. If the obs data is specified as GRIB codes, the code needs to figure out which GRIB code to use! And that triggers the runtime error listed above.

So I understand why this is happening, and there's some options for how we could fix it.

Recommend moving the logic for calling add_grib_code() further down. Instead of calling it once at the beginning based on the setting of the first point observation file, do it inside the obs file processing loop. Only call add_grib_code() when actually needed based on the actual obs data read from the NetCDF file (or python script in this case).

Time Estimate

1 day.

Sub-Issues

Consider breaking the enhancement down into sub-issues.
None needed.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Repository and/or Organization level Project(s) or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

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 Linked issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • 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