Skip to content

Add more error checking for python embedding of point observations #2202

@JohnHalleyGotway

Description

@JohnHalleyGotway

Describe the Enhancement

This issue arose while adapting an existing python embedding of point observation script for use with a different input dataset. It was while helping @jason-english use python embedding to ingest NetCDF DOE ARM data files into MET.

The resulting python script(s) and sample data can be found here:
python_point_example.tar.gz

And here's the command to illustrate:

plot_point_obs \
'PYTHON_NUMPY=read_doe_arm_obs.py sgp30ebbrE15.b1.20190617.000000.nc' \
sgp30ebbrE15.b1.20190617.000000.ps -title "DOE ARM Data" -plot_grid G130

Along the way, I modified the met_point_obs.py script to make the print function more complete and useful. The example in that file reference obs_qid which I believe should actually be named obs_qty instead. Recommend diffing this updated version with the existing one and consider including that change.

In addition, recommend adding more error checking of data types to the met_point_obs.py script. I spent a lot of time constructing lists when I should have been using NumPy arrays instead. The script ran fine but produced segfaults in MET.

The goal here is to add more useful error messages to make adapting these scripts easier for users.

Time Estimate

1-2 days

Sub-Issues

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

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2702691

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

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions