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

Feature #2218 develop polar stereographic #2418

Merged
merged 14 commits into from
Feb 2, 2023

Conversation

hsoh-u
Copy link
Collaborator

@hsoh-u hsoh-u commented Jan 21, 2023

Expected Differences

Copied from #2351
And please check the images at PR 2351.

  • Support negative delta for x and y
  • The scale_factor is computed if the standard parallel is available.
  • Added parameters for polar stereographics when the standard parallel is applied or ellipsoidal earth.
    • x_pin = y_pin = 0. (was offset from origin) for spherical earth
    • lon_pin = actual longitude of bottom left corner (was lon of the origin)
  • NSIDC Sea Ice Edge NetCDF files are polar stereographics for an ellipsoidal earth. The lat/lon conversion is not the same with polar stereographics for the spherical earth. It gives a warning
    • It's not tested with the scale_factor 1 (because no sample data file)

if "-v 15" is given, the conversion results are printed

  • input x/y, not index

  • converted lat/lon

  • computed x/y

  • difference of original x/y and compiuted x/y

  • Do these changes introduce new tools, command line arguments, or configuration file options? [Yes or No]

    If yes, please describe:

  • Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [Yes or No]

    If yes, please describe:

Pull Request Testing

  • Describe testing already performed for these changes:

Tested with two sample files with standard_parallel attribute.

  • radolan_sp.nc: with standard_parallel (spherical earth)
  • NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc with standard_parallel (ellipsoidal earth)
  • They are added to the unittest input

The tests are added to the plot_data_plane unittest (north pole for both).

/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/MET_2218_polar_stereographic_v11.0/bin/plot_data_plane \
      /d1/projects/MET/MET_test_data/unit_test/model_data/nccf/radolan_sp.nc \
      radolan_sp_PREC.ps \
      'name="PREC"; level="(0,*,*)";' \
      -title "NCCF Polar Stereographic Precipitation" \
      -v 1

/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/MET_2218_polar_stereographic_v11.0/bin/plot_data_plane \
      /d1/projects/MET/MET_test_data/unit_test/model_data/nccf/NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc \
      NSIDC0081_SEAICE_PS_N25km.ps \
      'name="F16_ICECON"; level="(0,*,*)";' \
      -title "Sea Ice Concentration" \
      -v 1
/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/MET_2218_polar_stereographic_v11.0/bin/regrid_data_plane /d1/projects/MET/MET_test_data/unit_test/model_data/nccf/NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc G001 polar_regrid.nc -field 'name="F16_ICECON"; level="(0,*,*)";'

ncdump polar_regrid.nc  | less
OR
/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/MET_2218_polar_stereographic_v11.0/bin/plot_data_plane polar_regrid.nc polar_regrid.ps 'name="F16_ICECON"; level="(*,*)";'
display polar_regrid.ps


Make sure that there some valid F16_ICECON values at regridded output, polar_regrid.nc
OR
The output of plot_data_plane shows some data.

South pole (input file is not at unit test data)

/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/MET_2218_polar_stereographic_v11.0/bin/plot_data_plane \
      /d1/personal/hsoh/data/MET-2218/NSIDC0081_SEAICE_PS_S25km_20220723_v2.0.nc \
      NSIDC0081_SEAICE_PS_N25km.ps \
      'name="F16_ICECON"; level="(0,*,*)";' \
      -title "Sea Ice Concentration" \
      -v 1
  • Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:

  • Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [Yes or No]

  • Do these changes include sufficient testing updates? [Yes]

Two more unit tests

  • Will this PR result in changes to the test suite? [Yes]

    If yes, describe the new output and/or changes to the existing output:

Two more plots:

  • plot_data_plane/radolan_sp_PREC.ps

  • plot_data_plane/NSIDC0081_SEAICE_PS_N25km.ps

  • [

  • Please complete this pull request review by [Fill in date].

Pull Request Checklist

See the METplus Workflow for details.

  • Review the source issue metadata (required labels, projects, and milestone).
  • Complete the PR definition above.
  • Ensure the PR title matches the feature or bugfix branch name.
  • Define the PR metadata, as permissions allow.
    Select: Reviewer(s)
    Select: Organization level software support Project or Repository level development cycle Project
    Select: Milestone as the version that will include these changes
  • After submitting the PR, select Development issue with the original issue number.
  • After the PR is approved, merge your changes. If permissions do not allow this, request that the reviewer do the merge.
  • Close the linked issue and delete your feature or bugfix branch from GitHub.

Copy link
Contributor

@j-opatz j-opatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review is from a tool execution perspective only, since I don't have the knowledge base to provide a code or GitHub automated testing review.
I was able to replicate the error that was described in the original Discussions, and found that running with this feature branch solved the error. I tested this against both north and south pole files that were provided and confirmed that they matched the results of an ncview command.
I don't know if the GHA failure is worth looking into, but I can confirm that the branch as it currently stands does fix the error.

@JohnHalleyGotway JohnHalleyGotway changed the title Feature 2218 polar stereographic Feature #2218 develop polar stereographic Jan 25, 2023
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.1.0 milestone Jan 25, 2023
Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on seneca as the met_test user in
/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/main_v11.0/MET-feature_2218_polar_stereographic_main_v11.0
And ran the commands for the newly added unit tests.

/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/main_v11.0/MET-feature_2218_polar_stereographic_main_v11.0/internal/test_unit/../../share/me
t/../../bin/plot_data_plane \
/d1/projects/MET/MET_test_data/unit_test/model_data/nccf/NSIDC0081_SEAICE_PS_N25km_20220723_v2.0.nc \
/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/main_v11.0/MET-feature_2218_polar_stereographic_main_v11.0/internal/test_unit/../../test_output/plot_data_plane/NSIDC0081_SEAICE_PS_N25km.ps \
'name="F16_ICECON"; level="(0,*,*)";' -title "Sea Ice Concentration" -v 1

Comparing the resulting image to an ncview image of the data, its is clear there is a problem:
Screen Shot 2023-01-25 at 5 26 04 PM

The map outlines in the plot_data_plane output (right) do not align with the obvious land/water boundaries in the ncview image (left).

Please take a closer look at the grid definition and ensure the map boundaries align with the data.

@JohnHalleyGotway
Copy link
Collaborator

@hsoh-u note that I also ran another test on the radolan_sp.nc input file. I attempted to regrid it to NCEP's 0.5 degree global grid G004:

/d1/projects/MET/MET_pull_requests/met-11.0.1/issue_2218/main_v11.0/MET-feature_2218_polar_stereographic_main_v11.0/internal/test_unit/../../share/met/../../bin/regrid_data_plane \
/d1/projects/MET/MET_test_data/unit_test/model_data/nccf/radolan_sp.nc \
G004 \
radolan_sp_G004.nc \
-field 'name="PREC"; level="(0,*,*)";'

Checking the result with ncview radolan_sp_G004.nc, I see that the regridded field contains no valid data.

If MET were actually placing this grid on the earth correctly, it would show up somewhere in the regridded G004 domain.

So I suspect that the code for handling the radolan_sp.nc input file is not working properly either.

@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Jan 26, 2023

The polar sterograhpic grid contains dx only because dx and dy should be the same. This caused the negative dy was not supported. Now the negative dy is supported and this should be saved into the polar sterograhpic grid structure.

@hsoh-u
Copy link
Collaborator Author

hsoh-u commented Jan 31, 2023

The map outline aligns the data. But east/west are swapped. Not sure how to fix this.
polar_ellipsosidal_north
Regrid:
polar_ellipsosidal_north_regrid

Copy link
Collaborator

@JohnHalleyGotway JohnHalleyGotway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of these changes.

Thanks for pushing through with this Howard! FYI, I also re-tested the plot_data_plane commands and see that the maps now align with the data.
Screen Shot 2023-02-02 at 9 14 35 AM

@hsoh-u hsoh-u merged commit 48b03c1 into develop Feb 2, 2023
JohnHalleyGotway added a commit that referenced this pull request Feb 2, 2023
Co-authored-by: Dave Albo <dave@seneca.rap.ucar.edu>
Co-authored-by: John Halley Gotway <johnhg@ucar.edu>
Co-authored-by: Seth Linden <linden@seneca.rap.ucar.edu>
Co-authored-by: johnhg <johnhg@ucar.edu>
Co-authored-by: Lisa Goodrich <lisag@seneca.rap.ucar.edu>
Co-authored-by: jprestop <jpresto@ucar.edu>
Co-authored-by: Howard Soh <hsoh@seneca.rap.ucar.edu>
Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu>
Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com>
Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com>
Co-authored-by: Julie Prestopnik <jpresto@seneca.rap.ucar.edu>
Co-authored-by: Jonathan Vigh <jvigh@ucar.edu>
Co-authored-by: bikegeek <3753118+bikegeek@users.noreply.github.com>
Co-authored-by: davidalbo <dave@ucar.edu>
Co-authored-by: hsoh-u <hsoh@ucar.edu>
Co-authored-by: Julie Prestopnik <jpresto@ucar.edu>
Co-authored-by: Seth Linden <linden@ucar.edu>
Co-authored-by: lisagoodrich <33230218+lisagoodrich@users.noreply.github.com>
Co-authored-by: Daniel Adriaansen <dadriaan@ucar.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
3 participants