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

Bugfix: Fix the MET CF-Compliant NetCDF library code to Polar Stereographic data from NSIDC Sea Ice Edge NetCDF files. #2218

Closed
8 of 22 tasks
JohnHalleyGotway opened this issue Aug 2, 2022 · 4 comments · Fixed by #2419, #2418, #2435 or #2434
Assignees
Labels
MET: Grid-to-Grid Verification priority: high High Priority requestor: NOAA/EMC NOAA Environmental Modeling Center required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone type: bug Fix something that is not working

Comments

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Aug 2, 2022

Describe the Problem

This issue arose via the dtcenter/METplus#1718 discussion. Further investigation reveals that the MET NetCDF-CF library code needs to be enhanced to instantiate Polar Stereographic grids from NSIDC Sea Ice Edge NetCDF files. Those file are CF-compliant but MET fails to read that data.

Expected Behavior

MET should be able to read data from NSIDC Sea Ice Edge NetCDF file and instantiate the Polar Stereographic grids on which they resides.

Environment

Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop) Not Hardware-specific
2. OS: (e.g. RedHat Linux, MacOS) Not OS-specific
3. Software version number(s) version 10.1.0

To Reproduce

Describe the steps to reproduce the behavior:
1. Retrieve these sample data files:
See NSIDC_sample_data.tar.gz

https://n5eil01u.ecs.nsidc.org/PM/NSIDC-0081.002/2022.07.23/NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc
https://n5eil01u.ecs.nsidc.org/PM/NSIDC-0081.002/2022.07.23/NSIDC0081_SEAICE_PS_S25km_20220723_v2.0.nc

2. Run plot_data_plane:

plot_data_plane NSIDC0081_SEAICE_PS_S25km_20220723_v2.0.nc test.ps 'name="F16_ICECON"; level="(0,*,*)";' -v 4

3. See error

ERROR : get_nc_var_att_double() -> Cannot get "longitude_of_projection_origin" from crs variable.

Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

The CF-Convention documentation defines Polar Stereographic grids here. And this is parsed by the get_grid_mapping_polar_stereographic() function in MET.

This task is to enhance MET's NCCF library to handle these files.

Some initial testing got us closer but still produced an error:

ncatted \
-a longitude_of_projection_origin,crs,a,d,0 NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc  \
-a scale_factor_at_projection_origin,crs,a,d,1.0 \
-a units,x,o,c,"m" \
-a units,y,o,c,"m" \
-o NSIDC0081_SEAICE_PS_N25km_20220723_v2.0_mod.nc

But the result still produces this error from MET:

ERROR  : NcCfFile::get_grid_mapping_polar_stereographic() -> MET can only process Polar Stereographic files where the x-axis and y-axis deltas are the same.

The X delta is +25000 m and the Y delta is -25000 m. So the magnitude is the same, but the sign is different.

If we ignore the sign, then MET is able to plot the result but the image is upside-down. So the library code need to detect this situation and flip the data accordingly, as is done in MET's GRIB1/2 libraries.

Please see the images in the attached tarfile to see how the data should actually be oriented.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2773542 (was 2793541)

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

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

Projects and Milestone

  • Select Organization level Project for support of the current coordinated release
  • Select Repository level Project for development toward the next official release or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next bugfix version

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, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug 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 main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Linked issues
    Select: Organization level software support Project for the current coordinated release
    Select: Milestone as the next bugfix version
  • 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.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
    Select: Reviewer(s) and Linked issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added type: bug Fix something that is not working requestor: NOAA/EMC NOAA Environmental Modeling Center alert: NEED ACCOUNT KEY Need to assign an account key to this issue required: FOR OFFICIAL RELEASE Required to be completed in the official release for the assigned milestone MET: Grid-to-Grid Verification priority: high High Priority labels Aug 2, 2022
@JohnHalleyGotway JohnHalleyGotway added this to the MET 10.1.3 (bugfix) milestone Aug 2, 2022
@hsoh-u hsoh-u linked a pull request Sep 13, 2022 that will close this issue
15 tasks
@hsoh-u hsoh-u moved this from To Do to Pull Request Review in MET-11.0.0-beta3 (9/21/22) Sep 14, 2022
@TaraJensen TaraJensen removed the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Sep 14, 2022
@JohnHalleyGotway JohnHalleyGotway moved this from Backlog to To Do in MET-11.0.0-beta4 (11/02/22) Sep 21, 2022
@JohnHalleyGotway JohnHalleyGotway moved this from To Do to In Progress in MET-11.0.0-beta4 (11/02/22) Sep 21, 2022
@JohnHalleyGotway JohnHalleyGotway moved this from To do to In progress in Coordinated METplus-4.1 Support Sep 21, 2022
@JohnHalleyGotway JohnHalleyGotway added priority: blocker Blocker and removed priority: high High Priority labels Sep 29, 2022
@JohnHalleyGotway
Copy link
Collaborator Author

Per EMC, we need this bugfix in a 10.1.3 bugfix release ASAP.

@CPKalb
Copy link

CPKalb commented Sep 29, 2022

This discussion just came up. It looks like this is a case where the standard parallel is specified as we discovered in the first discussion. Will the fixes in this code take care of her issue as well?

@JohnHalleyGotway JohnHalleyGotway removed a link to a pull request Jan 26, 2023
hsoh-u pushed a commit that referenced this issue Jan 27, 2023
hsoh-u pushed a commit that referenced this issue Jan 27, 2023
hsoh-u pushed a commit that referenced this issue Jan 31, 2023
@JohnHalleyGotway JohnHalleyGotway moved this from 📋 Backlog to 👀 In review in MET-11.1.0 Development Jan 31, 2023
hsoh-u added a commit that referenced this issue Feb 2, 2023
hsoh-u added a commit that referenced this issue Feb 2, 2023
…ic_main_v11.0

Feature #2218 main_v11.0 polar stereographic
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Coordinated METplus-5.0 Support Feb 2, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in MET-11.1.0 Development Feb 2, 2023
hsoh-u added a commit that referenced this issue Feb 2, 2023
#2218 Initialize polar stereographics parameters for ellipsoidal earth
hsoh-u added a commit that referenced this issue Feb 3, 2023
…ic_main_v11.0

#2218 Initialize polar stereographics parameters for ellipsoidal earth
@JohnHalleyGotway JohnHalleyGotway changed the title Bugfix: Fix the MET nccf library code to Polar Stereographic data from NSIDC Sea Ice Edge NetCDF files. Bugfix: Fix the MET CF-Compliant NetCDF library code to Polar Stereographic data from NSIDC Sea Ice Edge NetCDF files. Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment