Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Gaussian grids in the vx_data2d_python library. #1477

Closed
19 tasks done
JohnHalleyGotway opened this issue Sep 2, 2020 · 3 comments · Fixed by #1479 or #1480
Closed
19 tasks done

Add support for Gaussian grids in the vx_data2d_python library. #1477

JohnHalleyGotway opened this issue Sep 2, 2020 · 3 comments · Fixed by #1479 or #1480
Assignees
Labels
MET: Library Code MET: Python Embedding requestor: NCAR National Center for Atmospheric Research type: bug Fix something that is not working

Comments

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Sep 2, 2020

Describe the Problem

This issue arose when Tina Kalb was using python-embedding to pass MET version 9.1 gridded data input on a Gaussian grid. This resulted in the following runtime error:
ERROR :
ERROR : grid_from_python_dict() -> bad projection type: "Gaussian"
ERROR :

While MET version 9.1 does support data on Gaussian grids, support for this projection was not added to the vx_data2d_python library. It is noticeably absent from the list of projections here:

static const char rotated_latlon_string [] = "Rotated LatLon";

Expected Behavior

Use the attached data to run the following command:

plot_data_plane PYTHON_NUMPY plot.ps 'name="read_era_nc.py ei.oper.an.pl.regn128sc.1979010100.miller369109.nc";'

read_era_nc.py.txt
ei.oper.an.pl.regn128sc.1979010100.miller369109.nc.txt

This should run without error and correctly handle the Gaussian grid.

Environment

Describe your runtime environment:

  1. Machine: Cheyenne and replicated on Mac
  2. Using met-9.1.

To Reproduce

Describe the steps to reproduce the behavior:

  1. Run the command listed above using MET version 9.1.

Relevant Deadlines

None

Funding Source

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

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required: John Halley Gotway
  • Select scientist(s) or no scientist required: Tina Kalb should review the PR.

Labels

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

Projects and Milestone

  • Review projects and select relevant Repository and Organization ones
  • Select milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above.
  • Fork this repository or create a branch of master_<Version>.
    Branch name: bugfix_<Issue Number>_master_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into master_<Version> and link the pull request to this issue.
    Pull request: bugfix <Issue Number> master_<Version> <Description>
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch and link the pull request to this issue.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added type: bug Fix something that is not working component: library code requestor: NCAR National Center for Atmospheric Research labels Sep 2, 2020
@JohnHalleyGotway JohnHalleyGotway added this to the MET 9.1.1 (bugfix) milestone Sep 2, 2020
@JohnHalleyGotway JohnHalleyGotway added this to To do in METplus Version 3.1 Support via automation Sep 2, 2020
@JohnHalleyGotway
Copy link
Collaborator Author

JohnHalleyGotway commented Sep 2, 2020

I ran pcp_combine to convert an existing Gaussian GRIB1 file to NetCDF and checked the output attributes:
:Projection = "Gaussian" ;
:lon_zero = "0.000 degrees_east" ;
:nx = "512" ;
:ny = "256" ;

Based on this, I'll setup the code to look for:
'type' : 'Gaussian',
'lon_zero' : 0.0,
'nx' : 512,
'ny' : 256,

For this to work, I had to change Tina's camel-case "Nx" and "Ny" to lower-case "nx" and "ny". This is unfortunate. I would be nice to have a case-insensitive lookup option instead of requiring the case to be exactly correct.

@JohnHalleyGotway
Copy link
Collaborator Author

With this change, MET is able to read/plot this data correctly:

plot_data_plane PYTHON_NUMPY plot.ps 'name="read_era_nc.py ei.oper.an.pl.regn128sc.1979010100.miller369109.nc";'

plot

@CPKalb
Copy link

CPKalb commented Sep 2, 2020 via email

@JohnHalleyGotway JohnHalleyGotway linked a pull request Sep 2, 2020 that will close this issue
@JohnHalleyGotway JohnHalleyGotway linked a pull request Sep 2, 2020 that will close this issue
METplus Version 3.1 Support automation moved this from To do to Done Sep 9, 2020
JohnHalleyGotway added a commit that referenced this issue Sep 9, 2020
* Per #1477, add support for Gaussian grids to grid_from_python_dict.cc.

* Per #1477, add gaussian to the list of supported projections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MET: Library Code MET: Python Embedding requestor: NCAR National Center for Atmospheric Research type: bug Fix something that is not working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants